Repository navigation
ESP32: Non-volatile storage support #4436
Description
Activity
- addedenhancementFeature requests, new feature implementationsFeature requests, new feature implementations
on Jan 29, 2019 while avoiding file system corruption which might occur during power outage in case data would stored in the file system (currently the only option).
An alternative filesystem which is robust against power outages during write is LittleFS, and this is due to be integrated soon. See #3847 for more details.
ESP-IDF provides NVS library:
I guess it could be exposed as a module, but it's more Python-like, and portable to other platforms, to use files for this purpose.
@dpgeorge
A question regarding storage of data in the current implementation of file system in ESP32 port - is it suitable for frequent rewrites of data? I mean is there some wear-leveling mechanism implemented? My goal is to store data in between deep-sleep wake-ups.I have NVS working after making some mods to the source code. However, since @dpgeorge is quite slow with merging PR's i'm not sure whether to put the effort in making a NVS PR....
Yes, please make a PR, it is worth it.
Which data types are currently supported by your implementation?- Reacted by mrwhy-orig
- added a commit that references this issue
on Feb 19, 2021 NVS support was added in c10d431
- added a commit that references this issue
on May 23, 2026 - added a commit that references this issue
on Sep 21, 2026
This feature would be great for storage of configuration parameters, flags and other data in between power cycles or during deep-sleep while avoiding file system corruption which might occur during power outage in case data would stored in the file system (currently the only option).
ESP-IDF provides NVS library:
https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/storage/nvs_flash.html