How to configure shared mode

For debugging purposes, it can be of some interest to run simultaneously one IDE and STM32CubeMonitor. This feature is named "Shared mode".

The Shared mode enables the use of STM32CubeMonitor in parallel with another application supporting Shared mode such as STM32CubeIDE, STM32CubeProgrammer or IAR Embedded Workbench.

With STLink Two communication protocols are available:

  • "p2p": to directly connect to the probe, which guarantees high-rate data acquisition (default protocol)
  • "tcp": to pass through to tcp-server, assuming the stLinkServer is installed on the host. The Shared mode is based on the "tcp" protocol.

Below a example of a probe connected in Shared mode. The connection status is indicated in the flow by "tcp connected".

flow in tcp mode

To set the type of connection mode, configure the connectionType parameter to "tcp" in the settings.js file (see STM32CubeMonitor:How to change general settings).

With Jlink only p2p mode is available.

1. How to set Shared mode with STM32CubeIDE

Open the Debug Configurations pane.

Go to the Debugger tab.

Select the “Enable shared ST-LINK” option.

CubeIDE share stlink.png

2. How to set Shared mode with IAR Embedded workbench IDE

To enable TCP mode in IAR Embedded Wokbench IDE:

Go to Project > Options > Debugger > Extra Options.

Add in --stlink_use_server in the command line options.

Configure shared ST Link in IAR

3. How to set Shared mode with ARM Keil uVision

To enable TCP mode in uVision :

Go to Project > Options for Target xxxx > Debug tab and open ST-Link Debugger settings :

STLink settings menu

In the Debug adapter box, select the option "Shareable ST-Link"

Activate sharing