This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Logging interval data into flash memory. FDS or fstorage? Wear levelling?

Hi Nordic DevTeam,

I am using nRF52840 (1MB Flash, 256kB RAM). I would like to store a log data to flash memory that I can extract them to my Android phone later on when connected. I have concern about the 10,000 write cycle of the nrRF52, I have to write this frequently to the flash.

Let's say after I allocate bootloader, SD s140 library and application (total : ~250kB in flash).  I expect the device to last 5-6 years and I allocate 500kB just for logging purposes and continuously log data every 1 minute when the device is on in csv format : eg. "time, voltage, current, etc." (let's say 40 Bytes each minute). Before I save to flash, I will allocate this data in RAM first (maybe fixed-sized array of 50kB), and whenever the allocated RAM is almost full or the device is about to be turned off. I will write this RAM data into the flash page, using the FDS library provided it has the wear-levelling mechanism in the background. My understanding is the bigger the flash allocated to it, wear-levelling will be more effective as there are more probability to use unused space to store data.

Does my implementation make sense in this case considering the write cycle of the flash?

Would it be recommended to log and save logged data into internal flash memory or would I really need external flash memory like SD Card?

Parents
  • Hi,

    Does my implementation make sense in this case considering the write cycle of the flash?

    Yes, this makes sense. FDS has basic wear leveling, so in principle you will write equal amount of data to all the flash pages you have allocated for FDS.

    Would it be recommended to log and save logged data into internal flash memory or would I really need external flash memory like SD Card?

    If you calculate the amount of data you intend to write, and find that you will over the life cycle of the device, and find that you will not write more than 10.000 times the number of flash pages you have allocated (less one for swap), then there should not be any problem and you will be using the device within the limits of the specification. If not, then you may want to consider additional external storage.

Reply
  • Hi,

    Does my implementation make sense in this case considering the write cycle of the flash?

    Yes, this makes sense. FDS has basic wear leveling, so in principle you will write equal amount of data to all the flash pages you have allocated for FDS.

    Would it be recommended to log and save logged data into internal flash memory or would I really need external flash memory like SD Card?

    If you calculate the amount of data you intend to write, and find that you will over the life cycle of the device, and find that you will not write more than 10.000 times the number of flash pages you have allocated (less one for swap), then there should not be any problem and you will be using the device within the limits of the specification. If not, then you may want to consider additional external storage.

Children
  • Hi Einar,

    Thanks for your reply.

    How do you use the FDS Storage with CLI example?

    Do I need to connect it with putty?

    I can't get any log reading from the SEGGER Debug Terminal even after I switched "NRF_LOG_ENABLED" to 1. Some of the other example has this "NRF_LOG_BACKEND_RTT_ENABLED" in their "sdk_config.h" . This example doesn't. Can you clarify what's the difference between the 2 settings?

Related