Embedded Development: norflash and nandflash

Source: Internet
Author: User

Embedded Development: norflash and nandflash

Author: Tiger-John
Time: (modified again)
Mail: jibo.tiger@gmail.com
Blog: http://blog.csdn.net/tigerjb/article/details/9322035

Reprinted please indicate the source!


[Abstract]: As an embedded engineer, we must have a minimum understanding of norflash and nandflash. This article comprehensively analyzes and compares the startup mode, read/write mode, capacity cost, reliability, life cycle, and usage type. Everything has two sides, so there is no difference between good and bad. What is important is how we use it to achieve the best performance. Finally, we explain how to choose between norflash and nandflash.

 

 

Preface:

Currently, all types of DDR, SDRAM, or RDRAM belong to the volatile memory, and data in the memory cannot be maintained as long as the current supply is stopped. Flash is a non-volatile memory that can maintain data for a long time without current supply. Its storage is equivalent to hard disks, this feature is the foundation for flash memory to become a storage medium for all types of digital devices.

1. norflash and nandflash startup Modes

(1) norflash has its own data and address bus, so random access similar to Ram can be used. Norflash is characterized by in-chip execution (xip: Execute in place), so that application programs can run directly in flash memory without having to read the code into system Ram. If the RO segment in uboot can be run directly on norflash, you only need to copy the RW segment and Zi segment to ram to run it.

(2) The NAND flash device uses complex I/O Ports 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, S3C2410 has a stepping stone.

Note:

1> the reason why S3C2410 can burn the loader code on the NAND so as to boot, is that the S3C2410 has a built-in SRAM called stepping stone. after power-on, the 4 K content starting from NAND can be automatically copied to SRAM, and then executed in Ram to copy the code in NAND to SDRAM. That is to say, a loader smaller than 4 K can be burned to NAND Flash.

2> norflash Random storage medium, suitable for code storage and EIP, fast reading speed.

Nandflash continuous storage media is suitable for storing large amounts of data.

2. The basic unit of norflash and nandflash read/write is different.

The commonality between nandflash and norflash is first manifested in that data writing to a chip must first empty the corresponding content in the chip, and then be written, that is, the general saying is "first written and then written ". However, norflash only writes one word in bytes, while nandflash needs to erase the entire block.

(1) The application uses the "word" as the basic unit for norflash operations. To facilitate management of large-capacity nor flash memory, nor flash memory is usually divided into logical blocks with a size of kb or 64 KB. Sometimes the block is also divided into sectors. Both the logical block number and the intra-block offset are required during read/write.

(2) Applications operate on nandflash Based on blocks. Nandflash blocks are relatively small, generally 8 KB, and each block is divided into pages. The page size is generally 512 bytes. To modify a byte in nandflash, you must overwrite the entire data block.

So:

1> norflash can operate on words, and it is faster than nandflash in processing I/O operations with small data volumes.

2> nandflash can only clear a fixed area.

3> it is very easy for the NAND device to perform the erasure operation. Nor requires that all the bits in the target block be written to 1 before the disk is erased. 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 (in this case, big data ).

3. Compare the capacity and cost of norflash and nandflash

(1) The norflash capacity is relatively small and the cost is high.

(2) The nandflash capacity is relatively large, and the current maximum capacity has reached 8 GB bytes. To facilitate management, nandflash buckets use block-level and page-level storage bodies. Because the nandflash operations are all in blocks and pages, the speed of nandflash is faster than that of norflash when a large amount of data is read and written to nandflash. In addition, the nandflash cost is low.

4. Reliability Comparison Between norflash and nandflash

(1) the reliability of norflash is higher than that of nandflash, mainly because the interfaces of norflash are simple and there are few data operations. Therefore, the reliability is high and block blocks are rarely displayed, therefore, it is generally used in places with high reliability requirements.

