Can no longer flash device - Failed to read device memories

Hi all,

Ive been able to develop for a few weeks with our nrf52840 device and were able to run our code and do some basic Bluetooth stuff. Suddenly I can no longer flash the device. Last steps I did was doing an eraseall, flashing firmware and softdevice (all using nrfjprog commands) and then did a power cycle. Flashed firmware doesn't seem to run and all I get from the segger when trying to erase anything is " Failed to read device memories ".

I've tried to recover it (using tutorial Recover the nRF52 · GitHub) but this gives the "ERROR: Recover failed. Please make sure that the correct device family is given"  Or when doing a reset prior the error " Failed to read device memories. "

nrfConnect programmer V3.0.4 also states " Unsupported device. The detected device could not be recognized as neither JLink device nor Nordic USB device. " when I try to connect to it.

The device seems to be in a locked state. Anyone has any suggestions what I might try?

I am using a nrf52840 with S140, nrfjprog version: 10.17.3 external  ;  JLinkARM.dll version: 7.66a  and the supply on the chip is ok.

Kind regards,

Taxara

Parents
  • Hello,

    Are you using an nRF52840 DK or a custom board?

    Do you happen to remember what you added to your application right before the board stopped responding?

    Can you try the following:

    Save this to a .bat script, and call it e.g. recover_script.bat:

    :loop
    nrfjprog --recover -f NRF52
    goto loop

    And call it from the command line. What this will do is to continuously try to recover the attached device. Make sure no other JLink devices are connected to the computer, so you don't get the popup prompt asking what kit you want to recover. 

    While this is running, you will probably see the error message that you are currently seeing. Then power cycle your DK many (!) times. With a bit of luck, it will be able to hook onto the DK and recover it before it locks down.

    The reason this occurs is usually that the chip goes into some lock down state at the start of the application, before the debugger is able to connect to it. This script may work in some of those cases.

    Best regards,

    Edvin

  • Hi,

    Thanks for your response, any information/suggestions are welcome!

    I'm using a custom board. And I was currently busy with removing the DIS and BAS service to add my own. I noticed removing those services in sdk_config and in firmware didn't remove them when I connected to it. After a few tries I decided that it might still be somewhere in the memory (of either the device or my ble app on the phone) so I did an erase all on the device.

    I've tried the recovering loop for like half an hour without success before I made this ticket. I will try again and see if I can physically pull the reset low. Since if I add softreset to the nrfproj loop I get a different response (Recovery failed vs memory read failed).

    Kind regards,

    Taxara

  • The reason you still saw the DIS and BAS is probably because the phone caches these services in BLE. Forgetting the device usually helps. If not, search for "service discovery phone" on this forum.

    Taxara said:
    so I did an erase all on the device.

    Was this the last thing you did before it stopped working? If so, then it is strange, because it should work very well with an empty flash. 

    Is this a custom board or a DK? If it is a custom board, what debugger are you using? And what voltage supply are you using? Does the programmer support the voltage that you are using?

    BR,
    Edvin

  • Hi,

    Yes erase all is last that I did without any error notification.

    Its a custom nRF52840 QFAA and I use the segger j-link to debug it. The voltage used is 3v3. Setup for flashing and debugging hasn't changed and worked stable.

    We however had some routing issues that shorted DEC3 (3v3decoupling) to DEC4_6(1.3v decoupling). After that was fixed I was able to flash/program this device and developed the application on it for several weeks. Today i've tested other boards they show the same issue.

    I disposed the possibility that the short could have partly damaged/corrupted anything inside because the one device I used worked. Is that something you can agree on? We are thinking to change one chip to rule out modification issues.

    Kind regards,
    Taxara

  • Hello Taxara,

    If you suspect that this is a HW issue, I suggest that you create a new ticket describing the issue (it used to work, you erased it, and now you are no longer able to connect to the nRF52 chip using a debugger, even though you tried to recover it). Attach the schematics and gerber(PCB) files, and this will be assigned to a HW engineer. If you have no luck there, we can continue in this ticket. But HW and PCB layout is not my area of expertise. 

    Please note that we are a bit short staffed, as we are closing in to holiday seasons. You may experience delayed replies. We will be back to normal staffing in the beginning of January. 

    Best regards,

    Edvin

  • Hi guys,

    Did you find any solution to this issue? We have been encountering exactly the same problem on a few of our boards. We used the erase all function on Jflashlite and since then our NRF52840 are memory protected. Thanks for your help!

  • Try using "nrfjprog --recover"

    If that doesn't work, create a new ticket describing in more details what you see. 

    Best Regards,
    Edvin

Reply Children
No Data
Related