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

Flash external nrf51422 with nrf51-dk

Hello,

I'm trying to flash external nrf51422 module. I want to flash both softdevice and application. I used below commands:

mergehex -m %SOFTDEVICE_NAME% %APP_NAME% -o %MERGE_NAME%
nrfjprog --recover -f NRF51
nrfjprog --program %MERGE_NAME% --verify --chiperase -f NRF51

and I got:

Parsing hex file.
Erasing code flash area.
Erasing UICR flash area.
Applying system reset.
Checking that the area to write is not protected.
ERROR: The operation attempted is unavailable due to readback protection in
ERROR: your device. Please use --recover to unlock the device.

recover command completed fine, but I'm not able to flash. Why recover command doesn't remove readback protection?

When I look into NRF Studio I see information 'ANT device with pre-programed SoftDevice'. My external chip is: nRF51422 QFAACO 1319AJ

Best regards, Marcin

Parents
  • split your last command

    nrfjprog --program %MERGE_NAME%  --verify --chiperase -f NRF51 
    

    into

    nrfjprog --chiperase -f NRF51
    nrfjprog --program %MERGE_NAME% --verify -f NRF51
    

    Then --chiperase will ensure to remove the readback protection before --program takes over

    The draw back of mixing many commands into one is that IT DOES NOT NECESSARILY EXECUTE IN THE SAME ORDER. If you want to ensure the order of the commands, then do not mix them.

  • Hello Aryan,

    Thanks for the answer, but it seems that those splitting is not correct:

    nrfjprog --chiperase -f NRF51
    ERROR: One or several arguments are missing. Use --help to read about the valid
    ERROR: argument combinations.
    

    I tried also:

    nrfjprog --eraseall -f NRF51
    Erasing addresses 0xA000 to 0x3FFFF.
    Erasing UICR flash area.
    Applying system reset.
    nrfjprog --program test.hex --verify -f NRF51
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    ERROR: The area to write is not erased.
    

    Doesn't work. Any more sugestions?

    Regards, Marcin

Reply
  • Hello Aryan,

    Thanks for the answer, but it seems that those splitting is not correct:

    nrfjprog --chiperase -f NRF51
    ERROR: One or several arguments are missing. Use --help to read about the valid
    ERROR: argument combinations.
    

    I tried also:

    nrfjprog --eraseall -f NRF51
    Erasing addresses 0xA000 to 0x3FFFF.
    Erasing UICR flash area.
    Applying system reset.
    nrfjprog --program test.hex --verify -f NRF51
    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    ERROR: The area to write is not erased.
    

    Doesn't work. Any more sugestions?

    Regards, Marcin

Children
No Data