cancel
Showing results for 
Search instead for 
Did you mean: 

What causes the strange behavior in SWO Data Trace/ ITM?

NCTUser
Associate III

I am trying to gain some confidence using the SWO debug methods

but I experienced some strange beavior what I cannot explain.

1. I tried to send a 32 bit value though ITMPort1 in an inifite

loop and it works awhile but sometimes it switches to ITMPort21 and

the value is different what I sent. After several hundred packets

it changes back to ITMPort1 and 0xABCDEF, which is the correct

value. I do not see any overflows. It the ITM sends the correct

values sometimes I see randomly wrong values.

2. I tried the Data Trace function. If I ask both read and write

event for a variable it works well, but if I set only the read or

write event, I do not get the data trace events. The Trace Log

window is full of ITMPort15 packets (which is not enabled) and

the Data trace window is empty.

The itmCounter1 and itmCounter2 variables are declared as volatile,

and the optimization is switched off (-O0).

I use STM32CubeIDE 1.0.2, the target, is stm32f102, the debugger

is F302 Nucleo board and sometimes ST-LINK V3SET.

Could anybody explain what happenes here? This is not the behavior

which I expect. Do I something wrong when I configured the SWD/SWO?

I appreciate any answer.

0 REPLIES 0