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

Is it possible to continuously log data to flash memory?

I'm not sure if this question has been asked here before, but I couldnt find an existing answer...

I know that flash memory only has a relatively limited number of write / erase cycles.

For the nRF51 this is 20,000.

But from what I understand, this number is for the erase command to a page of flash.

So it may be possible to log to flash, by writing to the next available empty address, rather than erasing an overwriting an existing value.

Hence the number of log values that can be written is governed by the size of a flash page, and the number of available pages in flash (not used for the Application)

Is there any existing example code which does this sort of thing? As I think that data logging is a common requirement.

Parents
  • I don't think my data can ever be zero for the entire block I'm writing, so an allocation table wouldn't be necessary in this case, and would use up space into which I could log data.

    BTW. If I did want to use an allocation table.. Is this done by using individual bits in each byte, otherwise if the chunks of data (struct) I'm writing was fairly small, (which it may initially be), the space taken by the allocation table could be significant.

Reply
  • I don't think my data can ever be zero for the entire block I'm writing, so an allocation table wouldn't be necessary in this case, and would use up space into which I could log data.

    BTW. If I did want to use an allocation table.. Is this done by using individual bits in each byte, otherwise if the chunks of data (struct) I'm writing was fairly small, (which it may initially be), the space taken by the allocation table could be significant.

Children
No Data
Related