CN114203252A - Bad block detection method, device, equipment and storage medium of nonvolatile memory - Google Patents

Bad block detection method, device, equipment and storage medium of nonvolatile memory Download PDF

Info

Publication number
CN114203252A
CN114203252A CN202111386658.7A CN202111386658A CN114203252A CN 114203252 A CN114203252 A CN 114203252A CN 202111386658 A CN202111386658 A CN 202111386658A CN 114203252 A CN114203252 A CN 114203252A
Authority
CN
China
Prior art keywords
bad
bad block
block
nonvolatile memory
data
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
Application number
CN202111386658.7A
Other languages
Chinese (zh)
Inventor
谭四方
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Demingli Electronics Co Ltd
Original Assignee
Shenzhen Demingli Electronics Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Demingli Electronics Co Ltd filed Critical Shenzhen Demingli Electronics Co Ltd
Priority to CN202111386658.7A priority Critical patent/CN114203252A/en
Publication of CN114203252A publication Critical patent/CN114203252A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/04Detection or location of defective memory elements, e.g. cell constructio details, timing of test signals
    • G11C29/08Functional testing, e.g. testing during refresh, power-on self testing [POST] or distributed testing
    • G11C29/12Built-in arrangements for testing, e.g. built-in self testing [BIST] or interconnection details
    • G11C29/44Indication or identification of errors, e.g. for repair
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/04Detection or location of defective memory elements, e.g. cell constructio details, timing of test signals
    • G11C29/08Functional testing, e.g. testing during refresh, power-on self testing [POST] or distributed testing
    • G11C29/12Built-in arrangements for testing, e.g. built-in self testing [BIST] or interconnection details
    • G11C29/18Address generation devices; Devices for accessing memories, e.g. details of addressing circuits
    • G11C29/30Accessing single arrays
    • G11C29/32Serial access; Scan testing
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • G11C29/04Detection or location of defective memory elements, e.g. cell constructio details, timing of test signals
    • G11C29/08Functional testing, e.g. testing during refresh, power-on self testing [POST] or distributed testing
    • G11C29/12Built-in arrangements for testing, e.g. built-in self testing [BIST] or interconnection details
    • G11C29/38Response verification devices
    • G11C29/42Response verification devices using error correcting codes [ECC] or parity check

Abstract

The invention discloses a bad block detection method, a bad block detection device, equipment and a storage medium of a nonvolatile memory, wherein the method comprises the following steps: when a bad block detection instruction is received, sequentially scanning a nonvolatile memory to be detected, and determining and recording a first bad block; longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block; and marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks. The method scans the nonvolatile memory to be detected in various modes, so that the nonvolatile memory can be detected more comprehensively, the problem of single scanning mode in the current method for detecting the bad blocks of the nonvolatile memory is solved, and the accuracy of bad block detection is improved.

Description

