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

FDS lifetime

Hi, I use SDK13.1 FDS example and have some questions about that. Is there any influence about the lifetime of Flash when i use FDS function to write and delete the records.If it has,how to calculate the lifetime of Flash.Thanks.

Parents
  • Hi,

    The flash in the nRF52 series should tolerate minimum 10,000 write/erase cycles (specs) and the FDS library has a basic wear leveling mechanism to avoid wearing down the flash too soon. The lifetime of the flash depends on how much flash you allocate to the FDS library. Say for example that you only allocate one single page. Then old data will have to be overwritten much sooner than if you allocated e.g. 5 pages, effectively reducing the lifetime. Note also that the FDS records has some overhead.

    Bottom line; assign as many pages you can to the FDS library, and try to minimize the effect of the overhead by storing as much data as you can in each record. In the end, how long your flash will last depends on your implementation and is hard to calculate without intimate knowledge of your application.

  • Q1. The FDS library handles this for you.

    If the flash is full you get the FDS_ERR_NO_SPACE_IN_FLASH error when trying to write to flash. In your code it seems like you are trying to handle this error by running a garbage collection, which is what you should do. However, fds_gc() is an asynchronous functions and you should wait for the FDS callback (as you do in the FDS_SUCCESS case) before trying to write again.

Reply
  • Q1. The FDS library handles this for you.

    If the flash is full you get the FDS_ERR_NO_SPACE_IN_FLASH error when trying to write to flash. In your code it seems like you are trying to handle this error by running a garbage collection, which is what you should do. However, fds_gc() is an asynchronous functions and you should wait for the FDS callback (as you do in the FDS_SUCCESS case) before trying to write again.

Children
No Data
Related