NOTICE: This website will be shut down in the near future. Product content has moved to nxp.com. Forum content and FAQs have been moved to community.nxp.com. We encourage you to create a user account on nxp.com to use the new community forums and access NXP microcontroller content. We greatly appreciate your contributions and look forward to seeing you at our new web location.

 

SWO Trace setup for LPC43xx

lpcxpresso-support's picture

SWD vs JTAG

SWO Trace functionality is only available when connecting to the target MCU using SWD. Unlike other Cortex M3/M4 based MCUs, LPC43xx debug connections are made often made via JTAG so as to support multicore debugging.

In LPCXpresso IDE v7.8.0 and later, when you first debug a project, you will be given the option to select SWD (enabling the use of SWO Trace) or JTAG (to support multicore debugging). But in earlier LPCXpresso IDE releases, JTAG will always be selected by default for LPC43xx debug connections. Therefore you will need to switch to using SWD in order to use SWO Trace functionality. For details of how to do this, please see:

If this is not done, then you will see the error:

  • "SWD debug connection required to use SWO Trace. JTAG debug connection was detected."

Clock Configuration

SWO Trace needs to be configured to match the current MCU clock speed in order to function correctly. Typically the LPCXpresso IDE can automatically detect this from the SystemCoreClock global variable.

However some older example code based on the older LPC43xx Peripheral Driver Library (PDL) codebase - for instance the legacy examples for the NGX, Hitex, Keil and Diolan boards found in the "install_dir\lpcxpresso\Examples\NXP\LPC4000\LPC43xx" subdirectory of your LPCXpresso IDE installation - actually set SystemCoreClock incorrectly to 96000000 (96MHz). If you enter this value into the Clock speed setting of the SWO Config view, then you will not see any SWO trace data displayed.

For these PDL based examples, the actual setting you need to enter into the Clock speed setting is 72000000 (72MHz).

Note : There are no such issues if you are using projects based on LPCOpen - here the value of SystemCoreClock can be used directly.

0
Your rating: None
feedback