cancel
Showing results for 
Search instead for 
Did you mean: 

Effect of CubeMX DEBUG Settings

dmocom
Associate II

Other than reserving pins for the hardware-implemented debug interface (Fig. 1), what are the effects of the highlighted settings of the "Trace and Debug" category of CubeMX (Fig. 2)?

 

dmocom_2-1709880966211.png

Fig 1: Debug infrastructure (RM0433)

 

dmocom_1-1709880891568.png

Fig 2: CubeMX Trace and Debug

 

Changing those settings has no effect in regard of code generation.

 

How would one utilize i.e. External Trigger Bi-directional? I would have expected the system to halt (essentially triggering a breakpoint) on a signal change of the reserved TRGIO pin when activating this setting - but nothing happens. The same is true for the other direction, triggering a breakpoint does not change the value on the TRGIO pin.

 

The same goes for the setting Trace Synchro SW (x bits). SWDIO and SWCLK can be used to communicate with a debugger, but TraceD0 seems to do nothing?

 

I could not find an answer in the datasheet as referenced by Table 595 in RM0433.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

How would one activate the External Trigger Bi-directional for example? Or the synchronous tracing? 

One instructs the debugger (or other software) to connect to the target in desired mode. For example to use ITM trace, you check the box in the debugger dialog and select SWD mode (not JTAG). The debugger then configures the debug module of the target MCU.

 

View solution in original post

3 REPLIES 3
Pavel A.
Evangelist III

Selection of debug mode in CubeMX/IDE does not have other effects besides of reserving the pins (which is already valuable).

Activation of the debug mode is what matters. This occurs when the debugger connects to STM32 or the program  running on STM32 pokes the DBG module and related things (cross-trigger interface, ETM, ITM, trace...)

@Pavel A.Thank you.

How would one activate the External Trigger Bi-directional for example? Or the synchronous tracing? Is this the responsibility of the debugger hardware/tool?

SWD is straight forward since it is the default(?) debug interface and used by the ST-Link debugger.

Pavel A.
Evangelist III

How would one activate the External Trigger Bi-directional for example? Or the synchronous tracing? 

One instructs the debugger (or other software) to connect to the target in desired mode. For example to use ITM trace, you check the box in the debugger dialog and select SWD mode (not JTAG). The debugger then configures the debug module of the target MCU.