Differences between nor and NAND
Nor and NAND are two major non-loss flash technologies on the market. Nor is generally used to store a small amount of code, while NAND is an ideal solution for storing high-density data. Nor is mainly used in code storage media, and NAND is suitable for data storage.
Features:
Nor is characterized by simple application, no special interface circuit, and high transmission efficiency. It is an internal chip execution (xip, execute in place ), in this way, the application can run directly in the (NOR) flash memory without having to read the code into the system Ram. In 1 ~ The small size of 4 MB has high cost efficiency, but the low write and erase speeds greatly affect its performance.
The NAND structure provides a very high unit density, achieves a high storage density, and writes and erases quickly. The difficulty of using NAND lies in Flash management and special system interfaces.
Performance Comparison:
Write operations on any flash device can only be performed in an empty or erased unit. In most cases, the flash device must be erased before writing.
It is very easy for the NAND device to perform the erasure operation, and nor requires that all the bits in the target block be written to 0 before the erasure.
Since the nor device is erased with 64 ~ For blocks of KB, the time for performing a write/erase operation is 5 S. In contrast, the erased NAND device is 8 ~ For 32 KB blocks, it takes up to 4 ms to perform the same operation.
When the block size is erased, the performance gap between nor and nadn is further extended. Statistics show that for a given set of write operations (especially when updating small files ), more erasure operations must be performed in the nor-based unit.
In this way, when selecting a storage solution, the designer must weigh the following factors.
● Nor reads faster than NAND.
● NAND writes much faster than nor.
● NAND's 4 Ms erasure speed is far faster than nor's 5s.
● Most write operations require erasure first.
● NAND has fewer erased units and fewer erased circuits.
Interface differences:
Nor Flash has an SRAM interface and enough address pins to address it, so it can easily access every byte in it.
Nand devices use complex I/O ports to access data in a serial manner. Different products or vendors may use different methods. Eight pins are used to transmit control, address, and data information.
Nand read and write operations use 512 bytes of blocks, which is a bit like hard disk management. Naturally, NAND-based memory can replace hard disks or other Block devices.
Capacity and cost:
The unit size of NAND Flash is almost half the size of the nor device. Because the production process is simpler, the NAND structure can provide a higher capacity within the given mold size, thus reducing the price accordingly.
Nor flash occupies 1 ~ Most of the 16 MB flash memory market, while NAND Flash is only used in 8 ~ Among the MB products, this also shows that nor is mainly used in code storage media. NAND is suitable for data storage. NAND shares the largest share in the compactflash, secure digital, PC cards, and MMC memory cards markets.
Reliability and Durability:
Compare the reliability of nor and NAND in terms of life (durability), bit switching, and bad block processing.
L life (durability)
In nand flash memory, the maximum number of writes to each block is 1 million, while that of nor is 100,000. In addition to having a block erasure cycle of 10 to 1, the typical NAND block size is eight times smaller than that of the nor device, each NAND memory block is deleted less frequently within a given period of time.
L-bit Switching
All flash devices are plagued by bit switching. In some cases (rarely, Nand occurs more often than nor), a bit is reversed or reported to be reversed. One-bit changes may not be obvious, but if it occurs on a critical file, this small fault may cause system downtime. If there is only a report problem, it may be solved by reading multiple times.
Of course, if this bit changes, you must use the error detection/error correction (EDC/ECC) algorithm. The problem of bit inversion is more common in nand flash memory. The NAND supplier recommends using the EDC/ECC algorithm when using nand flash memory.
This problem is not fatal when using NAND to store multimedia information. Of course, if you use a local storage device to store operating systems, configuration files, or other sensitive information, you must use the EDC/ECC system to ensure reliability.
L Bad Block Processing
Bad blocks in NAND devices are randomly distributed. I have tried to eliminate bad blocks before, but I found that the yield rate is too low, the cost is too high, and it is not cost-effective at all.
The NAND device needs to initialize the media to detect Bad blocks and mark them as unavailable. In an existing device, a high failure rate may occur if this processing is not performed in a reliable way.
Ease of use:
The nor-based flash memory can be used very directly, and can be connected like other memory, and code can be directly run on it.
Due to the need for I/O interfaces, Nand is much more complicated. The access methods for various NAND devices vary from manufacturer to manufacturer. When using the NAND device, you must first write the driver to continue other operations. Writing information to a NAND device requires considerable skill, because designers must not write information to Bad blocks, which means virtual ing must be performed from beginning to end on the NAND device.
Software support:
When discussing software support, we should distinguish basic read/write/erase operations from high-level software for disk simulation and flash management algorithms, including performance optimization.
Running code on the nor device does not require any software support. When performing the same operation on the NAND device, the driver is usually needed, that is, the memory technology driver (MTD ), the NAND and nor devices require MTD for write and erase operations.
When using the nor device, fewer MTDS are required. Many vendors provide mtds for the nor device.
Another article:
Flash Memory, also known as flash memory, has two main types: norflash and nandflash. We will give a comparison between them from multiple perspectives. In actual development, designers can make reasonable selection of Flash Memory Based on Product requirements.
1. Interface comparison
Norflash has a common SRAM interface, which can be easily attached to the CPU address and data bus. It has low requirements for CPU interfaces. Norflash features in-chip execution (xip, execute in place), so that applications can run directly in flash memory without having to read the code into system Ram. For example, the RO segment in uboot can be directly run on norflash. You only need to copy the RW and Zi segments to ram to run them.
The nandflash device uses a complex I/O port for serial data access, and eight pins are used to transmit control, address, and data information. Because the timing is complex, it is recommended that the CPU be integrated with the NAND controller. In addition, because nandflash is not attached to the address bus, if you want to use nandflash as the boot disk of the system, the CPU must have special functions, for example, when the nandflash startup mode is selected, the S3C2410 will automatically read 4 k Data from nandflash to the SRAM at address 0 during power-on. If the CPU does not have this special feature and you cannot directly run the code on nandflash, you can use other methods. For example, many nandflash development boards use nandflash, except nandflash, A small norflash is used to run the startup code.
2. Comparison of capacity and cost
Compared with nandflash, norflash has a smaller capacity, generally ranging from 1 ~ About 16 Mbyte, some new processes use the chip superposition technology to increase the norflash capacity. In terms of price, norflash is relatively higher than nandflash, for example, the current market for a 4 Mbyte am29lv320 norflash retail price is about 20 yuan, and a Mbyte k9f1g08 nandflash retail price is about 30 yuan.
The nandflash production process is simpler. The NAND structure can provide a higher capacity within the given mold size, thus reducing the price accordingly.
3. Reliability Comparison
Bad blocks in NAND devices are randomly distributed. They have previously been used to eliminate bad blocks. However, they are not cost-effective because the yield rate is too low and the cost is too high. The NAND device needs to initialize the media to detect Bad blocks and mark them as unavailable. In an existing device, a high failure rate may occur if this processing is not performed in a reliable way. The bad block problem does not exist in norflash.
In the flash bit flip (a bit is flipped) phenomenon, the probability of NAND appears much greater than norflash. This problem is fatal when storing key files in flash. Therefore, we recommend that you use EDC/ECC and other validation algorithms when using nandflash.
4. Life comparison
In nand flash memory, the maximum number of writes to each block is 1 million, while that of nor is 100,000. The service life of flash memory is also related to the file system mechanism, requiring the file system to have the loss balancing function.
5. Upgrade comparison
The upgrade of norflash is troublesome because the address line of norflash varies with the capacity, so it is inconvenient to replace the norflash chip of different capacity. Usually we will solve this problem by making some jumper Resistors on the address line of the circuit board, for norflash of different capacities.
The nandflash interfaces of different capacities are fixed, so the upgrade is simple.
6. read/write Performance Comparison
Write operation: Any flash device write operation can only be performed in an empty or erased unit. It is very easy for the NAND device to perform the erasure operation, and nor requires that all the bits in the target block be written to 1 before the erasure. When the nor device is erased ~ For blocks of KB, the time for performing an erasure/write operation is about 5 s. The erased NAND device is composed of 8 ~ For 32 KB blocks, it takes up to 4 ms to perform an erasure/write operation.
Read operation: Nor reads faster than NAND.
7. File System Comparison
In Linux, MTD is used to manage different types of Flash chips, including nandflash and norflash. Common file systems that support running on flash include cramfs, jffs, jffs2, yaffs, and yaffs2. The cramfs file system is a read-only file system. To implement read/write operations on flash, we usually select the jffs and jffs2 file systems on norflash, and select the yaffs or yaffs2 file systems on nandflash. The yaffs2 file system supports nandflash memory with large pages (more than 512 bytes/page.