CN110597458A - NAND FLASH bad block processing method - Google Patents
NAND FLASH bad block processing method Download PDFInfo
- Publication number
- CN110597458A CN110597458A CN201910724297.9A CN201910724297A CN110597458A CN 110597458 A CN110597458 A CN 110597458A CN 201910724297 A CN201910724297 A CN 201910724297A CN 110597458 A CN110597458 A CN 110597458A
- Authority
- CN
- China
- Prior art keywords
- block
- bad
- data
- bad block
- nand flash
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 6
- 238000000034 method Methods 0.000 claims abstract description 13
- 230000015654 memory Effects 0.000 claims description 14
- 238000007689 inspection Methods 0.000 claims description 5
- 238000013500 data storage Methods 0.000 claims description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Read Only Memory (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention aims to provide an NAND FLASH bad block processing method, which comprises the steps of firstly, NAND FLASH factory bad block check is carried out, then, the bad block is processed, if NAND FLASH data writing fails, existing data of the block are backed up to a cache block, and then the block is erased; if the CC check fails or the read-write data comparison is inconsistent, backing up the existing data of the block to a cache block, and erasing the block; and a method for avoiding reading and writing of bad blocks is also provided, so that the bad blocks can be processed very well, and data can be effectively protected from being lost.
Description
Technical Field
The invention relates to the field of NAND FLASH bad block processing, in particular to a NAND FLASH bad block processing method.
Background
The Nand-flash memory is one of flash memories, and a nonlinear macro-unit mode is adopted in the Nand-flash memory, so that a cheap and effective solution is provided for realizing a solid-state large-capacity memory. The Nand-flash memory has the advantages of large capacity, high rewriting speed and the like, and is suitable for storing a large amount of data. Due to the hardware mechanism of NAND FLASH, NAND FLASH can generate bad blocks in the processes of factory delivery and use; in order to avoid the read-write operation of the bad block and protect the data from being lost, the bad block should be effectively analyzed and managed. There is therefore a need for a NAND FLASH bad block handling method. Therefore, it is necessary to solve this problem.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method for processing a bad block NAND FLASH, which includes checking NAND FLASH factory bad blocks, processing the bad blocks, if NAND FLASH fails to write data, backing up the existing data of the block to a cache block, and erasing the block; if the CC check fails or the read-write data comparison is inconsistent, backing up the existing data of the block to a cache block, and erasing the block; and a method for avoiding reading and writing of bad blocks is also provided, so that the bad blocks can be processed very well, and the problems in the background technology are solved.
The invention aims to provide an NAND FLASH bad block processing method, which comprises the following steps:
step 1: firstly, NAND FLASH factory bad block inspection is carried out:
1.1NAND FLASH when it is used for the first time, scanning whether the mark point of the OOB area bad block of the first page of all blocks is 0xff, if not, it is bad block; counting the number of the non-0 xff; storing a bad block mark scanned from an OOB area of a first page of all blocks into a first block of NAND FLASH, and marking the number of bad blocks and the bad block establishment completion, wherein the marking indicates that NAND has already checked factory bad blocks and is written into a first block of NAND FLASH;
1.2, using NAND FLASH to check whether the bad block establishment completion mark of the first block exists or not, if yes, directly reading the bad block table stored in the first block into the memory, so as to reduce the time of bad block check; if no bad block establishment completion mark exists, the bad block table needs to be reestablished according to the step 1.1;
step 2: using NAND and generating and processing new bad blocks, wherein a first block stores a bad block table and the quantity of the bad blocks, establishes information such as marks and the like, and needs to bypass the block when storing data;
when the normal use is not avoided NAND FLASH, a bad block appears; after NAND FLASH data needs to be written, judging whether the prompt of the status register is successful; reading data again after writing successfully, and judging whether the ECC at the moment is normal or not and whether the read data and the write data are consistent or not; thus, the stored data is proved to be available as correct data;
2.1 when the data writing fails in the above condition, backing up the existing data of the block to the cache block; then erasing the block, judging whether the state register prompts successful erasing, and indicating that the block is available if the state register prompts successful erasing; if the data fails, writing the OOB area bad block mark point of the block into non-0 XFF data, and updating a corresponding bad block table and the number of bad blocks in the first block in time;
2.2 when the ECC fails to check or the read-write data is inconsistent in comparison in the above situation, backing up the existing data of the block to the cache block, and erasing the block; checking whether the prompt erasure of the status register fails at the moment, if the prompt fails, indicating that the block is a bad block, writing the OOB area bad block mark point of the block into non-0 XFF data, and updating a corresponding bad block table and the quantity of the bad blocks in the first block in time; success indicates that the block failed data storage due to voltage instability;
when a new bad block appears, NAND FLASH the data in the cache block needs to be transferred to the next available block; and ensuring that all data is normally stored.
The further improvement lies in that: the method also comprises the following steps of avoiding read-write use of bad blocks:
when data is written, whether the mark value of the bad block of the corresponding address of the bad block table in the memory is not 0XFF or not is searched according to the block address of the written data, and if the mark value of the bad block is not 0XFF, the block is unusable; the address of the written data needs to skip the block address; storing data in the next block also in use;
when reading data, it should search whether the bad block mark value of the address corresponding to the bad block table in the memory is not 0XFF according to the block address of the read data, if not, it indicates that the block is unreadable.
The invention has the beneficial effects that: firstly, NAND FLASH factory bad block inspection is carried out, then bad blocks are processed, if NAND FLASH data writing fails, existing data of the blocks are backed up to a cache block, and then the blocks are erased; if the CC check fails or the read-write data comparison is inconsistent, backing up the existing data of the block to a cache block, and erasing the block; and a method for avoiding reading and writing of bad blocks is also provided, so that the bad blocks can be processed very well, and data can be effectively protected from being lost.
Detailed Description
For the purpose of enhancing understanding of the present invention, the present invention will be further described in detail with reference to the following examples, which are provided for illustration only and are not to be construed as limiting the scope of the present invention.
The embodiment provides a method for processing a bad block of NAND FLASH, which comprises the following steps:
step 1: firstly, NAND FLASH factory bad block inspection is carried out:
1.1NAND FLASH when it is used for the first time, scanning whether the mark point of the OOB area bad block of the first page of all blocks is 0xff, if not, it is bad block; counting the number of the non-0 xff; storing a bad block mark scanned from an OOB area of a first page of all blocks into a first block of NAND FLASH, and marking the number of bad blocks and the bad block establishment completion, wherein the marking indicates that NAND has already checked factory bad blocks and is written into a first block of NAND FLASH;
1.2, using NAND FLASH to check whether the bad block establishment completion mark of the first block exists or not, if yes, directly reading the bad block table stored in the first block into the memory, so as to reduce the time of bad block check; if no bad block establishment completion mark exists, the bad block table needs to be reestablished according to the step 1.1;
step 2: using NAND and generating and processing new bad blocks, wherein a first block stores a bad block table and the quantity of the bad blocks, establishes information such as marks and the like, and needs to bypass the block when storing data;
when the normal use is not avoided NAND FLASH, a bad block appears; after NAND FLASH data needs to be written, judging whether the prompt of the status register is successful; reading data again after writing successfully, and judging whether the ECC at the moment is normal or not and whether the read data and the write data are consistent or not; thus, the stored data is proved to be available as correct data;
2.1 when the data writing fails in the above condition, backing up the existing data of the block to the cache block; then erasing the block, judging whether the state register prompts successful erasing, and indicating that the block is available if the state register prompts successful erasing; if the data fails, writing the OOB area bad block mark point of the block into non-0 XFF data, and updating a corresponding bad block table and the number of bad blocks in the first block in time;
2.2 when the ECC fails to check or the read-write data is inconsistent in comparison in the above situation, backing up the existing data of the block to the cache block, and erasing the block; checking whether the prompt erasure of the status register fails at the moment, if the prompt fails, indicating that the block is a bad block, writing the OOB area bad block mark point of the block into non-0 XFF data, and updating a corresponding bad block table and the quantity of the bad blocks in the first block in time; success indicates that the block failed data storage due to voltage instability;
when a new bad block appears, NAND FLASH the data in the cache block needs to be transferred to the next available block; and ensuring that all data is normally stored.
The method also comprises the following steps of avoiding read-write use of bad blocks:
when data is written, whether the mark value of the bad block of the corresponding address of the bad block table in the memory is not 0XFF or not is searched according to the block address of the written data, and if the mark value of the bad block is not 0XFF, the block is unusable; the address of the written data needs to skip the block address; storing data in the next block also in use;
when reading data, it should search whether the bad block mark value of the address corresponding to the bad block table in the memory is not 0XFF according to the block address of the read data, if not, it indicates that the block is unreadable.
Firstly, NAND FLASH factory bad block inspection is carried out, then the bad block is processed, if NAND FLASH data writing fails, existing data of the block are backed up to a cache block, and then the block is erased; if the CC check fails or the read-write data comparison is inconsistent, backing up the existing data of the block to a cache block, and erasing the block; and a method for avoiding reading and writing of bad blocks is also provided, so that the bad blocks can be processed very well, and data can be effectively protected from being lost.
Claims (2)
1. An NAND FLASH bad block processing method, comprising: the method comprises the following steps:
step 1: firstly, NAND FLASH factory bad block inspection is carried out:
1.1NAND FLASH when it is used for the first time, scanning whether the mark point of the OOB area bad block of the first page of all blocks is 0xff, if not, it is bad block; counting the number of the non-0 xff; storing a bad block mark scanned from an OOB area of a first page of all blocks into a first block of NAND FLASH, and marking the number of bad blocks and the bad block establishment completion, wherein the marking indicates that NAND has already checked factory bad blocks and is written into a first block of NAND FLASH;
1.2, using NAND FLASH to check whether the bad block establishment completion mark of the first block exists or not, if yes, directly reading the bad block table stored in the first block into the memory, so as to reduce the time of bad block check; if no bad block establishment completion mark exists, the bad block table needs to be reestablished according to the step 1.1;
step 2: using NAND and generating and processing new bad blocks, wherein a first block stores a bad block table and the quantity of the bad blocks, establishes information such as marks and the like, and needs to bypass the block when storing data;
when the normal use is not avoided NAND FLASH, a bad block appears; after NAND FLASH data needs to be written, judging whether the prompt of the status register is successful; reading data again after writing successfully, and judging whether the ECC at the moment is normal or not and whether the read data and the write data are consistent or not; thus, the stored data is proved to be available as correct data;
2.1 when the data writing fails in the above condition, backing up the existing data of the block to the cache block; then erasing the block, judging whether the state register prompts successful erasing, and indicating that the block is available if the state register prompts successful erasing; if the data fails, writing the OOB area bad block mark point of the block into non-0 XFF data, and updating a corresponding bad block table and the number of bad blocks in the first block in time;
2.2 when the ECC fails to check or the read-write data is inconsistent in comparison in the above situation, backing up the existing data of the block to the cache block, and erasing the block; checking whether the prompt erasure of the status register fails at the moment, if the prompt fails, indicating that the block is a bad block, writing the OOB area bad block mark point of the block into non-0 XFF data, and updating a corresponding bad block table and the quantity of the bad blocks in the first block in time; success indicates that the block failed data storage due to voltage instability;
when a new bad block appears, NAND FLASH the data in the cache block needs to be transferred to the next available block; and ensuring that all data is normally stored.
2. The method of claim 1, wherein the bad block handling of NAND FLASH is: the method also comprises the following steps of avoiding read-write use of bad blocks:
when data is written, whether the mark value of the bad block of the corresponding address of the bad block table in the memory is not 0XFF or not is searched according to the block address of the written data, and if the mark value of the bad block is not 0XFF, the block is unusable; the address of the written data needs to skip the block address; storing data in the next block also in use;
when reading data, it should search whether the bad block mark value of the address corresponding to the bad block table in the memory is not 0XFF according to the block address of the read data, if not, it indicates that the block is unreadable.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910724297.9A CN110597458A (en) | 2019-08-07 | 2019-08-07 | NAND FLASH bad block processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910724297.9A CN110597458A (en) | 2019-08-07 | 2019-08-07 | NAND FLASH bad block processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110597458A true CN110597458A (en) | 2019-12-20 |
Family
ID=68853674
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910724297.9A Pending CN110597458A (en) | 2019-08-07 | 2019-08-07 | NAND FLASH bad block processing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110597458A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114627932A (en) * | 2020-12-09 | 2022-06-14 | 南京长峰航天电子科技有限公司 | NAND FLASH storage chip bad area detection management method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102237143A (en) * | 2010-04-21 | 2011-11-09 | 深圳市江波龙电子有限公司 | Reconstruction method, system and reconstruction device for block information provided in flash memory |
CN106158047A (en) * | 2016-07-06 | 2016-11-23 | 深圳佰维存储科技股份有限公司 | A kind of NAND FLASH method of testing |
CN106844079A (en) * | 2016-12-28 | 2017-06-13 | 中国北方车辆研究所 | The FLASH bad block managements system and management method of a kind of armored vehicle |
CN109036493A (en) * | 2018-06-11 | 2018-12-18 | 西北工业大学 | A kind of NAND Flash controller with error detection correction mechanism |
-
2019
- 2019-08-07 CN CN201910724297.9A patent/CN110597458A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102237143A (en) * | 2010-04-21 | 2011-11-09 | 深圳市江波龙电子有限公司 | Reconstruction method, system and reconstruction device for block information provided in flash memory |
CN106158047A (en) * | 2016-07-06 | 2016-11-23 | 深圳佰维存储科技股份有限公司 | A kind of NAND FLASH method of testing |
CN106844079A (en) * | 2016-12-28 | 2017-06-13 | 中国北方车辆研究所 | The FLASH bad block managements system and management method of a kind of armored vehicle |
CN109036493A (en) * | 2018-06-11 | 2018-12-18 | 西北工业大学 | A kind of NAND Flash controller with error detection correction mechanism |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114627932A (en) * | 2020-12-09 | 2022-06-14 | 南京长峰航天电子科技有限公司 | NAND FLASH storage chip bad area detection management method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9817725B2 (en) | Flash memory controller, data storage device, and flash memory control method with volatile storage restoration | |
US7330995B2 (en) | Nonvolatile memory apparatus which prevents destruction of write data caused by power shutdown during a writing process | |
US5956473A (en) | Method and system for managing a flash memory mass storage system | |
US9075740B2 (en) | Memory system | |
US8453021B2 (en) | Wear leveling in solid-state device | |
US8732519B2 (en) | Method for using bad blocks of flash memory | |
US10635527B2 (en) | Method for processing data stored in a memory device and a data storage device utilizing the same | |
JP5142685B2 (en) | Memory system | |
US7979737B2 (en) | Method for accessing a Flash memory, and associated memory device and controller thereof | |
CN103577342B (en) | Method for managing data stored in flash memory and related memory device and controller | |
US20120011309A1 (en) | Method for preventing read-disturb happened in non-volatile memory and controller thereof | |
US20090125764A1 (en) | Data preserving method and data accessing method for non-volatile memory | |
KR20110121897A (en) | How to handle user device and its program fail | |
CN101625897A (en) | Data writing method for flash memory, storage system and controller | |
CN101408864B (en) | Data protection method for power failure and controller using the method | |
US9043675B2 (en) | Storage device | |
CN116795729A (en) | Memory system and control method of memory system | |
CN110597458A (en) | NAND FLASH bad block processing method | |
CN107193485B (en) | Storage device, control unit thereof and data storage method for storage device | |
CN113050888B (en) | Method, system, device and storage medium for quickly removing unstable Flash blocks | |
JP6040895B2 (en) | Microcomputer and non-volatile memory block management method | |
CN101783164A (en) | Method for accessing flash memory and relevant memory device | |
CN112711378B (en) | Data storage method and read-write equipment | |
US12093534B2 (en) | Method for inheriting defect block table and storage device thereof | |
CN102956267B (en) | Memory programming method and flash memory device using same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191220 |