SystemWorkbench Logo

SystemWorkbench for STM32

SWOTraces

It is possible to display the traces sent by an application over SWO line. A pin configuration is required: the CubeMX SWO configuration must be selected for the PB3 pin. Check that the following configuration is applied:

CubeMX SWO configuration

The application must be linked with the librdimon library. To do so, update the Linker Flags with the following parameter as shown is the newt figure: -specs=nosys.specs -specs=nano.specs

Linker flags

In the main.c file, the stdio.h header file has to be included...

Included header file

...and the following code lines have to be added in the application to root the traces from the printf function toward the ITM_SendChar function to be output on the PB3 pin:

Extra code lines

Then while using a printf, get the corresponding traces in the SWO viewer:

SWO Traces


For more information about C/C++ development tools in Eclipse, please see C/C++ Development User Guide.