This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrfjprog verify fails with chiperase

Hi,

We've been using nrfjprog with no particular issue for a while now. Usually to fully flash a chip (whether it's for a complete re-flash or for a new chip) we run those 2 steps:

nrfjprog -f nrf52 --eraseall
nrfjprog -f nrf52 --program firmware.hex --sectorerase --reset

I was looking for ways to run with just one command and started to use --chiperase.

However on every other run the command fails with a "Write verify failed". It works on the first time but running it again will trigger the error (and the firmware is not run even after a reset). After getting the error, running the command again works fine (and I can see the chip booting our firmware normally).

And this can be repeated, once it has worked, the next flash will fail, and the one after will succeed, etc.

I don't have this issue using --sectorerase but this doesn't erase the pages we use for fstorage.

Here is nrfjprog output when it fails:

nrfjprog -f nrf52 --program firmware.hex --chiperase --verify --reset --log      
Parsing image file.
Verifying programming.
ERROR: [  nRF52] - Data does not match in address range [0x00001000-0x00018fec] (Flash)
ERROR: [  nRF52] - Expected byte value 0x00 but read 0xff at address 0x000122b8.
ERROR: [  nRF52] - Flash verification failed.
ERROR: [  nRF52] - Failed while verifying file firmware.hex.
ERROR: Write verify failed.

I'm using the latest tools, running on Windows 10.

nrfjprog --version
nrfjprog version: 10.15.2 external
JLinkARM.dll version: 7.58b

Is there anything I should do to avoid getting those verify failures? Thanks!

Parents Reply
  • I've also tried with the --verify flag, it works as long as I'm not using --chiperase

    nrfjprog -f nrf52 --eraseall
    nrfjprog -f nrf52 --program _build/full_firmware_factory.hex --sectorerase --verify --reset

    and

    nrfjprog -f nrf52 --eraseall
    nrfjprog -f nrf52 --program _build/full_firmware_factory.hex --verify --reset

    both work fine

Children
  • Hi,

    What happens if you don't use --sectorerase  in "nrfjprog -f nrf52 --program _build/full_firmware_factory.hex --sectorerase --verify --reset". Does it work then?

    Best regards,
    Dejan

  • Yes but only if  "nrfjprog -f nrf52 --eraseall" is run first

  • Hi,

    What exactly is the output of  "nrfjprog -f nrf52 --program _build/full_firmware_factory.hex  --verify --reset" if you don't run "nrfjprog -f nrf52 --eraseall" beforehand?

    Best regards,
    Dejan

  • Here it is.
    The 0x2e000 address is the beginning of the flash area we use for fstorage. Our firmware modifies it on each boot. I suppose it fails because this area is not cleared beforehand.

     nrfjprog -f nrf52 --program _build/full_firmware_factory.hex --reset --log
    --verify
    Parsing image file.
    Verifying programming.
    ERROR: [  nRF52] - Data does not match in address range [0x0002e000-0x0002e05c] (Flash)
    ERROR: [  nRF52] - Expected byte value 0x39 but read 0x10 at address 0x0002e000.
    ERROR: [  nRF52] - Flash verification failed.
    ERROR: [  nRF52] - Failed while verifying file _build/full_firmware_factory.hex.
    ERROR: Write verify failed.

  • Hi,

    If possible, could you please provide your flash (hex) file?

    Best regards,
    Dejan

Related