NXP RT1020 Program/Debug by SWD

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

NXP RT1020 Program/Debug by SWD

3,450 Views
luishs
Senior Contributor I

Hello.

Today I received my Jlink OB, to try to Program/Debug the RT1020 microcontroller directly, without using OpenSDA/Daplink that installs the evaluation board.


I have removed the jumpers that connect SWDIO and SDCLK to OpenSDA (J27--> SWDIO, J28--> SWCLK ), and I have connected those signals and GND to the Jlink OB. MCUXpresso recognizes the Jlink, but fails to connect to the microcontroller.


There are three more jumpers in the evaluation board (J24, J25 and J26), two are for a UART and one for the RST signal. If I remove these jumpers, and use OpenSDA-DAP Link via USB or JTAG work well, it seems that the UART is not useful to program and debug, I do not know what is the utility of this serial port, but it is not essential for debugging or program.

I also tried to connect my Jlink V9 by SWD directly to the RT1020 and it also fails. I do not understand why I can not connect directly to the RT1020 microcontroller by SWD using a Jlink, when the OpeSDA (based on Kinetis MK20) on the evaluation board is also connected via SWD to the microcontroller.


Any suggestions?


It seems that OpenSDA sends some special commands by SWD to the microcontroller, but if it connects directly with Jlink it does not do it, or so it seems. I need to be able to program and do Debug, using SWD directly, without OpenSDA as an intermediary, to make my own board.

ScreenHunter_013.jpg

foto_004.jpg

foto_003.jpg

foto_002.jpg

foto_001.jpg

ScreenHunter_014.jpg

Tags (4)
0 Kudos
5 Replies

2,673 Views
luishs
Senior Contributor I

It works for me, connecting the SWD cables to the JTAG connector, I do not know why it did not work when I plugged into the J27 and J28 jumpers, in theory both also go to the SWD signals of the JTAG connector.


In any case, I prefer to use JTAG, because someone told me, in the MUConEclipse blog, which is faster than SWD. I will use my Jlink V9, and on my custom board I will put a 2x5 or 2x6 IDC connector, of the 1.27mm step with a flat cable.


One more question:
To upload an encrypted firmware image to RT1020, can I use Jlink through JTAG, or do I need to do it via USB with MFG Tools?.

FOTO_001.jpg

0 Kudos

2,673 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Luis,

The i.MXRT1020 should be able to be debugged with SWD, but you will also need to connect other pins, like the operating voltage. You could take a look at the following link for additional details:

https://mcuoneclipse.com/2014/04/20/using-the-frdm-k64f-with-codewarrior/


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

2,673 Views
luishs
Senior Contributor I

I've done a new check right now. I have connected Jlink to JTAG J16, I have removed all jumpers J24 to J28, and it works, I can program and debug.

I have reviewed the evaluation board schematic several times, and I do not see how it connects directly from JTAG to RT1020, it seems that all the JTAG lines go to the Kinetis MK20 instead of the RT1020, so I thought that the MK20 was acting intermediary in all cases.

Now I need to know how many pins this JTAG connection needs to program / debug the RT1020. I only want the essential, if it could be by SWD with 2 or 3 pins, better.

I will have to re-check the scheme of the evaluation board, to detect where the lines of the JTAG J16 connector are connected to the RT1020, regardless of the Kinetis MK20.

0 Kudos

2,673 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Luis,

Yes, J16 was the key, it is where external JTAG should be connected.

In case of having troubles when switching between connections on MCUXpresso IDE, you could try deleting the current connections (.launch files), and creating news on autodetect mode


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

2,673 Views
luishs
Senior Contributor I


Thanks, Carlos.


I see in the scheme of the evaluation board, that JTAG connects directly to RT1020, and then I can design my own board with a JTAG 2x5 or 2x6 IDC connector and a flat cable to connect to Jlink or Multilink PE.

One more question, please.


Can I connect to RT1020 microcontroller by SWD to program and debug? I've tried with SWCLK and SWDIO, but I do not know if I also need the RESET pin because if I remove the RESET jumper of OpenSDA/DAP-Link in the evaluation board, it still works with just those two signals (SWCLK and SWDIO). But when I try to connect with a Jlink OB or Jlink V9, using the same two signals (SWCLK and SWDIO), removing J27 and J28, to connect directly to RT1020, then it does not work.

I can program and debug by JTAG, but it fails when I try to use SWD (with a Jlink OB and Jlink V9), although it seems that OpenSDA is connected by SWD with RT1020. I do not understand how OpenSDA connects by SWD with the microcontroller, and I can not do it using a Jlink V9 or Jlink OB.