cancel
Showing results for 
Search instead for 
Did you mean: 

SWV not working with STM32CubeMX on TrueStudio

DMeye
Associate II

I'm working with a Stm32 Nucleo F429Zi board and I am having trouble getting the SWV working when debugging. When I created a blank new project and went through the Atollic tutorial to redirect printf() to go to _write() and eventually ITM_SendChar(). This project worked and printed everything fine so I decided to go ahead using CubeMX because I wanted to include lwIP.

After creating the project in CubeMX, without altering many settings, I went through the exact same steps as the previous project to redirect printf. However, when I tried printing in a loop the swv console only showed very strange characters (possibly from the extended ASCII codes) but only all at once, not a constant feed from the loop. I tried just using ITM_SendChar and followed it when debugging all the way until it executes, ITM->PORT[0].u8 = (uint8_t) ch; where the ch value was correct. However, when I look at the SWV trace log, the values going into port 0 are random and happen at the same time.

Since this project was done with the same procedure and has identical code and settings as far as I can tell, my assumption is it has to do with CubeMX changing a setting somewhere. Feel free to ask any question or for any snippets of code, although there isn't much original code on my part. Thanks for any help!

0 REPLIES 0