I have ISSI IS25LP016D flash, 16Mbit, 4KB sectors, 256 bytes program pages, 100000 erase cycles. I use a filesystem that allows wear leveling, specifically littlefs. Assume that I need to write logs in the following way:
- each record of the log is N binary bytes (e.g. 300)
- I write a line every M minutes (e.g. 10)
- When the file contains R records (e.g. 1500) I rotate the log: I rename the file and reopen a new file with the old name to continue writing the next log records.
The question I need to find an answer to is: with this write rate how long does it take to exhaust the 100000 cycles guaranteed by the component?
I tried to make an estimate, but given the numbers I got I think it's wrong.
I make the simplifying assumption that I don't use any filesystem and don't log rotate:
to write the whole file I use R*M minutes (15000), right? After that I have to delete it and start again. So if I understand correctly I consume an erase/program cycle every M*R minutes, right?
So I run out of 100000 cycles after 100000*M*R minutes.
In my example this means 1.5 x 10^9 minutes, equivalent to about 2893.5 years!!!
I think I did something wrong