Hi, I was able to implement the code in your blog to remember the state of a pin, but I’m concerned about the limited write operations. Is there any alternative to this method? Does SPIFFS works the same way regarding this issue? Is there any library or method to use wear leveling?
Thanks in advance
Hi. The ESP32 flash memory can handle a minimum of 100,000 program/erase cycles.
You can read from flash memory as many times as you want. So, instead of writing a value in a certain position, you can read that position first, and only write if the new value is different (update the value).
The SPIFFS has a limit write/erase cycle. It should be used to save data that will not change frequently. You may find useful the following article about estimated SPIFFS lifetime:
https://github.com/pellepl/spiffs/wiki/FAQ#how-long-will-my-spi-flash-live
Regards,
Sara