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

How to protect the data written into flash from being erased when flashing nRF52832 ?

    As a matter of fact that there is no special EEPROM in nrf52832 , the user data which need to be stored in nrf52832 should be written into the flash of nrf52832 . The SDK of nrf52832 has offered the interface of flash_write in the "peripheral >>flash write " example , as shown in picture 1 .

    When developing with IAR IDE , the total flash of nrf52832 will be erased and reprogrammed . As a result , the user data will be erased . However , developer has to make sure that updating the code of nrf52832  should never erase the user data which stored in the nrf52832 . How to achive that goal ? 

picture 1

  • Hi,

    I must admit I am not experienced with IAR, but I would have expected that it only erased the pages that the application spans. Have you verified that you get a full chip erase? You can easily see the memory layout if you add the application to the nRF Connect Programmer app. Or could it be that for instance, the application is larger than you expected, or that your data is on a page that is also occupied by the application?

Related