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 Reply
  • In our SDK example, you can switch between the project (inside one project) to flash the softdevice only. 
    Another option you can do is to have a button to erase all application data. So when you hold the button when starting up, the application will erase the data. 
    If you have a .bat file to execute nrfjprog command, it will very quick and you don't have to switch to nRF Connect tool. 

Children
Related