I am trying to enable the SWO on my FRDM K64F board. I am able to connect to the mcu with my multilink FX fine with the SWD protocol. The issue I am having is that I can not get the SWO features to work. I have setup the SWO pin using the config tool as follows:
/* PORTA2 (pin 36) is configured as TRACE_SWO */
PORT_SetPinMux(PORTA, 2U, kPORT_MuxAlt7);
When I connect with the P&E multilink all of the SWO options are grey and none of those options work. Is there anything else that needs to be done in order to get the SWO to output the interrupt statistics? I have searched and how not found much information. Thanks in advance.
Hello Jing,
I read the document you mentioned, and it was not really any help the only "step by step" part was for LPC mcu's. I figured it out on my own however. The K64F mcu also needs the trace clock enabled, which there is no mention of in the document you mentioned. I will include what I did here in case anybody else has the same issue.
In the clock initialization part of the code add the following define
#define SIM_TRACE_CLK_SEL_CORE_SYSTEM_CLK 1U /*!< Trace clock select: Core/system clock */
Then enable the trace clock with the line below
/* Set debug trace clock source. */
CLOCK_SetTraceClock(SIM_TRACE_CLK_SEL_CORE_SYSTEM_CLK);
Lastly enable the clock for port A, and setup pin 36 for SWO trace.
/* Port A Clock Gate Control: Clock enabled */
CLOCK_EnableClock(kCLOCK_PortA);
/* PORTA2 (pin 36) is configured as TRACE_SWO */
PORT_SetPinMux(PORTA, 2U, kPORT_MuxAlt7);
The above still does not work with the multilink FX, as far as getting interrupt traces, but will allow to debug. However if using a j-link it all works.
Hi Krzysztof,
This doc if fit for all MCU which is supported by MCUXpresso, not only for LPC.
PTA2 is default for SWO, you needn't config it.
The P&E Micro debug chain will automatically calculate the target clock speed therefore this configuration step is not required to establish trace capture.
But not all PE multilink are supported. There is version limit
• Multilink Universal RevD
• Multilink Universal FX Rev C
• Multilink ACP Rev B
So,
Regards,
Jing