<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX Processors中的主题 Re: RT1021 SWO Trace problems</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/RT1021-SWO-Trace-problems/m-p/1411679#M186847</link>
    <description>&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Modify the SDK manifest:&lt;UL&gt;&lt;LI&gt;Edit the SDK archive. E.g.: &lt;FONT face="courier new,courier"&gt;C:\Users\Ronnie Shipman\mcuxpresso\02\SDKPackages\SDK_2_10_0_EVK-MIMXRT1020.zip&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Edit the manifest file. E.g.: &lt;FONT face="courier new,courier"&gt;EVK-MIMXRT1020_manifest_v3_8.xml&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Edit the line (search for has_swo): &lt;FONT face="courier new,courier"&gt;&amp;lt;params id="internal.has_swo.release.MIMXRT1021xxxxx" name="internal.has_swo" value="true"/&amp;gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Modify/recreate the .launch files relating to this hardware as mentioned above.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;After the call to BOARD_BootClockRUN() I have added the line:&lt;UL&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_EnableClock(kCLOCK_Trace);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;FYI: In BOARD_BootClockRUN are the lines:&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/* Disable TRACE clock gate. */&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_DisableClock(kCLOCK_Trace);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/* Set TRACE_PODF. */&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_SetDiv(kCLOCK_TraceDiv, 2);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/* Set Trace clock source. */&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_SetMux(kCLOCK_TraceMux, 2);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;The SWO Config in MCUXpresso will ask for the trace clock speed.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No need to worry about copying retarget_itm.c or anything else.&lt;/P&gt;&lt;P&gt;FYI: Remember that the RT1021 routes JTAG_TDO and SWO to different pins in case that has a bearing on the target hardware.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;Ronnie&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 09:14:38 GMT</pubDate>
    <dc:creator>rshipman</dc:creator>
    <dc:date>2022-02-10T09:14:38Z</dc:date>
    <item>
      <title>RT1021 SWO Trace problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RT1021-SWO-Trace-problems/m-p/1404649#M186274</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(I'm reposting this, as I think something went wrong with the last one.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am trying to get SWO Trace working in MCUXpresso, but without success.&lt;/P&gt;&lt;P&gt;Whatever I try, the 'Change' button in the SWO Configuration section of the Configuration tab remains greyed out (as do the other settings).&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Our target board uses an RT1021 and has the following connections:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SWDIO: Pin 111, GPIO_AD_B0_00, routed as JTAG_TMS, connected to pin 2 of the 10-pin jtag connector.&lt;/LI&gt;&lt;LI&gt;SWCLK: Pin 110, GPIO_AD_B0_01, routed as JTAG_TCK, connected to pin 4 of the 10-pin jtag connector.&lt;/LI&gt;&lt;LI&gt;SWO: Pin 97, GPIO_AD_B0_11, routed as ARM_TRACE_SWO, connected to pin 6 of the 10-pin jtag connector.&lt;/LI&gt;&lt;LI&gt;(FYI: The remaining jtag pins are as follows: 1 = +3V3; 3,5,9 = GND; 7,8 = n/c)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I am using the NXP LPCXpresso LPC-Link 2 (Rev B) connected via the 10-pin J7 connector to our target board.&lt;/P&gt;&lt;P&gt;Here is a list of some of the documents and web pages that I have gleaned information from:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;MCUXpresso IDE SWO Trace Guide, Rev. 11.4.1&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.nxp.com/t5/Blogs/SWO-with-NXP-i-MX-RT1064-EVK-Board/ba-p/1131057" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/Blogs/SWO-with-NXP-i-MX-RT1064-EVK-Board/ba-p/1131057&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.nxp.com/t5/MCUXpresso-General-Knowledge/How-To-Use-SWO-Trace-on-MCUXpresso-IDE/ta-p/1125902" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/MCUXpresso-General-Knowledge/How-To-Use-SWO-Trace-on-MCUXpresso-IDE/ta-...&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is what I have done so far:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Copied retarget_itm.c into my source tree.&lt;/LI&gt;&lt;LI&gt;Changed the library to 'NewLibNano (no host)' so that it links (setting was 'NewLibNano (semihost)').&lt;BR /&gt;See project properties | C/C++ Build | Settings | Tool Settings tab | MCU C++ Linker | Managed Linker Script | Library field.)&lt;/LI&gt;&lt;LI&gt;Modify the SDK manifest:&lt;UL&gt;&lt;LI&gt;Archive: C:\Users\Ronnie Shipman\mcuxpresso\02\SDKPackages\SDK_2_10_0_EVK-MIMXRT1020.zip&lt;/LI&gt;&lt;LI&gt;File: EVK-MIMXRT1020_manifest_v3_8.xml&lt;/LI&gt;&lt;LI&gt;Line: &amp;lt;params id="internal.has_swo.release.MIMXRT1021xxxxx" name="internal.has_swo" value="true"/&amp;gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;After the call to BOARD_BootClockRUN() I have added the line:&lt;UL&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; CLOCK_EnableClock(kCLOCK_Trace);&lt;/LI&gt;&lt;LI&gt;FYI: In BOARD_BootClockRUN are the lines:&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; /* Disable TRACE clock gate. */&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; CLOCK_DisableClock(kCLOCK_Trace);&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; /* Set TRACE_PODF. */&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; CLOCK_SetDiv(kCLOCK_TraceDiv, 2);&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; /* Set Trace clock source. */&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &amp;nbsp; CLOCK_SetMux(kCLOCK_TraceMux, 2);&lt;/LI&gt;&lt;LI&gt;This should give us a 132 MHz clock although I'm not sure how to measure that is actually being generated.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;I have confirmed the connectivity between RT1021 pin 97 and pin 6 of the jtag connector.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So my questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;What have I missed - is the above all I need to do to get SWO Trace to work?&lt;/LI&gt;&lt;LI&gt;Are the 3 SWD signals all that I need to get SWO Trace to work in MCUXpresso?&lt;/LI&gt;&lt;LI&gt;Or do we need 2-wire or 4-wire SWD? I believe the RT1021 only supports 1-wire.&lt;/LI&gt;&lt;LI&gt;Do we actually need SWO for the profiler and interrupt history?&lt;/LI&gt;&lt;LI&gt;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?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Many thanks and regards,&lt;/P&gt;&lt;P&gt;Ronnie&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 15:30:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RT1021-SWO-Trace-problems/m-p/1404649#M186274</guid>
      <dc:creator>rshipman</dc:creator>
      <dc:date>2022-01-25T15:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: RT1021 SWO Trace problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RT1021-SWO-Trace-problems/m-p/1405899#M186386</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/71022"&gt;@rshipman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; When you use the&amp;nbsp;&lt;SPAN&gt;LPC-Link 2&amp;nbsp; 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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;If you have external Segger JLINK, I think you also can try the directly JLINK.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Answer your questions:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;1 What have I missed - is the above all I need to do to get SWO Trace to work?&lt;/P&gt;
