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

nrfjprog write verify failed

With any nrfjprog (9.8, 9.7, WIndows 10) I get ERROR: Write verify failed.

"C:\Program Files\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe" -f nrf52 --verify s.hex

I'm able to program my device using nRFgo Studio or J-Flash - it programs and verifies the firmware correctly.

I examined it a little and I can see that nrfjprog changes some bytes, mainly at offset 0x7C - 0x7F of the hex, where it programs FF FF FF FF instead of what is in the hex.

For NRF51 family nrfjprog works.

Tried different versions of nrfjprog and J-Link and also different devices to program.

  • Can you give more information about the device you are trying to program? Is it a developer kit or custom board?

    I examined it a little and I can see that nrfjprog changes some bytes, mainly at offset 0x7C - 0x7F of the hex, where it programs FF FF FF FF instead of what is in the hex.

     What do you mean with this offset? Is it always the same address?

    Please provide the .hex file so I can test here.

    Kind regards,
    Øyvind

  • The device is Raytac's MDBT42 on our custom board. I tried more boards.

    I tlash s132_nrf52_6.1.0_softdevice.hex (size 424 030 bytes).

    Yesterday, I mainly received verify error on 0x7C offsets of the flashed file, today I got   - 0x7FC, 0x3FC and 0x7C.

    By offset 0 I mean beginning of the hex, by offset 0xFF I mean 255th byte of the hex (provided that there is one continuous memory region at the beginning of the hex).

    These are the commands I run:

    "C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe" -f nrf52 --eraseall
    "C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe" -f nrf52 --program s132_nrf52_6.1.0_softdevice.hex
    "C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe" -f nrf52 --verify s132_nrf52_6.1.0_softdevice.hex

  • Hello,

    gaminn said:
    I tlash s132_nrf52_6.1.0_softdevice.hex (size 424 030 bytes).

     Are you able to flash this hex?

    gaminn said:
    Yesterday, I mainly received verify error on 0x7C offsets of the flashed file, today I got   - 0x7FC, 0x3FC and 0x7C.

    How do you get this information? 

    gaminn said:
    These are the commands I run:

    What do you get when you run these commands?


    Can you please run the following command:

    nrfjprog --memrd 0x0 --n 0x26000 > dump.txt

    And send me this file.

    Thanks!
    -Øyvind

  • I use J-Flash utility along with nrfjprog. J-Flash is able to program and verify the firmware.

    These are the commands I run:

    "C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe" -f nrf52 --eraseall
    Erasing user available code and UICR flash areas.
    Applying system reset.

    "C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe" -f nrf52 --program s132_nrf52_6.1.0_softdevice.hex
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    Checking that the area to write is not protected.
    Programing device.

    "C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe" -f nrf52 --verify s132_nrf52_6.1.0_softdevice.hex
    Parsing hex file.
    Verifying programming.
    ERROR: Write verify failed.

    This is the dump: dump.txt

    It failed to verify at 0x3C - 0x3F address.

  • gaminn said:
    It failed to verify at 0x3C - 0x3F address.

    How do you now it failed to verify at this address? I can't see any difference between yours and mine in that address range. 
    I am however seeing several differences at several addresses, which may be the reason it is failing to verify.

    Are you using long cables when programming? 
    The following command will program and verify with a very low clock frequency (125kHz):

    nrfjprog -c 125 --program softdevice.hex --chiperase --verify


    This will take a longer time to complete.

    -Øyvind

Related