A large amount of writes on ESP32 spiffs/fatfs

83 views Asked by At

I have a battery powered EPS32 project that runs a task every 10 minutes for about 10 seconds and is in deep sleep the rest of the time. I am having some problems and need to to do diagnostics by writing data to the EPS32 flash after each task.

I see that the Arduino IDE supports the use of spiffs and fatfs and as far as I know, both support wear levelling. However, I need to write a few numbers every 10 minutes and that means a lot of writes, which can eventually wear out the flash.

Since I am only going to be adding information, is there a good strategy to avoid rewriting all the data every time I add new data? Which method should I use, spiffs or fatfs? When I open the file in append mode and add data, will the entire file be rewritten each time?

PS. I could probably add an external SD card, but I want to keep power consumption as low as possible.

PSS. The data could also be stored as an array of integers, but can I create such an array in spiffs or fatfs?

0

There are 0 answers