(2) nandflash interfaces and operations are relatively complex, and there are also a lot of bit switching operations. Key data requires an error detection/Error Correction Algorithm to ensure data integrity, therefore, the probability of a problem is much greater, and the bad blocks are inevitable. Due to the random distribution of Bad blocks, even error correction is impossible.

Therefore, we recommend that you use EDC/ECC and other validation algorithms when using nandflash.

5. Life Cycle comparison between norflash and nandflash

Flash Memory has a limited number of writes. When the flash service is close to the service life, some operations often fail. When the service life is reached, the data stored in flash can be read, however, you cannot perform write operations again. To prevent the above issue, you cannot perform write operations on a specific region repeatedly.

Generally, nandflash is more writable than norflash, but because nandflash is usually the entire batch write, if one of the pages in the block fails, the entire process will become invalid, and because of the complexity of the batch write process, the probability of failure is relatively high, so the overall life of norflash is long.

Note:

In nandflash, the maximum number of writes for each block is 1 million, while that for norflash is 100,000. The service life of Flash is also related to the file system mechanism, requiring the file system to have the loss balancing function.

6. Usage differences

The differences in usability are also inseparable from the nor and NAND architecture design.

(1) interface: the design of nor has obvious features of traditional flash memory. Therefore, it is much easier to apply it to the new complex I/O Design of NAND. In addition, when using nand flash memory, you must first write the driver to continue other operations.

(2) There are still bad block management problems in the use of NAND. In nand flash memory, due to the random distribution of Bad blocks, scanning and marking the Bad blocks are required. The existence of Bad blocks requires considerable skill to write information to the nand flash memory, because it cannot be written to Bad blocks, which means that the virtual ing must be performed from the beginning and end on the nand flash memory.

(3) Running code on the nor flash memory does not require any software support. When performing the same operation on the nand flash memory, the driver is usually required, that is, the memory technology driver (MTD ), both NAND and nor flash memory require MTD for write and swap operations.

(4) fewer MTDS are required when nor flash is used. Many vendors provide higher and software for nor flash, including the trueffs driver of M-system.

7. How to choose:

(1) General Principle: nandflash is used for large-capacity multimedia applications, and norflash is used for data/program storage applications.

(2) We generally use the norflash storage program and nandflash to store data, so that the advantages of the two flash memories are complementary.

Example:

The xip-supported nor flash memory can directly run the OS, which is fast. It simplifies the design and reduces the cost. Therefore, many mobile phones adopt the nor + Ram design. The disadvantage of nor flash memory is its low storage density. Therefore, Nand + Ram is also used. For these two solutions, it is difficult to say which one is better, because we cannot leave the specific product and simply evaluate it from a certain aspect. The pursuit of small and elegant mobile phones will require the support of nor flash; the pursuit of large storage capacity of mobile phones will be more choose nand flash; mobile phones that are pursuing both functions and speed will adopt the nor + NAND + Ram design. This design can leverage the advantages of nor and NAND.

(4) In addition to speed and storage density, when selecting a flash chip, you also need to consider interface design, plug-and-play design, drivers, and many other issues, because the two types of flash memory have many differences in the above aspects. For example, in terms of drivers, norflash does not require any software support to run the code, but the storage technology driver (MTD) is required to perform the same operation on nandflash. Although the NAND and nor devices require MTD for write and erase operations, the development of the driver is more difficult for the NAND, because the error correction and bad block processing functions of nand flash memory must be implemented through the driver.

8 supplement knowledge point SPI flash

SPI flash is the serial peripheral device interface of serial peripheral interface. It is a common serial communication interface for clock synchronization and is a norflash interface.

Norflash can be divided into parallel (parallel) norflash and serial (SPI) norflash (SPI flash) based on the number of data transmitted ).

SPI norflash transmits a bit of data each time. Parallel norflash transmits multiple BIT data each time (X8 and x16bit). SPI flash is inexpensive, and the interface is simple, but the speed is slow.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.