In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Nand flash Bad Block Management OOB,BBT,ECC
The operation and management mode of 0.NAND
NAND FLASH management: take Samsung FLAHS as an example, a piece of Nand flash is a device (device), 1 (Device) = xxxx (Blocks), 1 (Block) = xxxx (Pages), 1 (Page) = 528 (Bytes) = data block size (512Bytes) + OOB block size (16Bytes, in addition to the sixth byte of OOB, at least the first 3 bytes of OOB are usually stored in Nand Flash hardware ECC code).
1. Why are there bad blocks?
Because the process of NAND Flash can not guarantee the reliable performance of NAND Memory Array in its life cycle, bad blocks will be produced in the production and use of NAND. The characteristic of a bad block is that when programming / erasing this block, it will cause errors in Page Program and Block Erase operations, which will be reflected in the corresponding bits of Status Register.
two。 Classification of bad blocks
Generally speaking, bad blocks can be divided into two categories: (1) inherent bad blocks: this is a bad block produced in the production process. Generally speaking, the chip factory will mark the sixth byte of the spare area of the first page of each bad block as not equal to the value of 0xff when it leaves the factory. (2) use bad blocks: this is during the use of NAND Flash. If Block Erase or Page Program is wrong, you can simply treat this block as a bad block. At this time, you need to mark the bad block. In order to be consistent with the inherent bad block information, the sixth Byte of the spare area of the first page of the newly discovered bad block is marked as a non-0xff value.
3. Bad block management
According to the above description, we can understand that the NAND Flash factory has reflected the bad block information in the spare area, so, before erasing a block, be sure to check whether the 6th byte of the spare area on the first page is 0xff, and if so, prove that it is a good block and can be erased; if it is non-0xff, it cannot be erased so as not to erase the bad block mark. Of course, this treatment may make a mistake-"kill false bad blocks", because accidental factors such as voltage instability may cause errors in NAND operation during chip operation. However, for the sake of the reliability of the data and the simplification of software design, it is still necessary to follow this standard.
BBT:bad block table, or bad block tables, can be used for management. Different schools have different methods of managing bad blocks of nand. For example, those who specialize in nand storage will put bbt into block0, because block 0 must be a good block. But if nand itself is used for boot, then block 0 will store the program, not bbt. Some put the bbt on the last piece, of course, this piece must not be a bad block. The size of the bbt is related to the size of the nand, and the larger the nand, the greater the bbt required.
4. Bad block correction
When an ECC:NAND Flash goes wrong, it usually does not cause the entire Block or Page to fail to read or all, but only one or more bit errors in the entire Page (such as 512Bytes). A special check, ECC, is generally used. ECC can correct single-bit errors and detect double-bit errors, and the calculation speed is very fast, but it can not correct errors above 1 bit, and can not guarantee to detect errors above 2 bits.
ECC generally generates 3 bytes of ECC parity data per 256byte raw data. The 24 bits of these three bytes are divided into two parts: a 6-bit column check and a 16-bit row check, and the extra two bits are set to 1. Generate two sets of ECC? )
When writing data to NAND Flash's page, every 256byte we generate an ECC checksum, called the original ECC checksum, which is saved to the PAGE's OOB (out-of-band) data area. Its location is eccpos []. When checking, it is not difficult to infer according to the above ECC generation principle: if the original ECC checksum and the new ECC checksum read out from the OOB area are XOR, if the result is 0, there is no error (or there is an error that ECC cannot detect); if there are 11 bits 1 in the 3 byte XOR result, it means that there is a bit error and can be corrected If only one of the three bytes is different or the result is 1, it indicates an error in the OOB area; in other cases, an uncorrectable error has occurred.
5. Supplement
(1) need to make a special description of the bad blocks found earlier due to Page Program errors. If an error occurs while programming a page of a block, mark the block as bad, first back up the contents of other good sides in the block to another empty good block, and then mark the block as bad. Of course, this may make a mistake of "killing by mistake". One remedy is to erase the bad block again after the backup of the block. if there is an error in Block Erase, it proves that the block is a really bad block, so don't hesitate to "poke" it.
(2) one might ask why the sixth byte of the spare area on the first page of each block is used as a bad block tag. This is the default convention of NAND Flash manufacturers, and you can see that Samsung,Toshiba,STMicroelectronics uses this Byte as a bad block tag.
(3) Why are good blocks marked with 0xff? Because the erase of Nand Flash is to change all the bits of the corresponding block to 1, the write operation can only change each bit of the chip (bit) from 1 to 0, not from 0 to 1. The value of 0XFF indicates that the erasure is successful and is a good block.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.