Unable to recover nrf5340 after flashing nrf9160 code on it.

Hi,

We have a project that utilizes both an nrf9160 and an nrf5340. 

Unfortunately, we often find ourselves having programmed the nrf9160 code ( say asset_tracker_v2) onto the nrf5340. (FWIW, we use a segger Jlink, and while it prevents us from programming a 5340 project onto a 9160, there seems to be no such protection in the opposite direction. 

When this happens, we seemingly get into a state where it is almost impossible to recover the 5340. (We occasionally succeed with a 'west flash --recover' )

We do not have the swd reset line brought out to our programming header, but even asserting the reset line does not yield consistent recovery success.

Any suggests greatly apprecited!

  • Hello,

    You can try the attached .bat script (windows. If you are on Linux, you probably know how to modify it to run there).

    :loop
    nrfjprog --recover -f NRF53
    ::nrfjprog -e
    goto loop

    Make sure no other DKs are running on your computer. If they are, add --snr <Segger JLink programmer serial number> to the end of line 2.

    What it does is to continuously try to recover the device. While this is running, power cycle the nRF53 on and off repeatedly, and hopefully, the debugger will be able to hook onto the nRF53 and recover it at some point.

    Best regards,

    Edvin 

Related