It’s a simple fact that many consumers use embedded systems longer than designers expect or plan for. How a device uses flash storage is the number one contributor to its lifetime. When the storage media fails, the device fails – which can be costly and damaging to a brand’s reputation. In this article, we’ll take a closer look at how you can make sure your flash storage media lasts as long as your device.

The good and bad of NAND flash-based media

NAND flash memory was launched by Toshiba more than 35 years ago. NAND provided a flash storage medium with faster write speeds and denser physical storage. However, NAND required more software support than the older NOR flash-based media, including wear leveling and bit error correction.

In the last three decades, the thickness of the silicon wafers used to create NAND flash has shrunk, from roughly 1000 nm in 1987 down to 6 nm in the last few years. Smaller wafers allow for more storage but decrease the total number of program and erase (P/E) cycles per write page. This also increases the number of bit errors.

This reduction in the write capacity of NAND flash creates three major issues that can lead to reduced flash lifetime:

  • Write amplification – small writes that have large impacts
  • Writing more often than originally planned – additional contributors logging data, often unexpectedly
  • Scrubbing too frequently – error-management routines erasing too often
  • Let’s focus more on how scrubbing can affect NAND flash lifetime.

    The problems of scrubbing

    The NAND flash controller and any firmware or software controller software handle bit errors, and growing bit error rates affect how long the storage lasts. Scrubbing occurred on early implementations of NAND after one or two bit errors, where data was written to a new NAND write page and the earlier page was marked obsolete.
    This made sense when NAND was first introduced. A subsequent read could have more bit errors, exceeding the threshold and resulting in uncorrectable data. However, modern NAND flash memory can recover up to 60 bits of errors, which leads to the question: does it still make sense to scrub after only one or two?
    Usually, the answer is no – but like everything, this depends on the use case. The main reason to wait until the error rate is higher is because of NAND’s P/E capabilities. Each scrub counts as one of those P/E operations, and modern MLC NAND flash can have less than 1000 P/E cycles. That means to get the best life from your flash storage, it’s crucial to wait as long as possible to correct bit errors – but not so long that data is lost.

    How to optimize scrubbing

    If you have a device that is nearly always active or powered on, the scrubbing threshold can be very close to the maximum allowable bit errors. For a device that’s powered down for long periods of time, it makes sense to scrub bit errors sooner to avoid loss of data.

    As an example of how scrubbing can affect an embedded system, we only need to look at Nintendo’s Wii consoles. Some Wii consoles are failing to boot because of errors on the eMMC. I assume that this is caused by bit errors because folks who left their consoles plugged in haven’t had this problem. While it’s perfectly reasonable for retro gamers to expect their older hardware to continue to work, modern NAND flash can cause difficulties.

    And it’s not just game consoles. For example, automobiles make wide use of NAND storage. While people inside the industry understand that data stored on NAND flash won’t last forever, the average consumer doesn’t. When an older system doesn’t work anymore, it can lead to a major loss of reputation – as the recent recall of an entire automotive line demonstrated. This means extending the lifetime of your NAND flash is critical.

    Want to learn more about all three of the issues that can reduce NAND flash lifetime? Download our whitepaper for all the details and find out how proper planning and solid testing can help extend the life of your NAND flash.

    Whitepaper: Errors to avoid - ensure your storage media lasts as long as your device

    Download the whitepaper