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

wear leveling

Nordic nRF52840, with regards to stored security keys in flash, some wear leveling schemes move data when being updated but do not erase data from the old location. This is an issue when going through the FIPS 140-2 certification. Can you comment in this regard on the wear leveling scheme Nordic implements?

  • If you use the FDS module to store data, then you are right that when updating stored data in flash, it will simply write new data to a free location in the available flash pages reserved for FDS, without deleting or erasing previous data (it's only marked as "invalid"). The reason for this is to reduce the wear on the flash, e.g. flash retention is 10.000 flash erase operations if I remember correctly, in addition flash erase operations take time, so for most applications you want to reduce the amount of flash operations. If this is a problem there are basically two options:

    - run the fds_gc() each time you update the data in question, because running garbage collection this will "clean up" flash pages to erase data that is no longer valid, note that this will trigger multiple flash erase operations depending on the number of flash pages that are reserved for the FDS. 

    OR

    - don't use the FDS module, but instead use the flash api directly to store data raw in a flash page.

    Kenneth

Related