What happens when embed flash's write limit is reached?
What happens when embed flash's write limit is reached?
I have esp32 s2 mini dev board with embed psram and flash. I was wondering if the microcontroller would still be usable in that edge case because i constantly update code with those microcontrollers. On my Esp32 s3 and esp32 the flash memory is external so its easy to just replace the flash chip but on the s2 its all internal. Like for example can it still boot from external flash connected to vspi or hspi even though its internal flash is "Write only dead" since flash has no read limit.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: What happens when embed flash's write limit is reached?
It would likely not. Worn-out flash, to my knowledge, results in bits not being properly erased anymore, that is, they will always stay 0 even if you need them to be 1. This would result in a corrupted flash image, and the ESP32 will refuse to boot that.
Good thing is that the flash internal to ESP32 chips is generally rated for 100000 writes (actually: erase cycles) or more, so you generally don't reach that limit by simply doing a lot of development work.
Good thing is that the flash internal to ESP32 chips is generally rated for 100000 writes (actually: erase cycles) or more, so you generally don't reach that limit by simply doing a lot of development work.
Re: What happens when embed flash's write limit is reached?
Yeh but i was writing to the normal Esp32 and it started to give checksum errors after maybe hundreds of writes. Had to erase entire flash to fix it. But then the normal esp32s flash is external so it would be easy to replace. However if the s2 mini will be a brick after embed flash dies then it isn't really worth buying. Might be better to get them with only embed psram but with External flash.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: What happens when embed flash's write limit is reached?
If a full erase 'fixes' the write errors, it's not a wear issue. I think you may have been doing something wrong. Were you using some API in your program to write to flash? If so, were you aware that a write can only flip bits from 1 to 0 and not the other way around? (You need an erase for that.)
-
- Posts: 1704
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: What happens when embed flash's write limit is reached?
Digging a bit into NOR flash failure modes, I found this interesting document.
Apparently, the 'stuck at 0 after erase' failure mode can be somewhat 'self-healing' if cells are allowed a 'rest period' of a few seconds between erase and write. And: Repeated writes to the same 'row' of flash can disturb (i.e. inadvertently program) adjacent cells, to which the fix is to erase and re-program those cells.
That said, before assuming a flash failure you may want to first check if there's an issue in your code which either a) writes to an incorrect location, b) writes to a location which was not previously erased, or c) writes the 'wrong' data.
Apparently, the 'stuck at 0 after erase' failure mode can be somewhat 'self-healing' if cells are allowed a 'rest period' of a few seconds between erase and write. And: Repeated writes to the same 'row' of flash can disturb (i.e. inadvertently program) adjacent cells, to which the fix is to erase and re-program those cells.
That said, before assuming a flash failure you may want to first check if there's an issue in your code which either a) writes to an incorrect location, b) writes to a location which was not previously erased, or c) writes the 'wrong' data.
Re: What happens when embed flash's write limit is reached?
No i wasn't modifying flash. This only occurred from flashing esp32 a ton of times. I had disabled the option to erase ENTIRE flash every time it uploads. BUT only when i enabled it did the checksum error go away.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: What happens when embed flash's write limit is reached?
How specifically do you flash your ESP?
Re: What happens when embed flash's write limit is reached?
With arduino ide default settings. Except changed partition style to huge app.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: What happens when embed flash's write limit is reached?
Do you have anything connected to GPIO45?
Re: What happens when embed flash's write limit is reached?
gpio45 is not broken out on esp32 dev kit
Who is online
Users browsing this forum: Bing [Bot] and 93 guests