Should You (Still) Use Nor Flash for Embedded Data Storage, and How?

Introduction

According to the financial and industry literature, the NOR flash memory market keeps growing. Yet, in our world, embedded system engineers often see NOR flash as being a “legacy” storage medium. The one used, for example, in countless industrial controllers since the original product used NOR flash and the designers for the next generation of said controllers didn’t want to replace them with less costly and potentially more performant alternatives.

It is true that NOR flash is still immensely popular for firmware storage and adjacent applications. The rising demand for it, coupled with a general pressure on semiconductor manufacturing capacity did nothing to alleviate the high cost per bit of NOR flash however. Consequently, should application designers finally make the jump and replace those costly NOR chips used for data storage in embedded applications?

Why is NOR Flash so Expensive

Before diving in, it might be a good idea to ask ourselves why NOR flash remains expensive. And also, why it didn’t scale in parallel with NAND Flash in terms of density and performance. We are kind of ignoring the non-technical aspects here, such as supply and demand as well as competition for the highly strained semiconductor manufacturing capacity with other storage technologies. That being said, the technical reasons are still the driving force behind the high cost and limited scaling of NOR Flash.

Higher complexity. The textbook reason for NOR Flash cost is the additional complexity of the NOR cells. The simplicity and flexibility of NOR (byte addressability) come at the cost of more complex circuitry, which translates into a larger die area which translates into higher cost and also negatively affects yield. The NOR cells, due to their nature are also considered difficult by the industry to scale down below the 45nm process node.

It would be a mistake to stop there, however, solely blaming the circuit size for the higher cost ignores other very important aspects of NOR flash.

