NVS FLASH write / erase cycle calculation
Posted: Mon Jun 21, 2021 9:57 am
Hi,
I am currently struggeling to calculate the expected lifetime of my flash.
I am using the NVS flash library and would like to store the runtime of my device every 1 - 5 minutes, depending on the lifetime of the flash. I don't want to wear out the flash within a short time just in order to monitor the devices runtime.
In my NVS Flash, I have 10 entries (primitve types).
10 entries x 32 bytes per entry + 2 bytes padding = 322 bytes
A NVS Page by default is 4kB large(?), so the data will fit 4kB / 322B = 12 times into one page.
NVS Partition is 128k big (0x20000), so 32 pages will fit in a the partition.
The partition is expected to be 100k times eraseable.
In total, there can be 32 x 12 x 100k writes = 38.4M
Is this calculation correct?
I am currently struggeling to calculate the expected lifetime of my flash.
I am using the NVS flash library and would like to store the runtime of my device every 1 - 5 minutes, depending on the lifetime of the flash. I don't want to wear out the flash within a short time just in order to monitor the devices runtime.
In my NVS Flash, I have 10 entries (primitve types).
10 entries x 32 bytes per entry + 2 bytes padding = 322 bytes
A NVS Page by default is 4kB large(?), so the data will fit 4kB / 322B = 12 times into one page.
NVS Partition is 128k big (0x20000), so 32 pages will fit in a the partition.
The partition is expected to be 100k times eraseable.
In total, there can be 32 x 12 x 100k writes = 38.4M
Is this calculation correct?