we are using a esp32-wrover, our device can be disconnected at any time, what happens if the power is lost during erase?
As an example, some code is writing to nvs and, while the system is erasing a block to make room, the user disconnect the device from the power.
For sure some data will be lost, but is this the only effect or the flash (and the device) will be damaged?
power down during erase
Re: power down during erase
The flash won't be damaged, but the contents of the sector being erased will be undefined (probably partially erased). The same goes for power failure during a write operation (although usually in this case some of the first bytes in the sequence will be written correctly, and the bytes after that will still be unwritten - usually 0xFF).
The NVS library is specifically designed to be failsafe under these circumstances, ie either the old or the new version of the NVS contents will be returned.
The NVS library is specifically designed to be failsafe under these circumstances, ie either the old or the new version of the NVS contents will be returned.
Who is online
Users browsing this forum: Google [Bot] and 47 guests