What are you looking for ?
Advertise with us
Advertise with us

NAND Vs. NOR Flash Memory

Embedded developer's guide to choosing

Tuxera DenholmThis blog was published on February 24, 2022, written By Thom Denholm, technical product manager at Tuxera, Inc., and also a former developer at Datalight with over 20 years embedded software experience in file systems and flash media management. In his spare time, he works as a professional baseball umpire and an Internet librarian.

NAND vs NOR flash memory:
an embedded developer’s guide to choosing

Careful consideration of the differing capabilities of NAND and NOR flash memory, the specific needs of the use case, and the best storage management software help to improve embedded device performance and lifetime.

Consumer electronics, cars, and other devices use large amounts of embedded flash memory for non-volatile storage – more, in fact, than ever before.[1],[2],[3]

One important decision in designing such devices involves the kind of flash memory to use: NAND or NOR? These are the two major types of flash memory used today. They differ in their circuitry, and each was originally named for the behavior of a discrete logic gate – NAND or NOR.

In this article, we’ll explore which of these flash technologies could be the right choice for you – and steps you can take when making that decision.

1 – Start with data size and usage  
When deciding between these two flash memory types, one of the first questions everyone will ask is, “how much data needs to be stored?”

NOR flash memory has traditionally been used to store relatively small amounts of executable code for embedded computing devices, like simple wearables or small IoT devices. NOR is well suited to use for code storage because of its reliability, fast read operations, and random access capabilities. Because code can be directly executed in place, NOR is ideal for storing firmware, boot code, OSs, and other data that changes infrequently.

NAND flash memory, on the other hand, has become the preferred format for storing larger quantities of data on just about any sophisticated device or system – such as your smartphone or car infotainment system. Higher density, lower cost, faster write and erase times, and a longer read-write life expectancy – these traits make NAND especially well suited for consumer applications. In such use cases, large files of sequential data need to be loaded into memory quickly and replaced with new files repeatedly.

However, storage size remains just one factor when selecting flash memory. The choice between using NAND and NOR flash may not be a simple one for the complex embedded devices of today and the future. While ever-larger media files are driving increased demand for inexpensive NAND, powerful new OSs and intricate applications running on fast processors call for the kind of quick-executing code NOR can support. combines a tremendous need for storage with a demanding set of application performance requirements. In some cases, an optimal design might call for both types of flash memory in the same device.

2 – Consider the performance strengths of each technology
Whichever type of flash is used in a device, there are certain performance bottlenecks – due to the design characteristics of the technologies – that need to be mitigated.

For example:
• NOR is fast to read current data but markedly slower to erase it and write new data.
• NAND is fast to erase and write, but slow to read non-sequential data through its serial interface.
• NAND is also prone to single-bit errors, requiring rigorous algorithms for error detection and correction.

3 – Choose the right storage management software
Well-designed software strategies can be very effective in increasing the performance and reliability of flash hardware.

The goals of flash memory management software include:
• avoiding loss of data
• improving effective performance
• maximizing media lifespan

I’ll dive a little deeper into these aspects below.

Avoiding loss of data
Perhaps the most important goal in managing flash memory is to assure that no data is ever lost as a result of an interrupted operation or the failure of a memory block. There are several ways that flash management software can achieve this aim. Rewrite operations, for example, can be managed in such a way that new data is written and verified before the old data is deleted, so that no power loss or other interruption can result in the loss of both old and new data.

Bad block management is another important safeguard to prevent data from being written to memory blocks that have failed. Software can check for bad blocks shipped from the factory, as is typical with NAND, and avoid writing to those blocks from the beginning. When blocks go bad over time they can be identified and managed so that they are no longer used. Finally, as the end of media life nears, good memory management software can implement a graceful strategy – such as placing the entire flash unit in a read-only state. Data loss can subsequently be avoided when the number of block errors exceeds a predefined number.

Improving effective performance
Flash hardware needs to be able to handle the growing performance requirements of contemporary data-intensive devices. Two ways media management software can improve performance are through background compaction and multithreading.

Compaction reclaims space by identifying blocks that have obsolete data that can be erased, copying any valid data to a new location, and then erasing the blocks to make them available for reuse. Such compaction increases the amount of usable space on the media and improves write performance. Compaction may also help to defragment non-contiguous data for improved performance on read operations. The space recovery is particularly valuable for the more costly NOR memory, while the defragmentation benefits the slower-reading NAND.

Compaction is best performed in the background during idle time, however, or it can interfere with critical operations and degrade performance. This is where a multithreading system becomes important. By allowing high-priority read requests to interrupt low priority maintenance operations, a multithreading system can reduce read latency by orders of magnitude compared to a single-thread solution.

Maximizing media lifespan
Flash lifetime is an important part of data reliability. When some blocks of memory contain fixed content – such as binary code – the remaining blocks will experience increased demand for erase and write operations. That leads to earlier flash failure. Wear leveling algorithms can prevent overuse of memory blocks, and prevent a “stalemate” scenario in which a small region of memory becomes locked in a pattern of repeated writing and compaction. Wear leveling software can monitor block usage to identify high-use areas and low-use areas containing static data, then swap the static data into the high use areas. The software can also balance write operations across all available blocks, by choosing the optimal location for each write operation.

A quality flash manager – like Tuxera FlashFX Tera – successfully balances the above trifecta of features, safeguarding the memory from data loss while boosting performance and achieving the longest lifetime possible.

Final thoughts
With the amount of data being entrusted to flash memory, embedded device manufacturers must make sure they select the optimal kind of flash for their needs. Getting it wrong means muddled performance and a less than stellar flash lifetime. The decision between NAND and NOR memory may be more complex than would first appear – and will ultimately depend on both technical and pricing requirements of the device being built.

However, by carefully considering the differing capabilities of NAND and NOR along with the specific needs of the use case, more effective flash memory decisions can be made.

Regardless of the type or combination of flash that’s finally chosen, it’s prudent to include memory management software (like FlashFX Tera) to prevent data loss while improving the performance and maximizing the lifespan of the memory.

Embedded device manufacturers – let’s keep your flash memory optimally managed and reliable.

[1] Flash memory market revenues worldwide from 2013 to 2021, Statista.
[2] Semiconductor market size worldwide from 1987 to 2020, by WSTS, WSTS Semiconductor Market Forecast Fall 2019.
[3] IDC Report: The Digitization of the World From Edge to Core, by IDC and Seagate.

Articles_bottom
ExaGrid
AIC
ATTOtarget="_blank"
OPEN-E