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

When I flash an update of my code, does the stored flash data get erased?

I am having problems writing to flash in an older version of s110 using the sd_flash_write() method. The question I have is when I update my code, make a new build, and download the new code to the nRF51822, does the data I have previously written to flash memory also get erased?

I am using Keil. I see that an erase is performed before the download but I don't know if that is just the code or if my previously written data gets erased as well. If the flash data I have written is NOT erased, how do I erase it? Is there a difference between the 'erase' option only and the 'download' option which also erases?

I am using flash to save bonding data. So I need to know the state of the flash when I make a new update (should I clear the bonding information on the central?).

Thanks.

Parents
  • Hi Brian, 
    It's depends on the option you selected in Keil Target setup. 

    If you choose Erase Full chip, any application data will be erased. If you choose Erase Sectors only the sectors that your application occupies (the firmware) will be erased. 

    So if you have stored bond information, and you select Erase Sectors, then bond info  will retain. 

Reply
  • Hi Brian, 
    It's depends on the option you selected in Keil Target setup. 

    If you choose Erase Full chip, any application data will be erased. If you choose Erase Sectors only the sectors that your application occupies (the firmware) will be erased. 

    So if you have stored bond information, and you select Erase Sectors, then bond info  will retain. 

Children
Related