L4 and printf via ST-Link
Looking for assistance on getting printf() working with the Nucleo-L452RE-P board (MB1319 B-01) using the built-in ST-Link (not UART, and not semi-hosting). I get output in the console, but the text doesn't match. E.g. if I call 'printf('abc\n')', I get ��� in the output.
To Produce:
I created a project in CubeMX, set Debug to Trace Asynchronous Sw, set SYSCLK and HCLK to 16 MHz, and generated a project for TrueStudio.
In TrueStudio, I created syscalls.c, and modified the _write() function to use ITM_SendChar(). In the debugger configuration, I made sure the Interface was set to SWD, enabled Serial Wire Viewer, and set the Core Clock to 16 MHz.
I started a debug session, configured the SWV Console to use ITM Stimulus Ports 0, hit Start Trace, and then Resume (start execution).
Stepping through code and checking variables in the Expressions window works fine.
Additionally, I tried printf with the L4 board and IAR Embedded Workbench, and that displayed the same problem as TrueStudio.
As a sanity check, I tried the procedure with a Nucleo F103RB board (MB1136 C-01), and received the expected output with printf(), so that worked fine.
Any advice on how to debug this issue?
#printf #stm32l4