Hi there,
I have a custom board with LPC5526. It has an SWD connector with SWO connected to PIO0_8. So far I had no issues with debugging my program using MCUXpresso IDE 11.4.1. I can stop the program, set breakpoints and everything else in the debugger works like a charm.
Now I wanted to use the SWO Debug views that MCUXpresso provides (e.g., SWO ITM Console). Using Pins Tool, I configured PIO0_8 for SWO. In SWO Trace Config I set the clock speed to system clock speed (which is 100 MHz).
However, as soon as I click "Resume data display" (white triangle on green ball) in, e.g., SWO ITM Console I get the error message:
Failed to initialize SWO trace.
Reason: Failed to configure the probe for SWO. Unable to program the SWO coresight component.
I wonder why this is?
Do I have to explicitly enable the Trace clock first?
I'M asking as neither the User Manual UM11126 (chapter 51) nor the "MCUXpresso IDE SWO Trace Guide" (included with MCUXpresso installation) suggest to enable TRACECLKSEL before using SWO.
Thanks.
解決済! 解決策の投稿を見る。
I figured that my custom board is having no SWO issues. It's running perfectly as is the LPCXpresso55S28 board. However, SWO only works in the first debug session after starting MCUXpresso IDE. As soon as I stop debugging and start to debug my project again, the error message window appears. So I assume that this is a bug in MCUXpresso IDE.
Hello danielholala,
OK, thanks for your sharing, about your IDE case, there will be other help you.
BR
Alice
Hello danielholala,
How about directly use the demo "hello_world_swo" under SDK/
BR
Alice
Hi Alice,
followed your advice:
I imported this example from the SDK for the LPCXpresso55S28 evaluation board. This board includes a LPC-Link2 debug probe if I'm not mistaken.
After compiling and starting a "Debug session", debugger stops it in main() (default breakpoint) as usual and I continue execution.
While the target ist running, I go to SWO Trace Config and set clock speed. A clock speed of 12 MHz is detected. See screenshot:
SWO Status is incomplete:
Starting SWO "Resume data display" results in the same error message window as reported earlier:
Data communication error
Error encountered during data processing.
Please advise. Thanks.
Hello again,
I now configured Trace Clock to 100 MHz using Clocks Tool (TRACECLKDIV = 0, i.e., Trace Clock == System Clock). LPC-Link2 debug probe is connected to target via 100 mm ribbon cable.
Further, after starting a debugging session on the target (using MCUXpresso IDE) I let it run past the clock configuration code to make sure all clocks are configured properly.
Then in "SWO Trace Config" I click on "Change" button and click on "Detect". A clock speed of 100 MHz is detected. I accept this value.
This is what "SWO Trace Config" looks like thereafter:
and
Everything seems ready to start an SWO trace.
However, clicking on "Resume data display" in any of the SWO views results in this error message window:
Data communication error
Error encountered during data processing.
see screenshot:
I got the SWO trace running only twice on this board and I have difficulties getting it to work again.
Hi Alice,
the thread includes one additional step "Step3. Enable SWO Trace clock" which is not explicitly mentioned in the device manual UM11126.
I might sound tedious but this should be explicitly mentioned in the device manual.
Now to configure trace clock, I need to know what the maximum speed of the SWO is. Manual states that I should set TRACECLKDIV to 0 (i.e., divide by 1). Connected to system clock this would mean a trace clock for SWO fo 100 MHz in my system. I wonder whether this is too high.
Thanks.