Bad block detection method, device, equipment and storage medium of nonvolatile memory
Technical Field
The present invention relates to the field of semiconductor memory technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting a bad block of a nonvolatile memory.
Background
With the development of informatization, people have higher and higher requirements on data storage equipment, and Nand flash (nonvolatile memory) is a widely used memory with high read-write speed, high capacity and low cost. Due to the problems of the structure and the manufacturing technology of the Nand flash, the Nand flash can generate bad blocks in the production and use processes, and the bad blocks can influence the storage of data. If the bad block is not identified before storage, the data storage is easy to be abnormal. The current bad block detection method has a single scanning mode, so that the accuracy of bad block identification is not high enough, and undetected bad blocks may exist in Nand flash.
Disclosure of Invention
The invention provides a bad block detection method, a bad block detection device, a bad block detection equipment and a bad block detection storage medium of a nonvolatile memory, and aims to improve the accuracy of bad block identification.
In order to achieve the above object, the present invention provides a bad block detection method of a nonvolatile memory, the method being applied to a bad block detection apparatus of a nonvolatile memory, the method comprising:
when a bad block detection instruction is received, scanning a nonvolatile memory to be detected, sequentially scanning, and determining and recording a first bad block;
longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block;
and marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks.
Optionally, the scanning, the sequentially scanning, and the determining and recording the first bad block of the nonvolatile memory to be detected includes:
reading and writing each page of each block of the nonvolatile memory to be detected one by one in a sequential scanning mode, and comparing read contents with written contents;
and marking the block where the page with the read content inconsistent with the written content is located as a bad block, and recording the information of the bad block.
Optionally, the step of longitudinally scanning the nonvolatile memory to be detected, and determining and recording the second bad block includes:
sequentially writing data into the first page of each block, and after the first pages of all the blocks are fully written, sequentially writing data into the second page of each block, and repeating the steps until each page of each block is fully written;
reading all data according to the data writing sequence, verifying the read data, marking the block where the data which does not pass the verification as a bad block, and recording the information of the bad block.
Optionally, the reading all the data according to the data writing sequence, verifying the read data, marking a block where the data that does not pass the verification is located as a bad block, and recording information of the bad block includes:
sequentially reading the data on the first page of each block, sequentially reading the data on the second page of each block after the first pages of all the blocks are read, and repeating the steps until the data in each page of each block are read;
and comparing the read data with the written data respectively, if the read data is inconsistent with the written data, marking the corresponding block as a bad block, and recording the physical position information of the bad block.
Optionally, the step of marking the first bad block and the second bad block as bad blocks and storing the information of the bad blocks further includes:
and counting the number of the bad blocks, and sending a risk prompt when the number of the bad blocks exceeds a preset bad block threshold value.
Optionally, the step of marking the first bad block and the second bad block as bad blocks and storing the information of the bad blocks further includes:
and verifying the nonvolatile memory to be detected through a correction algorithm, removing the bad block label of the correctable bad block, and determining the uncorrectable bad block as the bad block.
Optionally, the step of marking the first bad block and the second bad block as bad blocks and storing the information of the bad blocks further includes:
and mapping the position information of the bad block to a corresponding position of a reserved space of the nonvolatile memory so as to map the bad block to the idle position in the using process.
In order to achieve the above object, the present invention also provides a bad block detection apparatus for a nonvolatile memory, including:
the sequential scanning module is used for scanning the nonvolatile memory to be detected and performing sequential scanning when a bad block detection instruction is received, and determining and recording a first bad block;
the longitudinal scanning module is used for longitudinally scanning the nonvolatile memory to be detected and determining and recording a second bad block;
and the storage module is used for marking the first bad block and the second bad block as bad blocks and storing the information of the bad blocks.
Furthermore, in order to achieve the above object, the present invention also provides a bad block detection apparatus of a nonvolatile memory, including a memory, a processor, and a bad block detection program of the nonvolatile memory stored on the memory, where the bad block detection program of the nonvolatile memory, when executed by the processor, implements the steps of the method as described above:
in addition, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a bad block detection program of a nonvolatile memory, which when executed by a processor, implements the steps of the method as described above.
Compared with the prior art, the invention provides a bad block detection method, a bad block detection device and a bad block detection storage medium for a nonvolatile memory, wherein the method comprises the following steps: sequentially scanning the nonvolatile memory to be detected, and determining and recording a first bad block; longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block; and marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks. The method scans the nonvolatile memory to be detected in various modes, so that the nonvolatile memory can be detected more comprehensively, the problem of single scanning mode in the current method for detecting the bad blocks of the nonvolatile memory is solved, and the accuracy of bad block detection is improved.
Drawings
Fig. 1 is a hardware configuration diagram of a bad block detection apparatus of a nonvolatile memory according to embodiments of the present invention;
FIG. 2 is a flowchart illustrating a bad block detection method of a nonvolatile memory according to a first embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a Nand flash according to a first embodiment of the bad block detection method of the nonvolatile memory of the present invention;
FIG. 4 is a flowchart illustrating a bad block detection method for a non-volatile memory according to a second embodiment of the present invention;
FIG. 5 is a schematic diagram of check code generation according to a second embodiment of the bad block detection method for a nonvolatile memory of the present invention;
FIG. 6 is a flowchart illustrating a bad block detection method for a nonvolatile memory according to a third embodiment of the present invention;
FIG. 7 is a functional block diagram of a bad block detection apparatus of a nonvolatile memory according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The bad block detection device of the nonvolatile memory mainly related to the embodiment of the invention refers to an electronic device capable of reading and writing the nonvolatile memory, and the bad block detection device of the nonvolatile memory can be a computer, a server and the like.
Referring to fig. 1, fig. 1 is a hardware configuration diagram of a bad block detection apparatus of a nonvolatile memory according to embodiments of the present invention. In this embodiment of the present invention, the apparatus for detecting a bad block of a nonvolatile memory may include a processor 1001 (e.g., a Central Processing Unit, CPU), a communication bus 1002, an input port 1003, an output port 1004, and a memory 1005. The communication bus 1002 is used for realizing connection communication among the components; the input port 1003 is used for data input; the output port 1004 is used for data output, the memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a magnetic disk memory, and the memory 1005 may optionally be a storage device independent of the processor 1001. Those skilled in the art will appreciate that the hardware configuration depicted in FIG. 1 is not intended to be limiting of the present invention, and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
With continued reference to fig. 1, the memory 1005 of fig. 1, which is a readable storage medium, may include an operating system, a network communication module, an application program module, and a bad block detection program of a nonvolatile memory. In fig. 1, the network communication module is mainly used for connecting to a server and performing data communication with the server; and the processor 1001 is configured to call a bad block detection program of the nonvolatile memory stored in the memory 1005, and perform the following operations:
when a bad block detection instruction is received, scanning a nonvolatile memory to be detected, sequentially scanning, and determining and recording a first bad block;
longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block;
and marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks.
The nonvolatile memory referred to in this embodiment is mainly referred to as Nand flash memory. 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, is suitable for storing a large amount of data, and is widely applied in the industry, for example, embedded products comprise a digital camera, an MP3 walkman memory card, a small-sized U-disk and the like.
The first embodiment of the bad block method of the nonvolatile memory is provided based on the bad block device of the nonvolatile memory. Referring to fig. 2, fig. 2 is a flowchart illustrating a bad block method of a nonvolatile memory according to a first embodiment of the present invention.
As shown in fig. 1, a first embodiment of the present invention proposes a bad block detection method for a nonvolatile memory, the method being applied to a bad block device of the nonvolatile memory, the method including:
step S101, when a bad block detection instruction is received, scanning a nonvolatile memory to be detected, sequentially scanning the nonvolatile memory to be detected, and determining and recording a first bad block;
some bad blocks of the nonvolatile memory are generated in the manufacturing process, so that a defective block before production (initial block/invalid block) is generated, so that detection is needed before delivery, and a bad block detection instruction can be generated by arranging the nonvolatile memory to be detected on detection equipment before delivery. Some bad blocks are generated in the using process, so that in order to ensure the normal use of the nonvolatile memory, the bad block detection is also needed when the nonvolatile memory is maintained, and the bad block detection instruction in the case is generally triggered by a technician or an automatic detection program stored in the nonvolatile memory.
And when a bad block detection instruction is received, scanning the nonvolatile memory to be detected according to a preset sequential scanning mode. To explain the scanning mode related to this embodiment more clearly, refer to fig. 3 first, and fig. 3 is a schematic structural diagram of a Nand flash according to the first embodiment of the bad block detection method of a nonvolatile memory of the present invention. As shown in fig. 3, a memory size of 2112Mbits (i.e., 256 MB-2 Gb) has 2048 blocks each of 64 pages and 128K pages.
In this embodiment, each page of each block of the nonvolatile memory to be detected is read and written one by one in a sequential scanning manner. For better understanding, each block of the nonvolatile memory shown in fig. 3 is sequentially denoted as B1, B2, and B3.... No. B2048, and each page in B1 is sequentially denoted as B1P1, B1P2, and B1P3.. No. B1P 64; recording each page in B2 as B2P1, B2P2 and B2P3.... B2P64 in sequence; each page in B2048 is sequentially denoted as B2048P1, B2048P2, and B2048p3.. B2048P 64. As described above, the method of reading from and writing to the nonvolatile memory by the sequential scanning method of the present embodiment is as follows: for B1, data are written in sequence in the order of B1P1, B1P2, and B1P3...... B1P64, and after each page in B1 is written full, B2 is written full in the order of B2P1, B2P2, and B2P3.... B2P64, and so on, until all the pages in B2048 are written full. After the writing operation is completed, the data is sequentially read according to the same sequence, that is, B1P1, B1P2 and B1P3. After the data writing and reading operations are finished, comparing the data read from each position with the written data, and if the data read from each position are consistent with the written data, judging that the corresponding block is not a bad block; if the two blocks are not consistent, the corresponding block is judged to be a bad block (bad block). In this embodiment, the bad block screened out in the sequential scanning manner is determined as the first bad block.
Step S102, longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block;
in the step S101, some bad blocks may be detected by the sequential scanning method, but since data is sequentially written/read, when data comparison is performed after data is read, contents with inconsistent contents may be determined to be consistent due to various reasons, and therefore some bad blocks may be missed. If the non-volatile memory has undetected bad blocks, data loss and data omission may occur, which may result in loss to the user.
In order to comprehensively detect the nonvolatile memory and detect all bad blocks as much as possible, the nonvolatile memory to be detected is scanned in a longitudinal scanning mode on the basis of the sequential scanning.
Specifically, data is written into the first page of each block in sequence, after the first pages of all blocks are fully written, data is written into the second page of each block in sequence, and the steps are repeated until each page of each block is fully written. Referring to the block diagram shown in fig. 3, the sequence of the vertical scanning is: writing data on a first page (B1P1) on a first block, and then writing data on a first page (B2P1) on a second block, (B2048P1) on a 2048 th block, wherein after the first page of each block is fully written, the second page of each block is fully written according to the same sequence, and until the second page of each block is fully written, the data are fully written on the third page of each block in sequence, and the steps are repeated until all the pages of each block are fully written.
After the data writing is finished, reading all the data according to the data writing sequence, verifying the read data, marking the block where the data which does not pass the verification as a bad block, and recording the information of the bad block. Reading data on a first page (B1P1) on a first block, reading data on a first page (B2P1) on a second block, reading data on a first page (B2048P1) on a 2048 th block, repeatedly reading the data in the first page of each block, reading the data in the second page of each block according to the same sequence until the data in the second page of each block is read, and sequentially reading the data in a third page of each block.
And comparing the written data and the read data at the same position, if the written data and the read data on all pages in a certain block are consistent, determining the corresponding block as a non-bad block, and if the written data of one or more pages in the certain block is inconsistent with the read data, determining the corresponding block as a bad block. And determining the bad block detected in the longitudinal scanning mode as a second bad block.
Step S103, marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks.
And determining a union set of the first bad block and the second bad block, and only reserving one bad block for repeated bad blocks in the union set, namely determining all the bad blocks in the first bad block and the second bad block as detected bad blocks. And after the bad block is determined, storing the physical position information of the bad block into a reserved space of a nonvolatile memory for recording and managing the bad block.
It can be understood that, when the amount of the bad blocks is larger and larger, the effective storage space of the nonvolatile memory will be reduced, which also indicates that the stability of the nonvolatile memory is not good enough, and therefore, the storage of the data will be greatly affected.
In this embodiment, after the bad blocks in the nonvolatile memory are detected, the number of the bad blocks is counted, and when the number of the bad blocks exceeds a preset bad block threshold, a risk prompt is sent. The bad block threshold is specifically set according to actual needs. During factory inspection, when the number of the bad blocks exceeds a preset first bad block threshold value, it indicates that the to-be-inspected nonvolatile memory does not meet the factory requirements, and at this time, a risk prompt is sent out for related personnel to arrange the to-be-inspected nonvolatile memory to be returned to the factory for remanufacturing or discarding. In the using process, when the number of the bad blocks exceeds a preset second bad block threshold value, a risk prompt is sent after detection so that a user can know the current state of the nonvolatile memory to be detected, the user is reminded of timely replacing the nonvolatile memory to be detected, and important data are timely migrated so as to avoid loss.
According to the scheme, the nonvolatile memory to be detected is sequentially scanned, and a first bad block is determined and recorded; longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block; and marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks. The method scans the nonvolatile memory to be detected in various modes, so that the nonvolatile memory can be detected more comprehensively, the problem of single scanning mode in the current method for detecting the bad blocks of the nonvolatile memory is solved, and the accuracy of bad block detection is improved.
As shown in fig. 4, a second embodiment of the present invention provides a method for detecting a bad block of a nonvolatile memory, based on the first embodiment shown in fig. 1, where the step of marking the first bad block and the second bad block as bad blocks and storing information of the bad blocks further includes:
and step S104, verifying the nonvolatile memory to be detected through a correction algorithm, removing a bad block label of a correctable bad block, and determining an uncorrectable bad block as a bad block.
The Correction algorithm involved in the embodiment is ECC, which is called Error Checking and Correction throughout and is an Error detection and Correction algorithm for Nand flash. If there is no problem in operation timing and circuit stability, the Nand flash will not cause the whole Block or Page to be unable to read or to be error when it is error, but only one or a few bits in the whole Page (for example 512Bytes) will be error. The ECC can correct 1-bit errors and has a fast calculation speed, but cannot correct errors of more than 1 bit, and cannot detect errors of more than 2 bits.
In order to detect single bit errors, each 256 bytes of data is divided into an 8x256 table with 2048 bits in total, 22-bit check codes are used for checking, 16 bits are row check codes for transverse checking, and 6 bits are column check codes for longitudinal checking. Referring to fig. 5, fig. 5 is a schematic diagram illustrating the generation of check codes according to a second embodiment of the bad block detection method of the nonvolatile memory of the present invention. As shown in FIG. 5, CP0-CP5 are the results of the XOR operations of different bits of all bytes, respectively, and LP0-LP5 are the results of the XOR operations on all bits of the corresponding bytes. The 22-bit check code of ECC needs three bytes to be stored, the first two bytes store 16-bit row check codes LP0-LP 15, the third byte stores 6-bit column check codes CP0-CP5, and the rest is 2 position 1.
When Data is written into Nand Flash, the generated check code is stored in Spare Data Area of Flash. When Data is read out from Flash, a new ECC check code is generated, and the new check code and the old check code read out from the Spare Data Area are subjected to XOR operation, wherein the result of the XOR operation is 0, which indicates that the Data is correct; the result of the exclusive-or operation has 11 bits of 1 indicating that the data has a 1-bit error, which is a correctable error; the other result of the exclusive-or operation indicates that the data has more than 1 bit error, which cannot be corrected.
In this embodiment, bad blocks with an xor operation result of 0 and 11 bits of 1 are removed from the determined bad blocks, and the remaining bad blocks are determined as final bad blocks, so that the bad blocks with an incorrect scanning result are remedied on the basis of comprehensively searching the bad blocks, and the utilization rate of the nonvolatile memory to be detected can be improved.
As shown in fig. 6, a third embodiment of the present invention provides a method for detecting a bad block of a nonvolatile memory, based on the first embodiment shown in fig. 2, after the steps of marking the first bad block and the second bad block as bad blocks and storing information of the bad blocks, the method further includes:
step S105, mapping the position information of the bad block to a corresponding position of a reserved space of the nonvolatile memory, so as to map the bad block to the idle position in the using process.
In order to realize dynamic replacement of bad blocks, a certain reserved space is set in the volatile memory in advance, and the reserved space of the nonvolatile memory comprises 4 types of blocks: spare good blocks, bad blocks, mapped blocks, blocks storing mapping tables. In this embodiment, the mapping table includes a location of a bad block and a location of a mapped block in the reserved space for replacing the bad block. Thus, when data is written into the bad block, the mapped block of the bad block is inquired from the mapping table, and the data is written into the mapped block. In this way, an orderly management of data can also be achieved.
It can be understood that after the volatile memory to be detected is detected in the using process, some bad blocks are newly added, and at this time, the mapping table needs to be updated to ensure stable use of the volatile memory.
By means of the scheme, after the bad block is determined, the bad block is mapped to the corresponding position in the reserved space, ordered writing and reading of data can be guaranteed, negative effects of the bad block on data storage are reduced, and ordered management of the data is achieved.
Further, to achieve the above object, the present invention further provides a bad block detection apparatus for a nonvolatile memory, specifically, referring to fig. 7, fig. 7 is a functional block diagram of a first embodiment of the bad block detection apparatus for a nonvolatile memory of the present invention, where the apparatus includes:
the sequential scanning module 10 is configured to, when receiving a bad block detection instruction, scan the nonvolatile memory to be detected, perform sequential scanning, and determine and record a first bad block;
the longitudinal scanning module 20 is configured to longitudinally scan the to-be-detected nonvolatile memory, and determine and record a second bad block;
and the storage module 30 is configured to mark the first bad block and the second bad block as bad blocks, and store information of the bad blocks.
Further, the sequential scanning module includes:
the sequential scanning unit is used for reading and writing each page of each block of the nonvolatile memory to be detected one by one in a sequential scanning mode and comparing read contents with written contents;
a first recording unit, configured to mark a block in which a page whose read content and write content are inconsistent is located as a bad block, and record information of the bad block
Further, the longitudinal scanning module includes:
the writing unit is used for writing data into the first page of each block in sequence, writing data into the second page of each block in sequence after the first pages of all blocks are fully written, and repeating the steps until each page of each block is fully written;
and the reading unit is used for reading all the data according to the data writing sequence, verifying the read data, marking the block where the data which does not pass the verification as a bad block, and recording the information of the bad block.
Further, the reading unit includes:
the reading subunit is used for sequentially reading the data on the first page of each block, sequentially reading the data on the second page of each block after the first pages of all the blocks are read, and repeating the steps until the data in each page of each block are read;
a recording subunit, configured to compare the read data with the written data, and if the read data is inconsistent with the written data, mark the corresponding block as a bad block and record physical location information of the bad block
Further, the recording module further comprises:
and the counting unit is used for counting the number of the bad blocks and sending out a risk prompt when the number of the bad blocks exceeds a preset bad block threshold value.
Further, the recording module further comprises:
and verifying the nonvolatile memory to be detected through a correction algorithm, removing the bad block label of the correctable bad block, and determining the uncorrectable bad block as the bad block.
Further, the recording module further comprises:
and mapping the position information of the bad block to a corresponding position of a reserved space of the nonvolatile memory so as to map the bad block to the idle position in the using process.
In addition, the present invention further provides a computer-readable storage medium, where a bad block detection program of a nonvolatile memory is stored in the computer-readable storage medium, and when the bad block detection program of the nonvolatile memory is executed by a processor, the steps of the method for detecting a bad block of the nonvolatile memory are implemented, which are not described herein again.
Compared with the prior art, the invention provides a bad block detection method, a bad block detection device, equipment and a storage medium of a nonvolatile memory, wherein the method comprises the following steps: when a bad block detection instruction is received, sequentially scanning a nonvolatile memory to be detected, and determining and recording a first bad block; longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block; and marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks. The method scans the nonvolatile memory to be detected in multiple modes, so that the nonvolatile memory can be detected more comprehensively, the problem of single scanning mode in the conventional bad block detection method of the nonvolatile memory is solved, and the accuracy of bad block detection is improved
The above description is only for the preferred embodiment of the present invention and is not intended to limit the scope of the present invention, and all equivalent structures or flow transformations made by the present specification and drawings, or applied directly or indirectly to other related arts, are included in the scope of the present invention.

