MIMXRT1060-EVKB is loosing external debugger connection after flashing a faulty image

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

MIMXRT1060-EVKB is loosing external debugger connection after flashing a faulty image

Jump to solution
848 Views
sergeylyubka
Contributor II

We are using MIMXRT1060-EVKB with an external debugger.

This is done to automate lab testing : CI builds flash new firmware and test is through the external debugger.

However, sometimes the firmware that is built, is broken. This breaks the SWD connection.
We need to manually update the DIP switch settings on the EVK to enter the bootloader, then we flash the "golden" image, then change DIP switch again, then reboot the EVK.

All in all, this is unacceptable, as our tests should be fully automated.
Honestly, I find it very surprising, and very wrong, that the firmware on flash can kill the SWD access.

QUESTION: can the external SWD connection be recovered without DIP switch dancing, after flashing a faulty firmware?

0 Kudos
Reply
1 Solution
682 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sergeylyubka ,

  So sorry for my later reply because of China Spring Festival.

  Another way, do you have the JLINK or not?

  You can use the JLINK commander to erase the FCB+IVT area.

  Just like this:

kerryzhou_0-1708312554245.png

kerryzhou_1-1708312574943.png

After the erase finished, you can use the CMSIS DAP debug it in the IDE again.

kerryzhou_2-1708312761274.png

 

I have tried it, didn't switch the boot mode, still in the internal boot mode.

If you are using the MIMXRT1060-EVK, you need to isolate the on board CMSIS DAP when you use the external JLINK, you can disconnect the J41-J50.

Then connect your external JLINK to the J21 JTAG interface.

Please try it on your side.

If you still have issues about it, please kindly let me know.

Best Regards,

Kerry

 

 

View solution in original post

7 Replies
704 Views
sergeylyubka
Contributor II

Thank you @kerryzhou . The recovery document you provided tells nothing new, as I already mentioned in my original post that we know that we need to recover using boot mode switch. 

My question was about - how to deal with the SWD loss without that. You say that is a "feature" of RT, I would rather call it something else - an appalling design failure.

However you mention "until now". Could you elaborate on that please? Is there a potential to restore an SWD connection using SWD, without dealing with boot mode and flashing the "right" firmware? Any pointers to investigate further?

Thanks for your attention.

 

0 Kudos
Reply
683 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sergeylyubka ,

  So sorry for my later reply because of China Spring Festival.

  Another way, do you have the JLINK or not?

  You can use the JLINK commander to erase the FCB+IVT area.

  Just like this:

kerryzhou_0-1708312554245.png

kerryzhou_1-1708312574943.png

After the erase finished, you can use the CMSIS DAP debug it in the IDE again.

kerryzhou_2-1708312761274.png

 

I have tried it, didn't switch the boot mode, still in the internal boot mode.

If you are using the MIMXRT1060-EVK, you need to isolate the on board CMSIS DAP when you use the external JLINK, you can disconnect the J41-J50.

Then connect your external JLINK to the J21 JTAG interface.

Please try it on your side.

If you still have issues about it, please kindly let me know.

Best Regards,

Kerry

 

 

560 Views
sergeylyubka
Contributor II

@kerryzhou Thank you. I appreciate the effort, time and attention you put into that.

0 Kudos
Reply
517 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sergeylyubka ,

  You are always welcome!

  Any new issues in the future, welcome to create the new question post or the case, we would like to discuss with you together!

Best Regards,

Kerry

0 Kudos
Reply
664 Views
sergeylyubka
Contributor II

Hi @kerryzhou ,

 

Thank you!

Appreciate your attention.

 

Yes we do have a J-Link, but the external debugger we use for the automated tests is not a J-Link - however that is not critical.

You provide an example that erases the initial area of flash using a J-Link command. It works by talking to the Flash controller over SWD, so it assumes a working SWD channel.

Can you confirm that you're executing that J-Link command against a device that is broken? Based on the screenshot, you're using a device that is perfectly healthy, and just erasing flash on it. Our experience, as stated in the original message, that SWD does NOT WORK on a broken device, so your example does not really apply.

Please clarify!

0 Kudos
Reply
656 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sergeylyubka ,

  Don't worry, in fact, when I meet the issues, I also meet the SWD connect issues.

kerryzhou_0-1708499398979.pngkerryzhou_1-1708499403812.png

You can see, the IDE mass erase also can't work when I still in the internal boot mode:

kerryzhou_2-1708499469636.png

Then use the JLINK, it can do the erase:

kerryzhou_3-1708499644208.png

Maybe you also can find one JLINK to do it.

Another way, in your MIMXRT1060-EVKB, you can firmware the on board debugger to JLINK.

You can use the LPCScrypt to update it:

https://www.nxp.com/lpcscrypt

Please note, you also need to update the JLINK firware:

https://www.segger.com/products/debug-probes/j-link/models/other-j-links/lpc-link-2/

Please try it on your side.

My test result is from the external Segger JLINK Plus, and disconnect the on board CMSIS DAP.

You can try to firmware the on board debugger directly from CMSIS DAP to the JLINK.

JLINK commander can be found from the Segger JLINK driver after you install it:

https://www.segger.com/downloads/jlink/

 

If you still have question, just kindly let me know.

Best Regards,

Kerry

 

 

 

 

0 Kudos
Reply
828 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @sergeylyubka ,

  When you download the invalid code, normally you need to enter the serial download mode, and do the external memory mass erase.

The detail information, you can refer to my document:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT-board-recovery-for-debugger-connect-issues/ta...

Until now, it is the RT feature, still need to change the boot mode to the serial download mode.

Wish it helps you!

Best Regards,

Kerry

0 Kudos
Reply