Getting Write verify failed every time when try to debug or write without erase.

Hi,

We are working with nRF5340 with SDK v2.5.2.

Each time we try to program the board, we get below error.

[ #################### ]  12.131s | Erase file - Done erasing                                                          
[ #################### ]   1.269s | Program file - Done programming                                                    
[ #################### ]   1.299s | Verify file - Done verifying                                                       
[ #################### ]  14.504s | Erase file - Done erasing                                                          
[ #################### ]   2.654s | Program file - Done programming                                                    
[error] [ Client] - Encountered error -160: Command verify_file executed for 2719 milliseconds with result -160        
[error] [  nRF53] - Failed while performing 'Verify' operation on target address 0x00FF8128.                           
-160: Data does not match in address range [0x00FF8128 - 0x00FF8177] (APP UICR)
Expected byte value 0xFF but read 0xFC at address 0x00FF8150.
[error] [  nRF53] - Failed while verifying device. -160: Data does not match in address range [0x00FF8128 - 0x00FF8177] (APP UICR)
Expected byte value 0xFF but read 0xFC at address 0x00FF8150.
[error] [ Worker] - Data does not match in address range [0x00FF8128 - 0x00FF8177] (APP UICR)
Expected byte value 0xFF but read 0xFC at address 0x00FF8150.
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 'd:\project\..\build\zephyr\GENERATED_CP_APPLICATION_merged_domains.hex' --sectorerase --verify -f NRF53 --coprocessor CP_APPLICATION --snr 960130361

We do not see this error if we try Erase and Flash option from VS Code. We observe the same issue even with the nRF5340DK board.

This is very annoying us as we cannot debug or program without erasing. Please help us solving the issue.

We are using VS Code with NRF Connect extensions. SDK v2.5.2.

  • Any update on this?

    Please let me know if any additional information is needed.

    Thank you in advance

  • Hello,

    Are you using a watchdog timer in your code by change?

    Best regards,

    Michal

  • Are you using a watchdog timer in your code by change?

    --> NO

  • What is your setup? Are you using a standalone debugger or a DK (if so, which version)?

    What is you nrfjprog version? Have you tried updating it to the newest one?

    Do you have APPROTECT turned on?

    Does the connection break even in other cases (such is while debugging)?

    What if you try a different cable?

    Can you run the west flash command with the --log argument as it is said in the output?

    Best regards,

    Michal

  • Hi Michal,

    Please see below for my comments,

    What is your setup? Are you using a standalone debugger or a DK (if so, which version)?

    --> We have VS Code with NRF Connect SDK v2.5.2

    We are using nRF5340DK as J-Link

    J-Link info as follows:

    PCA10095
    2.0.0
    2021.42

    What is you nrfjprog version? Have you tried updating it to the newest one?

    --> See below,

    ❯ nrfjprog --version
    nrfjprog version: 10.23.2 external
    JLinkARM.dll version: 7.88j

    Do you have APPROTECT turned on?

    --> How to confirm is APPROTECT enabled or not. Explicitly we did not change any setup.

    We are using default settings provided from the NRF Connect extension with VS Code as far as we know.

    Does the connection break even in other cases (such is while debugging)?

    --> In order to debug the code, we need to erase the flash using NRF Connect for Desktop and then we need to start the debugger from VS Code.

    Once we are in the debug mode, the connection does not break. It works even we restart the debugger.

    Whereas, if we stop/terminate the debugger and try to start debug again, we get the same error.

    What if you try a different cable?

    --> Same with other cables. I do not think it is cable fault.

    Can you run the west flash command with the --log argument as it is said in the output?

    --> I see below USAGE when I try to run the above command

    usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
    west: error: argument <command>: invalid choice: 'flash' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')

    Please let me know if any.

Related