Flash memory reliability
wmosscrop
Posts: 409
I have just experienced two separate failures of flash memory. One was a name brand flash memory IC that wouldn't allow writes, and the other was a a generic SD card that also failed to allow writes. In both cases the code would randomly hang because the expected output from the chip/card was never received.
Both of these (unfortunately) were for the same propeller project and occurred during significant changes to the code, causing much confusion (over the normal amount I create all by myself ) until I figured out the issue.
I know that flash memory "wears out" eventually. And my projects, which reused the same input and output files and/or memory locations repeatedly, probably accelerated the process and may have prevented any wear leveling from working.
My understanding is that the wear issue only occurs with writes and not reads.
In any case, will this eventually effect devices such as routers, printers, etc. that save settings and/or error log information to flash? Admittedly both of my devices were used for several years before they failed. But this usage was sporadic, not daily.
Or has prevention for this type of failure already been engineered into the devices?
Walter
Both of these (unfortunately) were for the same propeller project and occurred during significant changes to the code, causing much confusion (over the normal amount I create all by myself ) until I figured out the issue.
I know that flash memory "wears out" eventually. And my projects, which reused the same input and output files and/or memory locations repeatedly, probably accelerated the process and may have prevented any wear leveling from working.
My understanding is that the wear issue only occurs with writes and not reads.
In any case, will this eventually effect devices such as routers, printers, etc. that save settings and/or error log information to flash? Admittedly both of my devices were used for several years before they failed. But this usage was sporadic, not daily.
Or has prevention for this type of failure already been engineered into the devices?
Walter
Comments
Following the Raspberry Pi forums for some years its seems it's quite common for SD cards to go read-only. This gets reported a lot. Thing is it does not seem to be related to wear. Often it's reported for new(ish) cards. There are "write-protect" bits in SD cards that could get flipped accidentally. Or perhaps the cards were some of the many fakes that are around. I have never seen anybody get to the bottom of this problem. It just happens, God knows why.
The wear leveling algorithms in SD cards are a deep secret. Nobody knows what they do exactly. One might expect that the block numbers you write to are not the actual block numbers of the physical FLASH devices. That the SD card controller maps those logical to physical blocks somehow. In this way it can shuffle things around such that heavily written logical blocks actually write to different physical blocks over time.
In this way we would expect that if you write to the same logical block millions times those writes are spread over all the physical blocks, so each physical blocks sees thousands of times less writes and the life of the whole thing is thousands of times more than the life of a block.
I can't speak for FLASH chips. I'm out of touch with those now a days. I guess the expected number of writes is in the datasheet.