cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Wire Viewer on STM32H7S3L8

PhilMaz
Associate II

Has anyone worked with the Serial Wire Viewer on an STM32H7RS board?

We've been using it on a F7 board, without too much issue, but we are stuck on this new board. 
We've followed the usual steps :

- Enable Serial Wire Viewer (SWV) in Debug configuration (using the CPU Core Clock)

PhilMaz_0-1736843286859.png

- Overwrite the "_write" function to use ITM_SendChar(...) (also tested that it works and calls it for every character we send with printf()

- Open the SWV ITM Data Console, enabling port 0 and start trace. 

However, nothing appears in the console :( 

We double checked the clock ..

PhilMaz_1-1736843475216.png

We also tried to enable the debug mode for our application (although, it doesn't seem to change anything in the code)

PhilMaz_2-1736843517043.png


But so far nothing..
One thing to note is that our application uses ThreadX and NetXDuo (I don't know if it has an impact...)
We are also using a simple STLINK-V3 connector to debug

12 REPLIES 12
Pavel A.
Super User

Core clock mismatch – make sure the CPU core clock configured in the debug settings exactly matches the running core clock

Exactly. The value of SystemCoreClock global variable (standard CMSIS), divide it by 10**6 (Hz to MHz) and put the result into the GUI. But remember that the CPU starts off with some internal clock, so the ITM won't work until the program calls SystemClock_Config (or equivalent) to start the PLL and it stabilizes at the given frequency.

But the debugger starts the ITM much earlier, maybe at the first breakpoint at main, or so - and it starts streaming some data at a wrong frequency. This can confuse the debugger while it tries to parse the data. I guess this may be the reason why ITM is so flaky.

 

PHolt.1
Senior III

Interesting point.

The CPU probably starts at 16MHz. That is the 32F4 speed.

The breakpoint on main() is configurable but you need a PhD in UI design to find where (it is under Project / Properties ... Debugger and one of the other tabs like Startup, IIRC).

We have faced the same issue using NUCLEO-H753ZI