How using SWO on RT1170 and MIMXRT1170-EVK board ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How using SWO on RT1170 and MIMXRT1170-EVK board ?

4,084 Views
dkoch
Contributor II

Hi, while there are similar questions on RT1050 or RT1060, I cannot get SWO to work on RT1170 :

https://www.nxp.com/docs/en/application-note/AN12437.pdf

Without having to "rework the board by flying wire TRACE_SWO" and expect "it multiplex JTAG_TDO with TRACE_SWO to the pin connected to J-Link connector so that SWO trace can work without any changes", I need the following information :

1- pins able to be muxed/configured into TRACE_SWO while keeping SWD functionnality

2- pins and clocks configuration

3- typical working ITM register configuration

4- IDE setup (MCUXpresso, IAR, Keil, MCU for Eclipse, ...)

Basically, something like that, but that works on RT1170 and the EVK board :

https://dzone.com/articles/using-single-wire-output-swo-with-arm-cortex-m-and

https://mcuoneclipse.com/2019/06/03/swo-with-nxp-i-mx-rt1064-evk-board/

Additional information would be to select SWO on either the M7 core or the M4 core.

Regards.

0 Kudos
18 Replies

3,942 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

  Today, I downloaded a new JLINK driver, and test it again, I find SWO have the log in IAR:

kerryzhou_0-1660292274669.png

But, the terminal no data for the ITM_Sendchar, I will check with IAR side, whether there has any point need to note.

 

Best Regards,

Kerry

 

0 Kudos

3,973 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

   You can test the MCUXPresso, let it work with the JLINK at first.

  To the IAR+ JLINK, seems my MCU-LINK pro have issues, it always blocking during the downloading.

  So, I need to borrow one Segger JLINK plus to test it.

  If you already update the IAR version, you also can refer to this AN:

https://www.nxp.com.cn/docs/en/application-note/AN13234.pdf

chapter 4 to test it.

 I think, if tool no issues, it should work with the IAR, if still have issues, we also need to contact with IAR side.

Best Regards,

Kerry

0 Kudos

4,041 Views
dkoch
Contributor II

Hi, thank you very much.

I tried the project but cannot get it to run as supposed. I can import it in MCUXpresso, compile and run on the RT1170-EVK but nothing appears on the SWO outpout. Using a JLink 9 probe.

My current project runs the 1176 of the EVK at 696 MHz and compiles with IAR 8.50.9, any luck ?

0 Kudos

4,034 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

  About the IAR+RT1170+SWO, you can contact with IAR side directly, as I know, the IAR already make the IJET works, but to the JLINK, please contact with IAR side directly:

 

2.jpg

 

Best Regards,

Kerry

0 Kudos

4,007 Views
dkoch
Contributor II

Hi @kerryzhou 

I'm not in contact with IAR regarding this issue as to me it's not really their "problem". I mean, they provide a compiler and an IDE capable to display SWO output, the problem comes from getting the MCU to actually configure that SWO correctly and emitting the required data stream.

In the past, I successfully configured the SWO of a Cortex-M3 (STM32F205) using either a J-Link 8, a U-Link or a U-Link PRO (equivalent to J-Trace) with scripting the probes :

https://github.com/Kochise/batch-makeit/tree/master/makefiles

Hence I think it's a matter of time until the right combination of settings is found and being able to get the SWO output to work on the 1170 as well.

