Why Use NOR Flash Instead of RAM?
Why use NOR Flash instead of RAM?
RAM loses everything when power is removed. NOR Flash is non-volatile and retains data after power-off while still supporting the random-access read speed that embedded systems need to boot and execute code in place (XIP). RAM, whether SRAM or DRAM, is a working store for active computation. NOR Flash is the storage that survives shutdown.
A typical embedded system uses both: NOR Flash holds the boot ROM, firmware, and configuration tables; RAM holds the stack, heap, and active buffers while the processor runs. Choosing NOR over RAM for code storage is a question of whether that code needs to survive a power cycle.
NOR Flash vs RAM: the real differences
Volatility and purpose
| Feature | NOR Flash | SRAM | DRAM |
|---|---|---|---|
| Volatility | Non-volatile (retains data without power) | Volatile (loses data on power-off) | Volatile (loses data on power-off) |
| Read latency | ~70–150 ns random access | ~5–10 ns | ~10–20 ns (with refresh) |
| Write speed | Slow (erase 100 ms–2 s per sector) | Near-CPU speed | Fast (byte-level write) |
| Endurance | ~100K erase cycles | Unlimited | Unlimited |
| Typical use in embedded | Boot ROM, firmware storage, parameter storage | CPU cache, working memory | Main system memory (DDR) |
| Cost per MB | Moderate | High | Low |
SRAM and DRAM are orders of magnitude faster for both read and write. They require continuous power. A microcontroller that boots from SRAM would start with empty memory every time it powers up—no bootloader, no operating system, no application code to load.
XIP: execute code directly from NOR Flash
NOR Flash supports random access that NAND Flash and other non-volatile storage lack. Unlike NAND, which reads data in pages and requires copying to RAM before execution, NOR Flash maps directly into the CPU address space. The processor fetches instructions from NOR Flash byte-by-byte or word-by-word without any copy operation. This capability is called XIP, eXecute In Place.
A bootloader or firmware image that must start executing the moment the processor comes out of reset benefits from XIP because it eliminates the boot-time copy delay. A system can begin running from NOR Flash in microseconds after power-on, whereas a NAND-based system needs to first copy the entire image into RAM before jumping to it.
Why not just use DRAM plus slow storage?
Desktop systems use DRAM for working memory and SSD or HDD for persistent storage. Embedded systems face different constraints:
- Boot time matters. A medical device, an automotive ECU, or an industrial controller may need to become operational within milliseconds of power-up. Copying firmware from a slow NAND or SD card into RAM introduces latency that XIP avoids entirely.
- Deterministic state. RAM is fast but volatile. If the system loses power unexpectedly, any data in RAM is gone. NOR Flash gives you a known state at startup—the firmware is right there.
- Cost and pin count for small designs. For code sizes under 64 MB, a single SPI NOR or QSPI NOR chip costs less than a DRAM module plus its controller, and uses far fewer PCB pins (8 pins for QSPI versus 40+ for a parallel DRAM bus).
Limitations of NOR Flash
NOR Flash has real limitations. Erase operations are slow, typically 100 ms to 2 seconds per sector, and the cost per megabyte is higher than NAND Flash or DRAM. It is not suitable for high-throughput data logging, video buffering, or large file storage. For those workloads, NAND Flash (eMMC, SD card, SSD) is the right storage tier, even if it requires an initial copy-to-RAM step for code execution.
A typical embedded architecture uses both: a small NOR Flash (4–16 MB) for boot code and firmware, and a larger NAND-based storage (eMMC, SD, or SSD) for application data. DRAM serves as the working memory for active computation.
By Loongtion Technical Team
Related resources
Continue with related selection guides and notes for the same industrial storage topic.