2021-09-19 01:24 PM
I am successfully using all the SWV debugging functionality in STM32CubeIDE except for the ITM functionality, as described in UM1609 and in the advanced debugging videos on youtube from ST.
I have both tried overriding the "_write " function in main.cpp or replacing "__IO_putchar" with "ITM_SendChar" in syscalls.c, but I don't see any output when using printf and ITM port 0 (described in video 4 and section 4.3.5 in UM1609).
I have further tested sending output to ITM port 31, as described in video 5, but still cannot see any output.
Some details and further questions
Solved! Go to Solution.
2021-09-20 07:33 AM
I finally figured out that it was the clock speed that was the problem. I am not sure what the limit is for running ITM is, but it is working for 84 MHz and not on 180 MHz. I assume that the other SWV traces will also be inaccurate at high clock as data will be lost in transfer and not be shown in graphs and logs.
2021-09-20 04:02 AM
I have tried ruling out a few things by copying the code from the youtube ST advanced debugging video series:
The advanced debugging capabilities in STM32CubeIDE is really impressive if i can make it work. Can someone test the ITM functionality on a different MCU or board? Preferably on a M4.
2021-09-20 05:10 AM
Tested now also the original code from ST (http://bit.ly/AdvDebugMaterials) with my Nucleo-F722ZE on 216 MHz default system clock, but I still get no output from ITM. All other SWV functionality is working. What am I missing?
2021-09-20 06:46 AM
> SWO is left unconnected
Fairly sure SWO is used to transfer ITM information.
2021-09-20 07:23 AM
Check with STM32 Cube Programmer or ST-LINK Utilities, both have a SWV Viewer
There must be a common understanding of the clock speeds.
Print those clocks out, perhaps also pull the SWO divider value out.
Double check solder bridges on DISCO and NUCLEO boards, ensuring PB3/SWO get to the debugger, and the pin isn't reconfigured elsewhere.
Check RCC/GPIO registers.
2021-09-20 07:33 AM
I finally figured out that it was the clock speed that was the problem. I am not sure what the limit is for running ITM is, but it is working for 84 MHz and not on 180 MHz. I assume that the other SWV traces will also be inaccurate at high clock as data will be lost in transfer and not be shown in graphs and logs.
2024-04-10 01:48 AM - edited 2024-04-10 01:54 AM
Updating to the ST-Link current latest version 3.14.5 fixed the issue for me. Try that first before attempting to downgrade your ST-Link. I have testet this with an STM32G491RE-Nucleo and STM32CubeIDE version 1.15.
Hope this helps :)
Edit: Clock speed should not be an issue, I have testet it at 170MHz. The clock is anyway prescaled down as shown in the upper left under "Clock Settings".