Hi,
(I'm reposting this, as I think something went wrong with the last one.)
I am trying to get SWO Trace working in MCUXpresso, but without success.
Whatever I try, the 'Change' button in the SWO Configuration section of the Configuration tab remains greyed out (as do the other settings).
I am able to debug ok with MCUXpresso. I.e. I can download software to the target board and run it, and break/start/stop/step etc as you would expect.
Our target board uses an RT1021 and has the following connections:
I am using the NXP LPCXpresso LPC-Link 2 (Rev B) connected via the 10-pin J7 connector to our target board.
Here is a list of some of the documents and web pages that I have gleaned information from:
This is what I have done so far:
So my questions:
Many thanks and regards,
Ronnie
Solved! Go to Solution.
Hi Kerry,
Thank you for your reply.
I have discovered what the problem was. When I change the has_swo setting to true in the SDK manifest file, I also need to do the same in any .launch file that I am using. Actually I simply delete the .launch files and let MCUXpresso recreate them (it pulls in the correct has_swo setting). I couldn't find a setting in MCUXpresso that let me set this via the GUI.
So in case anyone needs it, here are the things I needed to do to get SWO Trace working on the RT1021 using a LPC-Link 2 and MCUXpresso:
No need to worry about copying retarget_itm.c or anything else.
FYI: Remember that the RT1021 routes JTAG_TDO and SWO to different pins in case that has a bearing on the target hardware.
Hope that helps.
Ronnie
Hi @rshipman ,
Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.
When you use the LPC-Link 2 test with RT1020, which SDK code you are using? please use the helloworld test it, don't use the led_blinky, as the led_blinky will use the pin which is connected to the LPC-LINK2, then it will influence the debug.
If you have external Segger JLINK, I think you also can try the directly JLINK.
Answer your questions:
1 What have I missed - is the above all I need to do to get SWO Trace to work?
Answer: Normally, these steps to enable the SWO.
1) check pinmux.c , enable the SWO pin.
In fact, newest SDK code already add it:
void BOARD_InitPins(void) {
CLOCK_EnableClock(kCLOCK_Iomuxc);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, 0U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, 0U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_11_ARM_CM7_TRACE_SWO, 0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_11_ARM_CM7_TRACE_SWO, 0x10B1U);
}
2) trace clock enable, I find the clock_confg.c also enable it.
3) main
Add the ITM_SendChar('A');
After entering the debugger, open the SWO configuration, whether you can see the swo target speed?
If you can see the speed, it means it works. Otherwise it still have issues.
Just use the LPC-LINK2 test the helloworld, not the led_blinky.
2 Are the 3 SWD signals all that I need to get SWO Trace to work in MCUXpresso?
Answer: SWD_CLK, SWD_DAT, RESET, SWD_SWO, GND, VDD, these pins is enough.
3 Or do we need 2-wire or 4-wire SWD? I believe the RT1021 only supports 1-wire.
Answer: check point 2.
4 Do we actually need SWO for the profiler and interrupt history?
Answer: check point 1.
5 Will this work with the LPC-Link2? In the document (MCUXpresso IDE SWO Trace Guide, Rev. 11.4.1) is this note: "Note: SWO cannot be used with other CMSIS-DAP based probes or with LPC-Link2 debug probes using the non default Non Bridged (NB) or Serial (ser) firmware. Non LinkServer probes may also provide SWO trace capabilities via other software – check the vendors' websites for more details." What does this mean?
Answer: As I know, LPC-LINK2 firmware with JLINK or CMSIS DAP shoud works. which firmware you are using now? Do you try the MIMXRT1020-EVK, whether that works or not?
If yu still have issues, just kindly let me know.
About the issues, you can give me some screenshot.
Best Regards,
Kerry
Hi Kerry,
Thank you for your reply.
I have discovered what the problem was. When I change the has_swo setting to true in the SDK manifest file, I also need to do the same in any .launch file that I am using. Actually I simply delete the .launch files and let MCUXpresso recreate them (it pulls in the correct has_swo setting). I couldn't find a setting in MCUXpresso that let me set this via the GUI.
So in case anyone needs it, here are the things I needed to do to get SWO Trace working on the RT1021 using a LPC-Link 2 and MCUXpresso:
No need to worry about copying retarget_itm.c or anything else.
FYI: Remember that the RT1021 routes JTAG_TDO and SWO to different pins in case that has a bearing on the target hardware.
Hope that helps.
Ronnie