Restarting debug session fails on firmware verification

I have problem with debugging board with nRF9160 with VS Code. If I start debugging for fully erased chip it works just fine but if I try to restart debugging it throws an error and I have to fully erase the chip to get things going.

There is some keys which are stored to OTP memory of the nRF9160 and if I have to fully erase flash then I have to rewrite the keys and also other settings every time I try to restart debugging. Is there some solution where I could modify to not to verify the whole memory or disable the verification.

-- west flash: using runner nrfjprog
-- runners.nrfjprog: Flashing file: c:\nrf9160\workspace\application\app\build\zephyr\merged.hex
[ #################### ] 9.209s | Erase file - Done erasing
[ #################### ] 2.201s | Program file - Done programming
[error] [ nRF91] - Data does not match in address range [0x00FF8130-0x00FF8180] (UICR)
[error] [ nRF91] - Expected byte value 0xA6 but read 0x7F at address 0x00FF8140.
[error] [ nRF91] - Flash verification failed.
[error] [ nRF91] - Failed while verifying file c:\nrf9160\workspace\application\app\build\zephyr\merged.hex.
ERROR: Write verify failed.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
FATAL ERROR: command exited with status 25: nrfjprog --program 'c:\nrf9160\workspace\application\app\build\zephyr\merged.hex' --sectorerase --verify -f NRF91 --snr 504505560

Parents Reply Children
No Data
Related