2024-08-01 01:08 AM
Currently the Cube SWV ITM debug console does not receive the data unless you have built the project using the build+debug option F11.
This is a problem sometimes, when running code which contains the debug statements but which wasn't loaded from Cube IDE.
Or maybe there is some other program which can interface to STLINK V3 and receive this data?
2024-08-01 01:31 AM
You can use CubeProgrammer and connect to SWV :
+ just set real cpu frequ.
2024-08-01 01:36 AM - edited 2024-08-02 09:06 AM
ST-LINK Utilities used to do it and STM32 Cube Programmer can do so now.
Code running on MCU can set up ITM, DWT and FPB too depending on how hard core bare metal you want to go.
2024-08-01 12:42 PM
Yes this is great. I have the ST Link Utility and that picks up the data
Curiously it reboots the target when it starts up but that's OK.
Thank you all!
2024-08-02 08:59 AM
Hello @PHolt.1 ,
Yes, it is possible to receive Serial Wire Viewer debug data. These steps could be helpful:
#include "stm32f4xx.h"
in the write function:
__attribute__((weak)) int _write(int file, char *ptr, int len)
{
(void)file;
int DataIdx;
for (DataIdx = 0; DataIdx < len; DataIdx++)
{
__io_putchar(*ptr++);
ITM_SendChar(*ptr++);
}
return len;
}
In the debug session, open the SWV IT Data Console window and configure the port for receiving data, then click the button to run the view.
Thanks,
Rim
2024-08-02 09:08 AM
Not sure if ST-LINK Utilities offer connectivity options, ie so you can hot-plug
STM32 Cube Programmer might have more, and less disruptive, connection modes.
There should be a SWV tab/pane on the newer versions