It's just strange that it isn't "unlocked" from the beginning with a solid working sample application as the purpose of SWO is to help debugging without having to rely on slow UART (semihosting). This should have been provided in the SDK from day one and made sure everyone could use it preferably to any other alternative (since even the LPC-Link2 firmware is supposed to enable SWO, but couldn't get it to work on the EVK despite shorting J22 as documented).

Regards.

 

Tags (2)
0 Kudos

4,004 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

   RT1170 is a little special, it is related to the ERR050708.

  So, to the IAR, I have checked with the IAR side previously:

kerryzhou_0-1660120167732.png

So, you need to check your IAR version is matched, if meets any issues in IAR, you also can contact with IAR side, as they already test it. 

But, to the MCUXPresso IDE, I make it works previoulsy:

 I use the configuration on the RT1170 MCUXPresso IDE with MCULINK pro cmsis dap debugger, it works OK.

This is the test result:

kerryzhou_1-1660120643767.png

 

 

Here, you just need to use the IAR+RT1170+JLINK+SWO, right? Not the MCUXpresso, right?

Please confirm it, as I don't have the directly Segger JLINK on my side, I will use the MCU-LINK pro with JLINK firmware to test the SWO in the IAR.

Please also update your IAR version to:

IAR Embedded Workbench for Arm, version is 9.30.1

 

Best Regards,

Kerry

 

 

0 Kudos

4,002 Views
dkoch
Contributor II

Hi @kerryzhou 

Thank you again for your support.

SWO is pretty much "standart" in Cortex cores, this shouldn't require specific firmware to get it working. Once configured the pins, the clocks and having the right probe, that should allows anybody to access the data stream, right ?

My config is indeed IAR+RT1170+JLINK+SWO

JLINK because we have the EVK as a fallback, but also a custom board with only a SWD port.

As for IAR 9.30.1 I bet it is a no-go since our floating license is set to 8.50.9. I have to check if the upgrade path is open or not as to our corporate contract.

Regards.

0 Kudos

4,000 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

  OK, I will help you test the :

IAR+RT1170+JLINK+SWO

 Your side, please also upgrade the IAR version, as I can make sure your version can't let the RT1170 SWO works, it is confirmed by the IAR side.

  Any updated information from my side, I will let you know, please keep patient, thanks.

 

Best Regards,

Kerry

0 Kudos

3,996 Views
dkoch
Contributor II

Hi @kerryzhou 

Thank you for your help.

So IAR 8.50.9 seems to be an issue and updating to 9.30.1 might help to get it working in the IDE. I have to check about out current licensing scheme to see if it is feasible.

I'll try the command line route as well.

First I have to try to get your example working in MCUXpresso just to be sure.

To clarify, your setting is RT1170+DAPLink+MCUXpresso 11.5, no JLINK, just bare EVK and USB.

Regards.

0 Kudos

3,990 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

  No, you misunderstand, I will use the MCU-LINK pro, which can firmware to JLINK:

https://www.nxp.com/design/microcontrollers-developer-resources/mcu-link-pro-debug-probe:MCU-LINK-PR...

  Tomorrow, I will find time to test it.

Best Regards,

Kerry

0 Kudos

3,988 Views
dkoch
Contributor II

Hi @kerryzhou 

No, just to be sure about your MCUXpression setting to try again the example project your provided.

I have to get it work first just to make sure everything work like intended.

Your snapshot is a clue, and other people succeeded so I should be able too.

Regards.

3,979 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

  Share you my MIMXRT1170-EVK rev C1+ MCULINK pro(jlink firmware) test result.

  Please note, when use the external JLINK, you need to remove J5,J6,J7,J8.

  My connection like this:

kerryzhou_0-1660196789812.png

 

Please use my attached project again, this is tested just today with MCUXpresso+JLINK

This is the related debug steps:

1, enter the JLINK debugger

kerryzhou_1-1660196858425.png

Here, you can see, the SWO clock still not recoginized, as the code still note configure it.

Set the breakpoint like this:

kerryzhou_2-1660196894695.png

Then, wait a moment:

 

kerryzhou_3-1660196911783.png

You can find SWO clock is recognized, then you can test it:

kerryzhou_4-1660196946338.png

Start:

kerryzhou_5-1660196964331.png

You can find the SWO ITM console have the data.

Please try it on your side, at least make this one works.

I will test the IAR version later, and share you the test result.

Best Regards,

Kerry

 

 

 

 

 

3,970 Views
dkoch
Contributor II

Hi @kerryzhou 

Thank you, I'll try all of this tomorrow and let you know if I got it to work.

Regards.

3,858 Views
dkoch
Contributor II

Hi @kerryzhou 

Sorry for the delay, got carried out on another more prioritary task.

Here I tested on MCUXpresso as you suggested, yet the output doesn't go on "SWO ITM Console" but regular "Console" and is not what is expected (garbage data).

Regards.

0 Kudos

3,852 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

   As I know, it is related to your debugger.

   I am using the MCU LINK pro with the JLINK firmware, it works perfectly.

   I share my test video.

You can see, it all outputs to the SWO ITM Console.

So, mcuxpresso IDE works OK on my side.

To the IAR+SWO, I can confirm it really has issues, and IAR side also didn't give me any valuable reply, they also check with their internal side. If you really need the IAR as IDE, I highly recommend you also contact with IAR side, it is really related to the IDE, thanks.

 

Best Regards,

kerry

0 Kudos

4,036 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

  Do you check this doc:

https://community.nxp.com/t5/Blogs/Overview-of-using-the-MIMXRT1170-EVK-with-MCUXpresso-IDE/ba-p/124...

  With the SWO?

  Please also check your JLink 9 can support the SWO function.

   BTW, which MIMXRT1170-EVK version you are using now?

Best Regards,

kerry

0 Kudos

4,010 Views
dkoch
Contributor II

Hi @kerryzhou 

Yes I did have checked that documentation that provides many useful tips, I followed the advices and also changed the TRACE_SWO as mentioned, as well as you did in pin_mux.c in the example you provided, yet none worked.

Btw the EVK version is 700-32171 REV X3 / SCH-32171 REV C1 / TR20350468

Regards.

0 Kudos

4,075 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dkoch ,

   Please refer to these post, which may useful to you about the SWO on RT1170:

https://community.nxp.com/t5/MCUXpresso-IDE/SWO-setup-by-RT1170-EVK-MCUXpresso-v11-5-0/m-p/1420828#M...

https://community.nxp.com/t5/MCUXpresso-IDE/how-to-enable-SWO-with-MCUXpresso-IDE-V11-5-0-for-RT1170...

 

Attached is a project for your reference.

 

Best Regards,

Kerry

 

 

0 Kudos