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

Not able to erase only Flash using erasepage, sectorerase options

Hello,

 

I am using nRF52840, SDK_16.0.0, S140 SoftDevice and Segger 4.16 for flashing the image.

 

This issue is similar to below ticket with -eraseall and chiperase options.

https://devzone.nordicsemi.com/support/241767

 

Let me give little background. I have two merged hex files.

Merged file 1: “Secure Serial Bootloader” + “Soft Device + MBR” + DTM application + “Bootloader settings page”. (Changed Flash & Ram address macros similar to ble_app_blinky)

Merged file 2: “Secure Serial Bootloader” + “Soft Device + MBR” + BLE Blinky application + “Bootloader settings page”.

 

For first time when I flash any merged hex file it works. But when I flash other merged file on top previous merged file with –erasepage or –sectorerase options its failing.

 

1) I want to erase only Flash but not UICR. I used below sequence

 

nrfjprog -f NRF52 --erasepage 0

nrfjprog -f NRF52 --program BLSD_DTM_CT40_V2.hex --verify -r

 

For first time it worked properly. But when I repeat same sequence and trying to flash same hex file, I am getting error. Below is the snapshot.

 a) Whether -erasepage 0 will erase entire Flash from Page 0 to Page 255.

 

b) Even I tried “nrfjprog -f NRF52 --erasepage 0x000000-0x100000”. But still failing.

c) Whether ‘erasepage’ will not erase Page 0 (Similar to nRF51).

 

d) Below is my nrfjprog version

 

2) Even I use –sectorerase. After –eraseall, for first time I am able to flash my binary. But when I try to flash other merged file its failing.

 

 3) Is this because of me using –verify option. As verify will verify Flash, RAM, UICR and XIP regions.

    1. Whether can I verify only flash rather than RAM, UICR and XIP regions.

 

4) I want to write my project specific details in UICR. Using below command, I am able to write.

nrfjprog -f NRF52 --memwr 0x1000108C --val 0xDDCCBBAA –verify

 

But how to erase only specific location. Using --eraseuicr option will erase entire UICR

nrfjprog -f NRF52 --eraseuicr

 

Thanks & Regards

Vishnu Beema

Parents
  • Hi Vishnu,

    1 a) It erases the first page. Notice the output "erasing addresses 0x0 to 0xfff

    1 b) This function erases 64KB

    2) I guess this was resolved after you updated nrfjprog.

    3) --verify is simply reading back the data and comparing it against the hex file it just programmed. nrfjprog will only read back data from addresses contained in the hex file. I.e., it won't read from UICR if the hex file didn't include any UICR data.

    4) UICR is in flash memory so it's impossible to erase just a small section of it.

    Best regards,

    Vidar

Reply
  • Hi Vishnu,

    1 a) It erases the first page. Notice the output "erasing addresses 0x0 to 0xfff

    1 b) This function erases 64KB

    2) I guess this was resolved after you updated nrfjprog.

    3) --verify is simply reading back the data and comparing it against the hex file it just programmed. nrfjprog will only read back data from addresses contained in the hex file. I.e., it won't read from UICR if the hex file didn't include any UICR data.

    4) UICR is in flash memory so it's impossible to erase just a small section of it.

    Best regards,

    Vidar

Children
No Data
Related