SWO Issues: SWO works only once (MCUXpresso IDE 11.4.1, LPC55xx)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SWO Issues: SWO works only once (MCUXpresso IDE 11.4.1, LPC55xx)

2,326 次查看
danielholala
Senior Contributor II

Hi there,

I'm using MCUXpresso IDE 11.4.1 and I'm trying to use SWO trace with LPC55xx boards. So far I've tried my custom board with LPC5526 and also LPCXpresso55S28 evaluation board. My debug probe is LPC-Link2 running firmware V5.361.

The issue:

I can use the SWO views only in the first debug session after starting MCUXpresso IDE. 

How to reproduce:

I compiled the demo app "hello_world_swo" from the SDK of the evaluation board and started a debug session. When the debugger halts execution at the default breakpoint at the beginning of main(), I press F8 to resume execution. (NB: SWO clock speed has been set correctly from prior runs.)

Then in SWO Profile I press "Resume data display". I have to wait about 15 seconds then tracing starts:

danielholala_0-1641565387078.png

According to the statistics, SWO connection is ok:

danielholala_1-1641565426020.png

 

Then I stop the debug session and start a new one. I follow the steps described above and get this error message:

Data communication error
Error encountered during data processing.

 

danielholala_2-1641565846998.png

To get SWO Trace working again, I have to close MCUXpresso IDE and restart it.

 

Please help. Thanks.

 

0 项奖励
回复
6 回复数

2,306 次查看
danielholala
Senior Contributor II

When debugging in "all-stop" mode (instead of "non-stop" mode that I used before)

Debug SettingsDebug Settings

 

SWO does not work at all for me.

Symptoms:

I get an error when detecting clock speed (in SWO Trace Config view):

danielholala_1-1641823603255.png

 

If I enter the clock speed manually and start an SWO Trace, I get the following error message window:

"Failed to initialize SWO trace.
Reason:
Failed to configure the probe for SWO. Unable to set DEMCR core registers. Please make sure that the clock has been properly configured in the application."

danielholala_2-1641823639909.png

Searched for this error message but resulted in no exact hits. Am I the first one to observe this error message? That's very odd. 

Any help is appreciated!

Best regards,
Dan

0 项奖励
回复

2,275 次查看
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @danielholala 

 

I would like to apologize for the delay. I got sick suddenly and couldn't write a response to you.

 

Regarding your concern, at the end I got confused, so are not you able anymore to init the SWO Trace inclusive if you restart MCUXpresso? Sometimes, before running again your code in your mcu, it is necessary to unplug and then plug it again or as you mentioned, closing MCUXpresso and re-opening it again. Just to be sure, your debugging interface is by using a LPC-Link2 with CMSIS-DAP, right?

 

In order to get the SWO working well, please follow the advices and steps posted on these couple of links that might be helpful to you to solve or avoid the errors:

https://mcuoneclipse.com/2017/06/01/mcuxpresso-ide-swo-performance-counters/

https://mcuoneclipse.com/2016/10/17/tutorial-using-single-wire-output-swo-with-arm-cortex-m-and-ecli...

 

If the problem persist, Please let me know, so I can help you with.

 

Thank you so much.

Sincerely,

Pablo Avalos.

0 项奖励
回复

2,249 次查看
danielholala
Senior Contributor II

Hi @PabloAvalos ,

Thank you for getting back to me.

According to my observations, operation of SWO depends on the setting of "IDE Debug Mode":

Debug SettingsDebug Settings

When using "non-stop" mode, SWO works in the first debug session. In all further debug session, an error window pops up (as described before).  To use SWO again, I need to close MCUXpresso and re-open it again. 

When using "all-stop" mode, SWO does not work at all. Not even if I also unplug and then plug in the LPCXpresso55S28 board again.

Best regards,
Daniel

0 项奖励
回复

2,228 次查看
danielholala
Senior Contributor II

Updated to MCUXpresso 11.5.0. These are my observations.

SWO has improved a lot:

- Sluggish behaviour after confirguration is gone.
- SWO works in consecutive debug sessions.

The following issues still exist with SWO:

- Does not work when debugging in "all-stop" mode.
- Does not work with J-Link firmware.

The following issues still exist with SWO ITM Console:

- Duplicate SWO output.
- When clearing data display (button with red cross symbol), subsequent outputs do not appear until the number of lines that had been printed prior to clearing display is exceeded.

Tested with LPCXpresso55S28 and integrated LPC-Link2 V5.361

0 项奖励
回复

2,194 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

Hi,

Regarding SWO with all-stop: we tried with 11.5.0 & LPC55s28 & LPC-LINK2 v5.361 and seems it works with no issue:

lpcxpresso_supp_0-1642678562125.png

Can you please check if:

1. you executed board initialization before going to SWO configuration

2. still reproducible if you switch to another USB cable

 

Regarding the ITM Console issues we confirm that are reproducible on our side too.

 

Regards,

MCUXpresso IDE Support

2,131 次查看
danielholala
Senior Contributor II

Thanks for trying to reproduce this issue.

Tried a different USB cable. Let the code run past (clock) initialization. SWO still does not work for me in all-stop mode.

- no automatic clock detection
- same error message as before "Failed to initialize SWO trace Reason: .... DEMCR core registers..."

danielholala_0-1643035396378.png

Tested with MCUX Ide V11.5.0, LPXCpresso55S28, integrated LPC-Link2 and test project from SDK LPC5526 V2.10.1

0 项奖励
回复