Hello,
Will power failures cause any issues in the ESP32? I will be using it for an application where occasional total power failure may be an issue. I know that it is brownout tolerant with the BOD, but will occasional total power failures cause immediate or long-term problems? I could create a battery backup to do a graceful shutdown, but that is undesirable for my uses - I'd rather have the unit simply lose power and restart when power is restored.
Loss of working data is not a concern, as the firmware will be designed to mitigate this issue by writing critical info to flash when it changes (rare event, roughly once every two weeks over lifetime of device).
Thanks!
Power Failure Tolerance
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: Power Failure Tolerance
Power failure problems normally happen because something that writes to flash is not designed with power fails in mind, so if your ESP32 is resistant to this depends on what you use to read from and write to flash. From the technologies ESP-IDF uses, I'm sure that NVS, OTA and SPIFFS can handle sudden shutdowns just fine. FAT may be able to do it as well, but I'm not entirely sure about that. So if you keep to these techniques, you should be fine.
Re: Power Failure Tolerance
From my, very limited, ESP32 experience; a FAT filesystem is not at all happy about sudden shutdowns and gets corrupted.
Anyone got a journaling filesystem handy?
Anyone got a journaling filesystem handy?
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: Power Failure Tolerance
SPIFFS is (partially) journalling I think, and should be resistant to unexpected powerdowns. NVS is more-or-less implemented as a journalling filesystem as well.
Re: Power Failure Tolerance
Link to SPIFFS wiki which discusses handling of power loss: https://github.com/pellepl/spiffs/wiki/ ... owerlosses (TL;DR: you need to run SPIFFS_check after power loss, SPIFFS will not detect it automatically).
Re: Power Failure Tolerance
I'm using SPIFFS through the VFS, and there does not seem to have an easy way to call SPIFFS_check() since the spiffs object is private and there is no wrapper to expose it. Feel free to correct me if I'm wrong.ESP_igrr wrote: ↑Fri Aug 31, 2018 2:59 amLink to SPIFFS wiki which discusses handling of power loss: https://github.com/pellepl/spiffs/wiki/ ... owerlosses (TL;DR: you need to run SPIFFS_check after power loss, SPIFFS will not detect it automatically).
It would be nice if esp_spiffs_init() could handle it (maybe using an option like format_if_mount_failed).
Who is online
Users browsing this forum: MicroController and 64 guests