Claims (10)

1. A bad block detection method of a nonvolatile memory, the method is applied to a bad block detection device of the nonvolatile memory, and the method comprises the following steps:
when a bad block detection instruction is received, scanning a nonvolatile memory to be detected, sequentially scanning, and determining and recording a first bad block;
longitudinally scanning the nonvolatile memory to be detected, and determining and recording a second bad block;
and marking the first bad block and the second bad block as bad blocks, and storing the information of the bad blocks.
2. The method of claim 1, wherein the step of scanning the nonvolatile memory to be detected sequentially to determine and record the first bad block comprises:
reading and writing each page of each block of the nonvolatile memory to be detected one by one in a sequential scanning mode, and comparing read contents with written contents;
and marking the block where the page with the read content inconsistent with the written content is located as a bad block, and recording the information of the bad block.
3. The method of claim 1, wherein the step of scanning the nonvolatile memory to be detected longitudinally, and determining and recording the second bad block comprises:
sequentially writing data into the first page of each block, and after the first pages of all the blocks are fully written, sequentially writing data into the second page of each block, and repeating the steps until each page of each block is fully written;
reading all data according to the data writing sequence, verifying the read data, marking the block where the data which does not pass the verification as a bad block, and recording the information of the bad block.
4. The method according to claim 3, wherein the steps of reading all data in the order of data writing, checking the read data, marking a block in which the data that fails to pass the check is located as a bad block, and recording information of the bad block include:
sequentially reading the data on the first page of each block, sequentially reading the data on the second page of each block after the first pages of all the blocks are read, and repeating the steps until the data in each page of each block are read;
and comparing the read data with the written data respectively, if the read data is inconsistent with the written data, marking the corresponding block as a bad block, and recording the physical position information of the bad block.
5. The method of claim 1, wherein the step of marking the first bad block and the second bad block as bad blocks and storing information of the bad blocks further comprises:
and counting the number of the bad blocks, and sending a risk prompt when the number of the bad blocks exceeds a preset bad block threshold value.
6. The method of claim 1, wherein the step of marking the first bad block and the second bad block as bad blocks and storing information of the bad blocks further comprises:
and verifying the nonvolatile memory to be detected through a correction algorithm, removing correctable bad block labels, and determining uncorrectable bad blocks as bad blocks.
7. The method of any of claims 1-6, wherein the step of marking the first bad block and the second bad block as bad blocks and storing information of the bad blocks is followed by further comprising:
and mapping the position information of the bad block to a corresponding position of a reserved space of the nonvolatile memory so as to map the bad block to the idle position in the using process.
8. A bad block detection apparatus of a nonvolatile memory, comprising:
the sequential scanning module is used for scanning the nonvolatile memory to be detected and performing sequential scanning when a bad block detection instruction is received, and determining and recording a first bad block;
the longitudinal scanning module is used for longitudinally scanning the nonvolatile memory to be detected and determining and recording a second bad block;
and the storage module is used for marking the first bad block and the second bad block as bad blocks and storing the information of the bad blocks.
9. A bad block detection device of a non-volatile memory, comprising a memory, a processor and a bad block detection program of a non-volatile memory stored on the memory, the bad block detection program of the non-volatile memory being executed by the processor for implementing the steps of the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a bad block detection program of a non-volatile memory, which when executed by a processor, performs the steps of the method of any of claims 1-7.
CN202111386658.7A 2021-11-22 2021-11-22 Bad block detection method, device, equipment and storage medium of nonvolatile memory Pending CN114203252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111386658.7A CN114203252A (en) 2021-11-22 2021-11-22 Bad block detection method, device, equipment and storage medium of nonvolatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111386658.7A CN114203252A (en) 2021-11-22 2021-11-22 Bad block detection method, device, equipment and storage medium of nonvolatile memory

