nrfjprog --verify fails when programming just after a recover (nrf5340)

Hello,

To create an automated flash tool, we want to split flashing steps between erase and program steps. 

When performing a recover before flash, program verify fails.

nrfjprog --recover -f NRF53 --coprocessor CP_NETWORK
nrfjprog --program build/zephyr/GENERATED_CP_NETWORK_merged_domains.hex --verify -f NRF53 --coprocessor CP_NETWORK

When using single-line, it work fine. 

nrfjprog --program build/zephyr/GENERATED_CP_NETWORK_merged_domains.hex --recover --verify -f NRF53 --coprocessor CP_NETWORK

I use latest version of nrfjprog (10.23.2). Below is a two steps description of the problem

1) recover both CP_APPLICATION and CP_NETWORK

nrfjprog --recover -f NRF53 --coprocessor CP_APPLICATION
Recovering device. This operation might take 30s.
Erasing user code and UICR flash areas.
Writing image to disable ap protect.
nrfjprog --recover -f NRF53 --coprocessor CP_NETWORK
Recovering device. This operation might take 30s.
Erasing user code and UICR flash areas.
Writing image to disable ap protect.

2) program with --verify the CP_NETWORK (without --recover)

Programmation failed on verify:

[error] [ nRF53] - Failed while performing 'Verify' operation on target address 0x01000000.

nrfjprog --program build/zephyr/GENERATED_CP_NETWORK_merged_domains.hex --verify -f NRF53 --coprocessor CP_NETWORK
[ #################### ] 1.244s | Program file - Done programming
[error] [ Client] - Encountered error -160: Command verify_file executed for 274 milliseconds with result -160
[error] [ nRF53] - Failed while performing 'Verify' operation on target address 0x01000000.
-160: Data does not match in address range [0x01000000 - 0x01005B79] (Network Flash)
Expected byte value 0xA0 but read 0x00 at address 0x01000000.
[error] [ nRF53] - Failed while verifying device. -160: Data does not match in address range [0x01000000 - 0x01005B79] (Network Flash)
Expected byte value 0xA0 but read 0x00 at address 0x01000000.
[error] [ Worker] - Data does not match in address range [0x01000000 - 0x01005B79] (Network Flash)
Expected byte value 0xA0 but read 0x00 at address 0x01000000.
ERROR: Write verify failed.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.

Thanks for your feedback

Parents
  • Hi,

    You could try to add --sectorerase.

    nrfjprog -f NRF53 --program merged_domains.hex --coprocessor CP_NETWORK --verify --sectorerase


    Best regards,
    Dejan

  • Hi, 

    It work with --sectorerase, however it take a significant additionnal time.

    This is described in nrfjprog --help:

    --sectoranduicrerase and --sectorerase
    operations normally take significantly longer time
    compared to --chiperase operation so use them with
    caution.

    On our project erase/flash/verify for the two coprocessors take 32s instead of ~ 15s using --recover on single-line.

    For the time being we can use the single line command, but it does not fit well with our 'standard flash process'. 


    Note also that if we retry the procedure 1) and 2)  and try to program again with same command line it give another error type.This one is also disturbing because we do not protect the CP_NETWORK and recover of 1) must have removed any protection

    3) program with --verify the CP_NETWORK (without --recover)

    Programmation failed :

    [error] [ Worker] - Can't read memory descriptors, ap-protection is enabled.

    nrfjprog --program build/zephyr/GENERATED_CP_NETWORK_merged_domains.hex --verify -f NRF53 --coprocessor CP_NETWORK
    [error] [ Client] - Encountered error -90: Command read_memory_descriptors executed for 1 milliseconds with result -90
    [error] [ Worker] - Can't read memory descriptors, ap-protection is enabled.
    [error] [ Client] - Encountered error -90: Command program_file executed for 31 milliseconds with result -90
    [error] [ nRF53] - Failed while detecting device memory block protection status!
    [error] [ nRF53] - Failed while reading device information.
    [error] [ Worker] - Access protection is enabled, can't read block protection state.
    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.

    Regards,

  • Hi,

    I have reproduced your reported issue. We will look into it internally. I will get back to you with new information, probably during next week.

    Best regards,
    Dejan

Reply Children
Related