How many write/erase cycle on flash??

Zeni241
Posts: 86
Joined: Tue Nov 20, 2018 4:28 am

How many write/erase cycle on flash??

Postby Zeni241 » Fri May 01, 2020 7:34 am

I want to take reading of a sensor every 5 minutes and save it on flash. Then every 24 hours I will send it to server via WiFi.
I read somewhere in this forum that there is a limit of about 10000 write/erase cycles on flash of ESP32 WROOM.
(ESP32 WROOM probably uses GD25Q32C and according to its datasheet its write/erase cycles limit is 100,000.).

This way my flash would be last only (10000)/(24*60/5)= 34.72 days (or 340 days according to GD25Q32C datasheet) weather I use NVS or FATFS or SPIFF.

Or "Wear Levelling API" will take care of it and situation is not so gloomy after all?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How many write/erase cycle on flash??

Postby WiFive » Fri May 01, 2020 8:32 am

Yes wear leveling helps and you only erase when you run out of space not on every write

Zeni241
Posts: 86
Joined: Tue Nov 20, 2018 4:28 am

Re: How many write/erase cycle on flash??

Postby Zeni241 » Fri May 01, 2020 1:31 pm

Thanks WiFive for response. Good clue, “erase only when run out of space” to reduce at least erase cycle.

Just wondering, do people often use this approach in production (save data on flash for a while for later uploading on server) :? :shock: ?

Just gathering courage to use this approach. :D :D

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: How many write/erase cycle on flash??

Postby urbanze » Mon May 04, 2020 11:28 am

WiFive wrote:
Fri May 01, 2020 8:32 am
Yes wear leveling helps and you only erase when you run out of space not on every write
How many writes one simple nvs partition (4KB) with default wear leveling (4K) can do approximately? I need numbers and how to math this?!

[4K*4K*100K(flash write cycle)]/data_write_size(1B) = 1.6M writes ??

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How many write/erase cycle on flash??

Postby WiFive » Mon May 04, 2020 11:49 am

urbanze wrote:
Mon May 04, 2020 11:28 am
WiFive wrote:
Fri May 01, 2020 8:32 am
Yes wear leveling helps and you only erase when you run out of space not on every write
How many writes one simple nvs partition (4KB) with default wear leveling (4K) can do approximately? I need numbers and how to math this?!

[4K*4K*100K(flash write cycle)]/data_write_size(1B) = 1.6M writes ??
126(entries/page)*2(pages)*100k(erases)= 25.2M writes but probably not realistic because you have to copy too many entries when there are only two pages you could end up with as few as 200k writes

Who is online

Users browsing this forum: No registered users and 89 guests