Xip of NAND Flash and nor flash

Source: Internet
Author: User

[Switch] xip-execute in place, which is often translated into Chinese and executed in local mode. Indicates that the code can be executed in the current memory.

About nor flash xip:

Nand and nor and xip

"Nor 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. Nor transmission efficiency is very high, 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. "

About xip of nand flash:

Does NAND Flash not support xip?

Q: Can NAND Flash be used as xip only for nor flash?

A: the so-called xip is that the Code runs directly on flash. nandflash is not suitable for xip, but not xip.

To run a code correctly, ensure that its code is continuous and correct.

Due to some electrical characteristics, nor flash can do this without bad channels or blocks, so it can do xip.

For NAND Flash, it only ensures that its Block 0 is good, and other blocks are not guaranteed. Although the probability of an error is relatively low, there is still a possibility of an error, therefore, the Code may not be executed consecutively and correctly.

However, as long as you have additional safeguard measures, such as performing an ECC verification before executing the Code, to ensure that the Code is continuously correct. you can also create xip. as a matter of fact, I am doing this and it proves that it is successful.

Execute in place

Xip definition:
Xip indicates local execution. The operating system kernel runs directly in flash and does not need to be copied to ram. However, flash memory has a much larger access period than Ram, which may reduce the program running speed after xip technology is used. However, due to the CPU instruction prefetch mechanism and cache mechanism, in practice, it does not significantly reduce the running speed of applications. The principle of xip is very simple, that is, the operating system or application runs directly from non-volatile memory. For the current technology, the non-volatile memory here refers to the nor flash, because only the n0r flash can be randomly accessed. The document [4] provides a scheme to enable xip for NAND flash by adding cache. However, it is not a general solution to add hardware circuits.
In addition to hardware support, xip also requires software support. When the operating system kernel and application program are running, the image in the memory can be divided into three parts: code segment, Data Segment and stack segment. The code segment corresponds to the text section in the execution program, including the Running code and read-only data. This section is generally marked as read-only in the memory. The data segment corresponds to the data section and BSS section (???) in the running file (???), It stores various data (initialized and uninitialized) and static variables, while stack segments store function calls and local variables. According to the above analysis, there are two types of images in the memory when the program runs: Read-only images, such as code segments, and writable images, such as data segments. Flash is writable, but it cannot be written like normal Ram. Therefore, when the program runs in flash, we still need to put some writable data segments in Ram
.

Xip is a mechanism that can directly execute code in flash memory without being loaded into RAM for execution. This reduces the time for the kernel to copy data from flash memory to ram, and uses non-compressed images to reduce the time for self-extracting the kernel. Because the access speed of flash memory is lower than that of RAM, xip technology is used to balance the usage of flash memory and ram according to the hardware environment.

Execute
In place-xip
Xip (execute in place) is a useful option available with uCLinux systems. its main value lies in providing a means of allowing several copies of a program to be running without duplicating the text segment. indeed the text segment can reside in flash memory
And need not be copied to the system Ram at all. This is useful for tasks that have large program bodies with executor executable instances running in the system.
Only the stack, BSS and data segments of an executable needs to be produced for each running program. the text segment can then reside in flash memory or, if execution speed is an issue, then copy the file system to ram first and mount it from there. if executables
In the file system are compiled to support xip and also flagged in their headers as xip they will load and execute with just a single copy of the text segment.

Summary:

Due to the creation process, Nand cannot be accessed through data and address lines like some other memory, but only through Io sequence. Therefore, the access efficiency is low, but its transmission speed is fast, therefore, it is suitable for large-capacity storage, while nor flash is suitable for code storage.

In addition, due to technical reasons, Nand is relatively easy to have bad blocks, and some are bad blocks from the factory, but only through its special mark (apart from the page storing data in NAND flash, there is a special region named OOB (the page of 512b corresponds to the OOB of 16byte, and the page of 2kb should have 64 bytes), in which a byte is used to mark whether it is a bad block ), so you don't know. Therefore, xip is not suitable for storing continuous code.


Http://blog.chinaunix.net/uid-26728868-id-3081967.html

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.