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

Dongle can not be restored back using nrfjprog

Hi,

The following is the guide under this ticket: devzone.nordicsemi.com/.../where-i-can-find-the-example-of-usbd-dfu-for-pc-side

Terje said "you can use nrfjprog with "nrfjprog --readcode backup.hex" for storing the flash contents in a hexfile named "backup.hex". Then you can program it back onto the Dongle at any later time if needed (with "nrfjprog --program backup.hex".)"

However, I met several issue when I use J-LINK to program it. The steps are as follows.

1) use nrfjprog with "nrfjprog --readcode nrfjprog_readback.hex". See the attachment.

2) I used JFlash --> readback -->Entire Chip, to save it as "jflash_readback.hex". See the attachment.

3) issue nrfjprog --eraseall, and the result is ok.

$ nrfjprog --eraseall

Erasing user available code and UICR flash areas.

Applying system reset.

4) use "nrfjprog --program nrfjprog_readback.hex". And the result is, dongle doesn't work. Just like a bricked dongle.

nrfjprog --program nrfjprog_readback.hex

Parsing hex file.

Reading flash area to program to guarantee it is erased.

Checking that the area to write is not protected.

Programming device.

5) use JFlash to open jflash_readback.hex and click Program&verify. And it works!!!!! 

That's very strange. May I ask what's the difference? Why can't I use nrfjprog to program?

Jlink version is 6.22g

nrfjprog is 9.7.3

nrfjprog_readback.hexjflash_readback.hex

BY THE WAY, I found that, if I turn on log when issuing nrfjprog, it shows "device nrf52832_XXAA". Is this related to this problem? Thanks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--------------------------------------------------------------------------------
nrfjprog --eraseall --family NRF52 --log
nrfjprog version 9.7.3
--------------------------------------------------------------------------------
nRF_open_dll
. nRF52_open_dll
. . nRF52_dll_version
nRF_enum_emu_snr
. nRF52_enum_emu_snr
. . nRF52_enum_emu_snr
nRF_enum_emu_snr
. nRF52_enum_emu_snr
. . nRF52_enum_emu_snr
nRF_connect_to_emu_with_snr
. nRF52_connect_to_emu_with_snr
. . nRF52_is_connected_to_emu
. . nRF52_enum_emu_snr
. . nRF52_connect_to_emu_with_snr
. . . nRF52_connect_to_emu_without_snr
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX