This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

"nrfjprog -e" renders our board unconfigurable

We have a custom PCB fitted with the nRF52840 SOC, we've previously erased and written to it via the nRF programmer tool. However, when trying to use the nrfjprog -e command it erases the board successfully but any subsequent attempts to reach the board (nrfjprog -e, nrfjprog --recover, or any command) produce the following error: 

ERROR: nrfjprog could not identify the target device. This may be due to an
ERROR: invalid family argument, a problem with your device, or nrfjprog may
ERROR: not yet support your device.
ERROR: Please check the family argument passed, or upgrade nrfjprog to a more
ERROR: recent version.

Trying to configure with the programmer tool produces: 

Could not fetch memory size of target devkit: Error: Error occured when get library info. Errorcode: CouldNotOpenDevice (0x4) Lowlevel error: Unknown value (fffffffa)

Same goes for compilation attempts via Segger or VScode. 

  • We're using the Segger Jlink to communicate with the board via SWCLK and SWDIO, it is also feeding VCC but the board's power is dependent on a LiPo 3.7V battery via ADC. 
  • We've been rewriting, erasing, compiling etc. on this board for a long time and have never encountered this issue until the moment we used nrfjprog -e
  • An attempt to use the command on another custom board produced the same results. 
  • An attempt to use the command on the nRF52840 DK and an Adafruit board caused no errors and everything seems to be working fine. 
  • Reset pin on the custom PCB is unavailable so that's not an option. 

So obviously the problem is with our custom board, any suggestions, apart from not using the command again?

Parents Reply Children
  • aha, seems like you're also using the APPROTECT feature. The APPROTECT feature secures the IC from any external read, erase, or write operation after it has been activated. It does this by disabling the debugging interface. The only way the device can be recovered after the APPROTECT has been activated is by issuing a nrfjprog --recover command. Note that this will erase everything on the chip and set it back to default mode.

    regards

    Jared 

  • Thanks for the suggestion but as stated in the original post, all the nrfjprog commands (including --recover) lead to the same error message.

    ERROR: nrfjprog could not identify the target device. This may be due to an
    ERROR: invalid family argument, a problem with your device, or nrfjprog may
    ERROR: not yet support your device.
    ERROR: Please check the family argument passed, or upgrade nrfjprog to a more
    ERROR: recent version.

  • Which nrfjprog version are you using? Can you update it to the newest version. 

    Could you try the workaround I mentioned in a previous reply, and just to be sure, could you pass the --family nrf52 argument with the log option like this and upload the log after you've applied the workaround:

    nrfjprog --family nrf52 --eraseall --log

Related