Hi,
My company develops debuggers and currently I am trying SWV trace on MIMXRT1170-EVK board.
I am unable to perform it and I am currently facing a very similar issue as in this article:
https://community.nxp.com/t5/MCUXpresso-IDE/What-the-IDE-will-do-when-i-check-SWO-init-by-IDE-for-RT...
If "Force SWO initialization by IDE" checkbox is checked in MCUXpresso IDE, the SWO signal is output from PB3 of the MIMXRT1170-EVK board.
But if I perform the same operations that are displayed on the Trace Console using my code, nothing is output on the SWO signal from PB3 of the MIMXRT1170-EVK board.
May I know if there is any additional processing/setting that is done when "Force SWO initialization by IDE" is enabled?
I am attaching the output from the Trace Console (console_output.txt) and my code (my_code.txt) for reference.
I would appreciate any help in this matter.
Thank you.
See section 1.5 (1.5.2 in particular) from SWO Trace user guide for some details about the "Force SWO initialization by IDE". Long story short, J-Link attempts to initialize SWO (incomplete/incorrect for IMRT1170) as well but that checkbox makes the IDE use a custom SWO initialization, ignoring the one from J-Link side.
Moreover, my understanding is that you're able to make SWO work when using the IDE with the J-Link probe. However, SWO doesn't work when you're running the app with SWO initialization but without debugger attached. Is my understanding correct? If this is the case, we've came across this one as well. IMRT1170 has the debug & trace inside one module called CSSYS, whose reset is based on TCK (information we have from design teams). You'll need some SWD_CLK edges to pull CSSYS out of reset state. I found an older email thread with the following snippet that can be added in "BOARD_InitPins" that will eventually enable CSSYS:
for(int j = 0; j<10; j++)
{
IOMUXC_SetPinConfig(
IOMUXC_GPIO_LPSR_14_JTAG_MUX_TCK,
0x02U|(1<<2)|(0<<3)); // pull down
for(int i=0; i<1000; i++);
IOMUXC_SetPinConfig(
IOMUXC_GPIO_LPSR_14_JTAG_MUX_TCK,
0x02U|(1<<2)|(1<<3)); // pull up
for(int i=0; i<1000; i++);
}
IOMUXC_SetPinConfig(
IOMUXC_GPIO_LPSR_14_JTAG_MUX_TCK,
0x02U|(0<<2)); // disable pull up/down
It's worth trying.
Regards,
Adrian