Internal Wear Levelling and Power Loss

We’re trying to decide on whether to use an SDHC in our embedded design, and we’re looking at SanDisk in particular because of the read/write speeds.

What happens if power is lost while the SDHC is doing wear levelling?

Thanks.
Sal

1 Like

Which cards have you tested so far?

@salq wrote:

We’re trying to decide on whether to use an SDHC in our embedded design, and we’re looking at SanDisk in particular because of the read/write speeds.

 

What happens if power is lost while the SDHC is doing wear levelling?

 

Thanks.
Sal

It looks that this could be the case with premium cards that use static wear-leveling.

I found this on https://wiki.linaro.org/WorkingGroups/Kernel/Projects/FlashCardSurvey:

"The card performs wear leveling by keeping a pool of physical allocation groups that are invisible to the user and choosing a new group from that pool when writing to a new logical group, putting the previous physical group back into the pool after either the new group has been completely written, or the old data been moved over to the new group as part of garbage collection. This method is called dynamic wear leveling and guarantees that all logical allocation groups that sometimes get written to are aging at about the same rate.

The dynamic wear leveling can be easily observed by analyzing the timing for the garbage collection.

Very few SD cards use static wear leveling, which would also puts allocation groups back into the pool that are only written once during initialization of the card but remain stable afterwards. This would be necessary to maximize the expected lifetime of a memory card that is mostly filled with a typical root file system but has a few files being written constantly.

However, some CF cards are known to do static wear leveling in a way that leads to data loss when the supply voltage gets lost while the card is doing static wear leveling. This is even the case for read-only cards, since the static wear leveling can get triggered by read accesses on those cards. "