Publications (1)

Publication Number Publication Date
CN114203252A true CN114203252A (en) 2022-03-18

Family

ID=80648227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111386658.7A Pending CN114203252A (en) 2021-11-22 2021-11-22 Bad block detection method, device, equipment and storage medium of nonvolatile memory

Country Status (1)

Country Link
CN (1) CN114203252A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115629719A (en) * 2022-12-19 2023-01-20 合肥康芯威存储技术有限公司 Storage device and control method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115629719A (en) * 2022-12-19 2023-01-20 合肥康芯威存储技术有限公司 Storage device and control method thereof

Similar Documents

Publication Publication Date Title
US8060688B2 (en) Method and device for reconfiguration of reliability data in flash EEPROM storage pages
US8732519B2 (en) Method for using bad blocks of flash memory
US8560925B2 (en) System and method for handling bad bit errors
US10635527B2 (en) Method for processing data stored in a memory device and a data storage device utilizing the same
US7979737B2 (en) Method for accessing a Flash memory, and associated memory device and controller thereof
TWI512742B (en) Non-volatile memory flash memory erase-abnormal block repair method and device applying the same
US20140115416A1 (en) Non-volatile memory error correction
CN102904685B (en) A kind of processing method of hardware table item check errors and device
CN108647111A (en) Read control device, reading and control method thereof and Memory Controller for memory
CN104282342A (en) Flash memory device, memory controller and control method of flash memory
US9754682B2 (en) Implementing enhanced performance with read before write to phase change memory
CN111104246A (en) Method and device for improving verification efficiency of DRAM error detection and correction, computer equipment and storage medium
US9043675B2 (en) Storage device
CN111078462B (en) Data verification method and circuit
US20090164869A1 (en) Memory architecture and configuration method thereof
CN114203252A (en) Bad block detection method, device, equipment and storage medium of nonvolatile memory
US11231990B2 (en) Device and method for generating error correction information
JP2004342112A (en) Device and method for responding to data retention loss in nonvolatile memory unit using error-checking and correction techniques
KR20050064887A (en) Flash memory having enhanced error detection capability and method for detecting multi-bit errors
CN114637469A (en) Data read-write method, system, medium and equipment of Flash memory
US9880926B1 (en) Log structured reserved zone for a data storage device
US20170346505A1 (en) Circuits and methods for writing and reading data
US9436547B2 (en) Data storing method, memory control circuit unit and memory storage device
CN114267402B (en) Bad storage unit testing method, device, equipment and storage medium of flash memory
CN112162935B (en) Data processing method and device of storage chip, computer equipment and storage medium

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