Arm Cortex-M / SWO trace: A variable is not recorded from the beginning

01-Aug-2024

Errors like missing data, no trace messages shown in the terminal window, or data displayed at the wrong address in the trace recording can be a result of SWO tracing during the PLL initialization. SWO trace during the PLL (Phase-Locked Loop) initialization is not supported by winIDEA.


Possible solutions  

Start tracing after PLL is completely initialized

For example, set a breakpoint after the PLL initialization is concluded and start the trace at that point to capture all the events after the PLL is initialized.




The above also applies to monitoring ITM trace messages through the terminal window. Make sure to connect the terminal session only after the initialization of the PLL, when the clock is matching the SWO trace settings configured in winIDEA.


Synchronization packets (SPs) is trace data - an output from the ITM. These types of trace packet formats are unique patterns in the bit-stream that enable capture hardware to identify bit-to-byte alignment. SPs are sent out periodically in the course of a trace with the first one send on the very beginning of the trace. They need to be captured by the BlueBox, under the condition that a correct Clock is configured (SWO Clock e.g. 200 MHz), to accurately decode information. To get the correct decoding information and capture the first SP, the initialization, which changes the clock, has to be finished before the recording (New Analyzer Session) can begin. If the BlueBox is not able to catch the initial Synchronization packet it won't be able to decode the trace stream until the next SP is captured. 


If possible use the Parallel trace capture method instead of SWO

winIDEA supports Parallel Trace during the PLL initialization. Note that additional trace pins are required.

Was this answer helpful?