&lt;P&gt;Answer:&amp;nbsp; Normally, these steps to enable the SWO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1) check pinmux.c , enable the SWO pin.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;In fact, newest SDK code already add it:&lt;/P&gt;
&lt;P&gt;void BOARD_InitPins(void) {&lt;BR /&gt;CLOCK_EnableClock(kCLOCK_Iomuxc);&lt;/P&gt;
&lt;P&gt;IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, 0U); &lt;BR /&gt;IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, 0U); &lt;BR /&gt;IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_11_ARM_CM7_TRACE_SWO, 0U); &lt;BR /&gt;IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, 0x10B0U); &lt;BR /&gt;IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, 0x10B0U); &lt;BR /&gt;IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_11_ARM_CM7_TRACE_SWO, 0x10B1U); &lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;2) trace clock enable, I find the clock_confg.c also enable it.&lt;/P&gt;
&lt;P&gt;3) main&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Add the&amp;nbsp;ITM_SendChar('A');&lt;/P&gt;
&lt;P&gt;After entering the debugger, open the SWO configuration, whether you can see the swo target speed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If you can see the speed, it means it works. Otherwise it still have issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Just use the LPC-LINK2 test the helloworld, not the led_blinky.&lt;/P&gt;
&lt;P&gt;2 Are the 3 SWD signals all that I need to get SWO Trace to work in MCUXpresso?&lt;/P&gt;
&lt;P&gt;Answer: SWD_CLK, SWD_DAT, RESET, SWD_SWO, GND, VDD, these pins is enough.&lt;/P&gt;
&lt;P&gt;3 Or do we need 2-wire or 4-wire SWD? I believe the RT1021 only supports 1-wire.&lt;/P&gt;
&lt;P&gt;Answer: check point 2.&lt;/P&gt;
&lt;P&gt;4 Do we actually need SWO for the profiler and interrupt history?&lt;/P&gt;
&lt;P&gt;Answer: check point 1.&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;If yu still have issues, just kindly let me know.&lt;/P&gt;
&lt;P&gt;About the issues, you can give me some screenshot.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 09:16:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RT1021-SWO-Trace-problems/m-p/1405899#M186386</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2022-01-27T09:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: RT1021 SWO Trace problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/RT1021-SWO-Trace-problems/m-p/1411679#M186847</link>
      <description>&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Modify the SDK manifest:&lt;UL&gt;&lt;LI&gt;Edit the SDK archive. E.g.: &lt;FONT face="courier new,courier"&gt;C:\Users\Ronnie Shipman\mcuxpresso\02\SDKPackages\SDK_2_10_0_EVK-MIMXRT1020.zip&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Edit the manifest file. E.g.: &lt;FONT face="courier new,courier"&gt;EVK-MIMXRT1020_manifest_v3_8.xml&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Edit the line (search for has_swo): &lt;FONT face="courier new,courier"&gt;&amp;lt;params id="internal.has_swo.release.MIMXRT1021xxxxx" name="internal.has_swo" value="true"/&amp;gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;Modify/recreate the .launch files relating to this hardware as mentioned above.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;After the call to BOARD_BootClockRUN() I have added the line:&lt;UL&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_EnableClock(kCLOCK_Trace);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;FYI: In BOARD_BootClockRUN are the lines:&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/* Disable TRACE clock gate. */&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_DisableClock(kCLOCK_Trace);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/* Set TRACE_PODF. */&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_SetDiv(kCLOCK_TraceDiv, 2);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/* Set Trace clock source. */&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_SetMux(kCLOCK_TraceMux, 2);&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;The SWO Config in MCUXpresso will ask for the trace clock speed.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No need to worry about copying retarget_itm.c or anything else.&lt;/P&gt;&lt;P&gt;FYI: Remember that the RT1021 routes JTAG_TDO and SWO to different pins in case that has a bearing on the target hardware.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;Ronnie&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 09:14:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/RT1021-SWO-Trace-problems/m-p/1411679#M186847</guid>
      <dc:creator>rshipman</dc:creator>
      <dc:date>2022-02-10T09:14:38Z</dc:date>
    </item>
  </channel>
</rss>