Inability to Scale with ECC. NAND flash is optimized for density and performance at the cost of reduced endurance and considerably higher raw bit error rate. This is compensated by adding block-level Error Correction Code (ECC) to handle bit level corruption in the flash array. While this is not an article on ECC technologies, ECC codes for cold storage tend to work better when applied on large blocks. This enables the correction of a much wider pattern of errors compared to word-level ECC. In the case of NOR flash, applying this method means losing the ability to program individual bytes as well as reducing the random read performance. In short, it would make NOR flash inherit most of the complexity and limitations of NAND memory while still being less density efficient with comparatively poorer erase and write performances. Having said that, it is important to note that there are NOR memories with built-in ECC (such as the Winbond W25H and some W25Q NOR Flash or the Infineon S25FS-S Series (formerly Cypress formerly Spansion) but they usually require write operations to be aligned multiple 16 bytes.

Optimized for Different Applications. This point could either be considered a cause or perhaps an effect of the inherent characteristics of NOR flash. In a way, the simplicity and flexibility of NOR coupled with higher reliability made it popular in demanding industrial, automotive and aerospace applications. As such, the existing devices are targeting those markets where the current advantages of NOR Flash weight somewhat more heavily in the balance compared to cost and density. This chicken-and-egg scenario means that there is less incentive and more risk in developing higher density and more performant NOR flash while affecting negatively its reliability and simplicity.

Pros and Cons of NOR Flash Memory for Data Storage

Now, let’s reiterate the major pros and cons of NOR flash memory in the perspective of embedded data storage.

High Read Throughput and Low Read Operation Latency. One of the significant advantages of NOR flash is its tremendous read performance coupled with low random read latency. Compared to NAND flash, NOR doesn’t need to load an entire page and calculate the ECC on that page for every read. This is one of the reasons why it is so popular for code shadowing and especially for execute in place (XIP) applications. It is also a benefit for real-time, read oriented data storage applications.

Simplicity. Perhaps what NOR Flash is best known for in the realm of raw flash devices is its simplicity and ease of use. NOR is famous for its straightforward software requirements, less temperamental operational behaviour and increased endurance and retention with respect to higher density storage technologies. This makes the technology easier to integrate and deploy. Speaking of deployment, NOR Flash can be preprogrammed easily on the assembly line or even by the distributors using tooling that are expected to be available in most facilities. Finally, NOR Flash is also well supported by most microcontrollers.

Endurance and reliability. NOR Flash usually boasts higher endurance and reliability compared to NAND flash memory. This is especially true at elevated temperature. This makes them easier to use in demanding industrial and automotive applications compared to NAND flash. Of course, extended temperature range and AEC-Q100 qualified NAND devices are available. However, care should be taken to ensure that the device can meet their target life expectancy by taking into consideration the applications write patterns, duty cycle and expected operation temperature.

Higher cost and lower density. As detailed earlier in the article, NOR flash has a considerably higher cost per bit than alternative high density storage technologies. This both means that the cost of a certain amount of storage will be higher than NAND flash, but also that storage of more than 1 Gib per chip becomes hard to find with some of the largest NOR Flash available at the time of writing this article being around 2Gib (256 MiB) with 4Gib devices being hinted at being available in the future.

Lower write performance. NOR Flash is considerably slower than NAND flash in both programming and block erase timing. Therefore, write bandwidth is limited to at most a few hundred KiB/s using a NOR optimized file system or when writing directly to the flash. That being said, when using an adequate file system (See section Should You Use a File System) or an appropriate raw write pattern, NOR Flash can be very consistent which might be of interest to real-time applications that requires some bounded write time at low overall sustained throughput.

Higher power usage. The lower write and erase performance of NOR flash also translates into higher power usage, around 100 time than NAND for the same amount of data written. For applications with infrequent writes, this may not be a problem but applications where the program/erase duty cycle of the NOR flash is high might benefit from a different technology.

Should Consider NOR Flash In a New Design?

With all that was said in the previous sections, should one consider using NOR Flash in a new design? That’s a hard question to answer concisely.

First let’s look over a small summary of common embedded storage media by density, price per bit and typical performance.

Table 1 – Discrete flash media storage cost and performance overview.
TechnologyDensitiesRelative Cost/MiBRaw Write BW
NOR 8Mb-2Gb 0.10-0.25 200-300KiB/s
SLC NAND 1Gb-16Gb 0.03-0.10 5-6MiB/s
MLC NAND 32Gb-512Gb <0.01 5-6MiB/s
SDCard/eMMC 16Gb-8Tb <0.01-0.10+ 10MiB/s-100MiB/s

Note that prices are more indicative of the cost ratio between media type than actual prices. Actual bulk pricing for storage medias can be hard to get and varies wildly depending on demands and other factors. Also, high-grade (i.e. industrial, automotive, aerospace) devices can be considerably more expensive than consumer grade devices, especially when reaching the extremes of available densities or performances. Finally eMMC price and performance depends a lot on the underlying NAND technology. That being said, true SLC eMMC are very rare, even non-existent for new designs.

A good start is to position the application with respect to the previous table to trace the boundaries of potential storage technologies available to an application. Then, with that information in mind, methodically go over the following three categories of considerations.

First, NOR flash is ideal for applications having these requirements and characteristics:

  • Low to medium storage density.
  • High reliability, especially at elevated industrial/automotive range temperatures.
  • Read-centric applications with real-time or high read bandwidth requirements.

However, NAND-flash based technologies should be considered over NOR flash under the following considerations:

  • Need to reduce BoM cost.
  • Require more storage.
  • Aim to reduce power usage.
  • Desire additional write performance.

Finally, the following obstacles should be considered if migrating from an existing design using NOR flash:

  • Is your microcontroller able to interface with the selected storage media, including any boot requirements?
  • Can you meet the software requirements for NAND flash?
  • Is your manufacturing line able to program and test the selected storage media?

As always, the choice is mostly a balancing act between opposing requirements. However, any applications that do not fit squarely in the first set of considerations presented and is affected by the second set should do their utmost to overcome the challenge of the third set of considerations.

What About Parallel Versus Serial NOR Flash?

At this point a brief detour to discuss the choice between serial and parallel NOR flash is warranted. Many legacy applications were built on parallel NOR Flash. Parallel NOR has simpler software (simple drivers for a memory-mapped device) and controller requirements. They also used to have lower operation latency and possibly faster bandwidth. That being said, they use more signal lines than serial QSPI NOR and can be equalled and even overtaken by modern QSPI devices in terms of performance. It’s important to mention that even faster OctoSPI and xSPI devices offers even much more bandwidth. Parallel memory controllers are also getting rarer and can be complicated to use on modern SoCs.

Emerging Technologies.

This article would not be complete without a brief discussion on emerging technologies such as MRAM and FRAM. Those RAM-like non-volatile storage devices promise impressive read and write performances as well as potentially longer retention and endurance than the best NOR flash on the market. Devices have been available on the market for quite some time but were either limited in size or designed for specific niche applications. The offer has been constantly improving with multi-gigabit NOR flash replacement devices soon to be available for new designs. More details on the topic can be found in our previous article on emerging technologies.

NOR Flash is Still Flash Memory

While simpler than NAND flash, NOR flash still has flash specific requirements that should be kept in mind when considering the software design. We go over these requirements in more detail in an article on flash file systems. however the topic can be summarized by the following points.

Flash Like Access Pattern. NOR flash is inherently a copy-on-write device where large blocks (4-64KiB) must be erased before being able to write new data. This requires that either none of the data in the block to be erased is useful or that the useful data must be read before erasing the block. To make it fail-safe, however, the read data must be written elsewhere prior to erasing the block.

Flash Wear. Flash memory is not eternal and will degrade over time. The primary degradation path comes from repeatedly erasing and programming the device. NOR Flash has a typical 100 000 erase/program cycle endurance. This means, in practice, that a specific area of the flash can be erased and programmed around a hundred thousand time before flash retention and reliability targets as specified by the manufacturer cannot be met anymore. The target retention is usually 10 year retention at a certain temperature.

Write Granularity. NOR flash can usually be written at the byte level. However some devices have built-in ECC for improved reliability. Those devices usually requires writing the NOR flash in aligned multiple of 16 bytes. It’s important to confirm that the application and file system can handle this use case if using one of those devices with integrated ECC.

Erase granularity. This is closely related to the first point in this section. However, it is important to note that erasing in larger chunks usually yields higher performance. Writing in aligned full pages (usually 256 bytes) also yields a slight efficiency increase but is much less significant than erasing in large blocks. For example a typical NOR flash might have a combined erase/write bandwidth of around 100KiB/s when erasing 4KiB sub sectors but attain nearly 300KiB/s of effective write bandwidth when erasing 64KiB blocks.

Do you Need Wear Levelling?

It would be a considerable mistake to ignore flash wear just because NOR flash has relatively high endurance. In fact, NOR flash has similar endurance than modern SLC NAND. To determine if wear levelling is required for a particular application three questions must be answered.

Device lifetime. First and foremost, how long the device under consideration is expected to function. And, by extension, how long is the data written to the NOR flash expected to be valid without being rewritten.

Operating temperature. Flash retention goes down significantly at higher operating temperature. This parameter is of crucial importance to evaluate storage reliability and must not be underestimated. It’s also very important to be frank and realistic about the operating temperature.

Write Frequency. Finally, write frequency will determine how long it will take before a block of flash will reach the end of it’s life.

It is important to be truthful and realistic about the above three questions. Many heavy industrial applications will have their electronic operate in conditions exceeding their design specifications. And storage can quickly become a failure point that is difficult to mitigate in production. Especially if repair and maintenance personnel do not have an easy way to diagnose and report that a failure in production was due to a storage failure.

With those questions answered one can look at the, admittedly slim, data on flash endurance and retention versus temperature and write/erase cycles. Let’s take an example of an application expected to operate continuously at 55C and requires 10 years of data retention. Data from Macronix and Micron shows that retention could be maintained under those conditions up to about 20k program/erase cycles. Carefully note that this is considerably lower than the stated 100k in the datasheet.

If the target lifetime and retention aren’t attained for a specific access pattern then wear-levelling is required to spread the flash wear over a larger area.

Should you Use a File System?

Using a file system can be beneficial for unlocking NOR flash performance and reliability. A properly optimized NOR flash file system such as TSFS will allow an application to fully use the endurance of all the blocks of a flash device while minimizing extra write amplification and consequently maintain write and read performance when faced with a complex storage and access pattern.

You should consider using an adequate file system in the following situations:

Mix of cold and hot data. A file system will help perform wear levelling between the cold data and the oft rewritten data while maintaining performance and minimizing write amplification.

Complex storage needs. As an application gets more complicated, the non-volatile storage might be used for an increasingly number of internal services. Data logging, settings & configurations, firmware, certificates and more. A file system’s file and directory abstractions and thread safety will help perform all the storage access while maintaining wear levelling and performance in the face of complex and difficult to characterize access patterns.

On that topic we have another article where we compare the features and performance of 4 different file systems on NOR and NAND flash.

Conclusion

With all that said, is NOR flash still relevant in modern embedded application? The real answer, at the moment, is still yes but the line may be blurrier for many applications. No other storage technology, combined, covers the set of features and characteristics of NOR flash. This is especially true for industrial and other demanding applications requiring high uptime and reliability at elevated temperatures. As such, until we see a clear successor that reaches or exceeds NOR flash reliability and ease of use at similar or (ideally) lower price point, NOR flash will continue to be common for high reliability storage at the edge.

As usual, thank you for reading. If you need advice on anything related to embedded storage or embedded systems in general, please feel free to contact us.


See all articles