Several terms of NAND: OOB, bbt, ECC

Source: Internet
Author: User

For example, Samsung k9f1208u0b has a data storage capacity of 64 MB and uses block-page storage management. 8 I/O
The pin acts as a multiplexing port for data, addresses, and commands.

Chip storage layout and features:
A piece of NAND Flash is a device whose data storage layers are:
1 (device) = 4096 (blocks)
1 (Block )-
= 32 (pages/rows) pages and rows have the same meaning and are called differently.
1 (page) = 528 (bytes) = data block size (512 bytes) + OOB block size (16 bytes)


On each page, the last 16 bytes (also known as OOB) are used to set the status after the NAND Flash command is executed. The remaining 512 bytes are divided into the first half and the second half. You can use the NAND Flash command 00 h/01 H/50 h to locate the front half, the rear half, and OOB respectively.
The built-in pointers of NAND flash point to their respective first addresses.

Storage operation features:
1. The smallest unit of the erasure operation is block.
2. each bit of the NAND flash chip can only be changed from 1 to 0, but not from 0 to 1, therefore, before writing data to it, you must erase the corresponding block (that is, change all the blocks to 1 ).
3. The sixth byte (517 byte) of OOB indicates whether it is a bad block. If it is not a bad block, this value is ff; otherwise, it is a bad block.
4. Apart from the sixth byte of OOB, the first three bytes of OOB are usually stored in the NAND Flash hardware ECC code.

 

Bbt: Bad Block table, that is, bad block table. Various Bad block management methods for NAND are different. For example, if NAND is used for storage, the bbt will be placed in block0, because 0th blocks must be good blocks. However, if the NAND itself is used for boot, 0th pieces will be stored in the program and no bbt can be placed.

Some put the bbt in the last part. Of course, this part cannot be a bad part.


YesIn bbt, two bits are used to indicate the status of one block, so one byte can represent four blocks.

The size of the bbt depends on the NAND size. The larger the NAND, the larger the bbt is required.

So the specific code is analyzed.


 

ECC:


Nand
When a flash error occurs, the entire block or page cannot be read or all fails. However, the entire page (for example, 512 bytes) has only one or several BITs
Error. Generally, ECC is a dedicated verification method. ECC can correct single-bit errors and detect dual-bit errors, and the computation speed is fast. However, it cannot correct errors larger than 1 bit.
Errors cannot be detected.


ECC generally generates 3-byte ECC verification data for each 256 bytes of raw data. The three-byte 24-bit data is divided into two parts: 6-bit column verification and 16-bit row verification, the remaining two bits are set to 1.


When data is written to the page of NAND Flash, an ECC checksum is generated every 256 bytes, which is called the original ECC checksum and saved to the OOB (out-of-band) of the page) data zone. The location is eccpos [].
During verification, based on the above ECC generation principle, it is not difficult to infer that the original ECC verification and the new ECC verification read from the OOB area are bitwise OR. If the result is 0, indicates that the error does not exist (or
Errors that cannot be detected by ECC). If three bytes are different or 11 bits in the result are 1, a bit error exists and can be corrected; if three bytes are exclusive or only one bit is 1 in the result
An error occurs in the OOB area. In other cases, an error cannot be corrected.

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.