[go: up one dir, main page]

CN114566203B - Flash rapid detection device and method - Google Patents

Flash rapid detection device and method Download PDF

Info

Publication number
CN114566203B
CN114566203B CN202210155645.7A CN202210155645A CN114566203B CN 114566203 B CN114566203 B CN 114566203B CN 202210155645 A CN202210155645 A CN 202210155645A CN 114566203 B CN114566203 B CN 114566203B
Authority
CN
China
Prior art keywords
error
area
enable signal
detection
module
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.)
Expired - Fee Related
Application number
CN202210155645.7A
Other languages
Chinese (zh)
Other versions
CN114566203A (en
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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN202210155645.7A priority Critical patent/CN114566203B/en
Publication of CN114566203A publication Critical patent/CN114566203A/en
Application granted granted Critical
Publication of CN114566203B publication Critical patent/CN114566203B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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/10Test algorithms, e.g. memory scan [MScan] algorithms; Test patterns, e.g. checkerboard patterns 
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本发明公开了一种Flash的快速检测装置及方法,其装置包括:纠错模块,在数据读写时识别错误位置信息;计时模块,根据设定的周期间隔发出时间使能信号;统计模块,根据错误位置信息统计各区域的错误计数,当时间使能信号和空闲使能信号同时存在时,定位具有最大计数的区域作为目标区域并将时间使能信号消除以及将各区域的计数清零;错误检测模块,将目标区域的数据进行备份以及备份后对目标区域进行检测,当即将恢复读取操作时,暂停检测且保留备份数据、保存检测进度并在下次出现空闲使能信号时继续对上一未检测完毕的目标区域检测,直至当前目标区域检测结束后获取新的目标区域进行检测,由此实现频率可调的局部检测,提高检测效率。

Figure 202210155645

The invention discloses a fast detection device and method for Flash. The device includes: an error correction module, which identifies error position information when reading and writing data; a timing module, which sends a time enable signal according to a set period interval; a statistics module, Count the error counts of each area according to the error position information, and when the time enable signal and the idle enable signal exist at the same time, locate the area with the largest count as the target area and eliminate the time enable signal and clear the counts of each area; The error detection module backs up the data in the target area and detects the target area after the backup. When the read operation is about to be resumed, the detection is suspended and the backup data is kept, the detection progress is saved, and the next time the idle enable signal appears, continue to check the target area. 1. Detection of the target area that has not been detected until the detection of the current target area is completed and a new target area is obtained for detection, thereby realizing local detection with adjustable frequency and improving detection efficiency.

Figure 202210155645

Description

一种Flash的快速检测装置及方法A fast detection device and method for Flash

技术领域technical field

本发明属于存储技术领域,更具体地,涉及一种Flash的快速检测装置及方法。The invention belongs to the field of storage technology, and more specifically relates to a fast detection device and method for Flash.

背景技术Background technique

随着集成电路技术的发展,Flash存储模块作为一种长寿命的非易失性存储模块,具有体积小,容量大速度快得特点,Flash存储模块在存储模块设备占据的份额在逐年增加。With the development of integrated circuit technology, Flash storage module, as a long-life non-volatile storage module, has the characteristics of small size, large capacity and fast speed. The share of Flash storage module in storage module equipment is increasing year by year.

随着工艺的不断进步,Flash存储模块的密度和复杂程度也在不断提高,从而使得Flash存储模块存在缺陷的可能也越来越大,出厂时的检测可以纠正明显的缺陷,而部分隐藏的缺陷会在频繁的擦写中出现,从而导致存储的数据出现问题。虽然多层Flash具有存储容量和价格的高性价比,但是其可靠性在不断降低,主要体现在重复使用后错误率升高,寿命降低等方面。如果不进行检测,很快错误率会达到纠错上限,从而影响存储模块的正常工作,使得存储模块的性能下降。现行的检测技术大多是全面检测,这种方式在出厂后会占用大量存储模块的资源,检测效率不高。With the continuous progress of the technology, the density and complexity of the Flash memory module are also increasing, so that the possibility of defects in the Flash memory module is also increasing. The inspection at the factory can correct the obvious defects, and some hidden defects It will appear in frequent erasing and writing, which will cause problems with the stored data. Although multi-layer Flash has high cost performance in terms of storage capacity and price, its reliability is constantly decreasing, which is mainly reflected in the increase in error rate and shortened lifespan after repeated use. If no detection is performed, the error rate will soon reach the upper limit of error correction, thereby affecting the normal operation of the storage module and degrading the performance of the storage module. Most of the current detection technologies are comprehensive detection. This method will occupy a large amount of resources of the storage module after leaving the factory, and the detection efficiency is not high.

发明内容Contents of the invention

针对现有技术的以上缺陷或改进需求,本发明提供了一种Flash的快速检测装置及方法,其目的在于提高检测效率。In view of the above defects or improvement needs of the prior art, the present invention provides a fast detection device and method for Flash, the purpose of which is to improve the detection efficiency.

为实现上述目的,按照本发明的一个方面,提供了一种Flash的快速检测装置,包括:In order to achieve the above object, according to one aspect of the present invention, a kind of fast detection device of Flash is provided, comprising:

纠错模块,用于在数据读写期间识别传输信息的错误位置信息;An error correction module is used to identify the error position information of the transmitted information during data reading and writing;

计时模块,用于计时并根据设定的周期间隔发出时间使能信号;A timing module is used for timing and sending a time enable signal according to a set cycle interval;

统计模块,用于根据纠错模块反馈的错误位置信息统计各区域的错误计数,并当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域发送给错误检测模块后将时间使能信号消除以及将各区域的计数清零;The statistical module is used to count the error counts of each area according to the error position information fed back by the error correction module, and when the time enable signal and the idle enable signal indicating that the Flash data reading stops exist at the same time, compare the counts of each area, and After the area with the maximum count is sent to the error detection module as the target area, the time enable signal is eliminated and the counts of each area are cleared;

错误检测模块,用于当出现空闲使能信号时将目标区域的数据进行备份以及备份后对目标区域进行检测,当即将执行Flash数据读取操作时,暂停检测且保留备份数据、保存检测进度并在下次出现空闲使能信号时继续对上一未检测完毕的目标区域检测,直至当前目标区域检测结束后获取新的目标区域进行检测。The error detection module is used for backing up the data of the target area and detecting the target area after the backup when an idle enable signal occurs, and when the Flash data read operation is about to be performed, the detection is suspended and the backup data is retained, the detection progress is saved, and When the idle enable signal appears next time, continue to detect the target area that has not been detected until the detection of the current target area is completed and obtain a new target area for detection.

在其中一个实施例中,所述统计模块包括地址计算模块、错误计数寄存模块和最大值检测模块,其中,In one of the embodiments, the statistics module includes an address calculation module, an error count registration module and a maximum value detection module, wherein,

所述地址计算模块用于根据错误位置信息err_info计算错误发生的地址,并通过addr_num信息将地址传输给错误计数寄存模块;The address calculation module is used to calculate the address where the error occurs according to the error location information err_info, and transmit the address to the error count registration module through the addr_num information;

所述错误计数寄存模块用于接收addr_num信息且每次接收到addr_num信息后,增加相应地址区域的计数;The error count registration module is used to receive the addr_num information and increase the count of the corresponding address area after receiving the addr_num information each time;

最大值检测模块用于获取时间使能信号和空闲使能信号,并当时间使能信号和空闲使能信号同时存在时,比较各区域的错误计数,并以具有最大计数的区域作为目标区域发送给错误检测模块、同时将时间使能信号消除以及将所述错误计数寄存器中各区域的计数清零。The maximum value detection module is used to obtain the time enable signal and the idle enable signal, and when the time enable signal and the idle enable signal exist at the same time, compare the error counts of each area, and send the area with the maximum count as the target area to the error detection module, and at the same time, the time enable signal is eliminated and the counts of each area in the error count register are cleared.

在其中一个实施例中,所述错误检测模块在当前目标区域检测完毕后向所述最大值检测模块返回dect_end信号,所述最大值检测模块发送上一目标区域后,判断是否接收到dect_end信号,若接收到,则选定下一目标区域并继续发送,若未接收到,则不进行工作。In one of the embodiments, the error detection module returns a dect_end signal to the maximum value detection module after the detection of the current target area is completed, and the maximum value detection module determines whether the dect_end signal is received after sending the previous target area, If received, then select the next target area and continue to send, if not received, then do not work.

在其中一个实施例中,所述纠错模块包括BCH译码器,所述BCH译码器包括校正子计算模块、错误多项式计算模块和钱搜索模块,其中,In one of the embodiments, the error correction module includes a BCH decoder, and the BCH decoder includes a syndrome calculation module, an error polynomial calculation module and a money search module, wherein,

所述校正子计算模块识别数据传输的错误并当出现错误时发出err_en使能信号;The syndrome calculation module identifies an error in data transmission and sends an err_en enable signal when an error occurs;

所述钱搜索模块依次计算出错误位置并每当得到一个错误位置时发出一个相应的err_info信息,每个err_info信息包括对应错误发生的位置;The money search module calculates the error position in turn and sends a corresponding err_info information whenever an error position is obtained, and each err_info information includes the position where the corresponding error occurs;

所述统计模块在接收到err_en使能信号后启动统计并根据err_info信息对相应区域的错误计数进行累加。The statistics module starts statistics after receiving the err_en enable signal and accumulates the error counts in the corresponding area according to the err_info information.

在其中一个实施例中,进入纠错模块的信息格式包括数据码、校验码、错误标识位和错误信息,信息格式中的错误信息与数据码长度相同;纠错模块用于当识别到数据读取存在错误时,在错误标识位生成错误标志,且使错误信息中对应位置的电平发生翻转;纠错模块还用于在纠错后截取校验码、错误标识和错误信息,当出现错误标识时发出err_en使能信号,并通过err_info信息将截取的错误信息发送给统计模块;In one of the embodiments, the information format entering the error correction module includes data code, check code, error identification bit and error information, and the error information in the information format is the same as the length of the data code; the error correction module is used to identify the data When there is an error in reading, an error flag is generated at the error flag, and the level of the corresponding position in the error information is flipped; the error correction module is also used to intercept the check code, error flag, and error information after error correction. Send the err_en enable signal when the error is identified, and send the intercepted error information to the statistics module through the err_info information;

所述统计模块在接收到err_en使能信号后启动统计并根据err_info信息对相应区域的错误计数进行累加。The statistics module starts statistics after receiving the err_en enable signal and accumulates the error counts in the corresponding area according to the err_info information.

在其中一个实施例中,进入纠错模块错误信息为全0字符,错误信息中各字符的位置与数据码中对应字符的位置相同,当纠错模块所截取的错误信息中存在字符1,表示数据码在当前位置存在错误。In one of the embodiments, the error information entering the error correction module is all 0 characters, and the position of each character in the error information is the same as the position of the corresponding character in the data code. When there is a character 1 in the error information intercepted by the error correction module, it means There is an error in the data code at the current position.

在其中一个实施例中,所述错误检测模块包括备份区,所述备份区包括备份数据区、具有外置接口的区块信息区和具有外置结构的检测进度区其中,In one of the embodiments, the error detection module includes a backup area, and the backup area includes a backup data area, a block information area with an external interface, and a detection progress area with an external structure.

所述错误检测模块用于将接收到的目标区域的地址、对目标区域所检测到的错误计数据信息保存于所述区块信息区中,所述区块信息区通过对应的外置接口传输错误计数据信息;The error detection module is used to save the received address of the target area and the detected error count data information of the target area in the block information area, and the block information area is transmitted through a corresponding external interface error meter data information;

所述检测进度区用于保存检测算法,所述检测进度区的外置接口用于修改内部的检测算法,所述错误检测模块用于将目标区域的数据备份至所述备份数据区后调取所述检测进度区的检测算法对所述目标区域进行检测,并在检测中断时在检测进度区内保存检测进度以在下次检测时根据所述检测进度恢复检测。The detection progress area is used to save the detection algorithm, the external interface of the detection progress area is used to modify the internal detection algorithm, and the error detection module is used to backup the data in the target area to the backup data area and then call The detection algorithm in the detection progress area detects the target area, and saves the detection progress in the detection progress area when the detection is interrupted, so as to resume detection according to the detection progress in the next detection.

在其中一个实施例中,所述计时模块包括页区计时子模块和扇区计时子模块,所述时间使能信号包括页区使能信号和扇区使能信号,所述页区计时子模块用于根据页区周期间隔发出页区使能信号,所述扇区计时子模块用于根据扇区周期间隔发出扇区使能信号,其中,扇区周期间隔大于页区周期间隔;In one of the embodiments, the timing module includes a page area timing submodule and a sector timing submodule, the time enable signal includes a page area enable signal and a sector enable signal, and the page area timing submodule It is used to send a page area enable signal according to a page area cycle interval, and the sector timing submodule is used to send a sector enable signal according to a sector cycle interval, wherein the sector cycle interval is greater than the page area cycle interval;

当仅出现页区使能信号时,扇区持续进行计数,以具有最大错误计数的页区作为目标区域并清零页区的计数以及消除页区使能信号;When only the page area enable signal occurs, the sector continues to count, and the page area with the largest error count is used as the target area, and the count of the page area is cleared and the page area enable signal is eliminated;

当出现扇区使能信号时,以具有最大错误计数的扇区作为目标区域并同时清零扇区和页区的计数以及消除页区使能信号和扇区使能信号。When the sector enable signal occurs, the sector with the largest error count is taken as the target area, and the counts of the sector and the page area are cleared and the page area enable signal and the sector enable signal are eliminated at the same time.

按照本发明的另一方面,提供了一种Flash的快速检测方法,包括:According to another aspect of the present invention, a kind of fast detection method of Flash is provided, comprising:

设定周期间隔,计时并根据设定的周期间隔发出时间使能信号;Set the cycle interval, time and send a time enable signal according to the set cycle interval;

在计时期间获取数据读写时传输信息的错误位置信息;Obtain the error position information of the transmitted information when the data is read and written during the timing period;

根据所述错误位置信息统计各区域的错误计数,并当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域后将时间使能信号消除以及将各区域的计数清零;According to the error location information, the error counts of each area are counted, and when the time enable signal and the idle enable signal indicating that the Flash data reading stops exist at the same time, the counts of each area are compared, and the area with the largest count is used as the target After the area, the time enable signal is eliminated and the count of each area is cleared;

当出现空闲使能信号时将目标区域的数据进行备份以及备份后对目标区域进行检测,当即将执行Flash数据读取操作时,暂停检测且保留备份数据、保存检测进度并在下次出现空闲使能信号时继续对上一未检测完毕的目标区域检测,直至当前目标区域检测结束后获取新的目标区域进行检测。When the idle enable signal appears, the data in the target area is backed up and the target area is detected after the backup. When the Flash data read operation is about to be performed, the detection is suspended and the backup data is kept, the detection progress is saved, and the next time the idle enable occurs When the signal is signaled, continue to detect the last target area that has not been detected until the current target area detection is completed and a new target area is obtained for detection.

在其中一个实施例中,In one of these embodiments,

设定周期间隔,计时并根据设定的周期间隔发出时间使能信号,包括:Set the cycle interval, timing and send time enable signal according to the set cycle interval, including:

设定页区周期间隔和扇区周期间隔,对页区和扇区分别计时,一旦达到页区周期间隔时发出页区使能信号,一旦达到扇区周期间隔时发出扇区使能信号;Set the page area cycle interval and the sector cycle interval, time the page area and the sector separately, once the page area cycle interval is reached, the page area enable signal is sent, and once the sector cycle interval is reached, the sector enable signal is sent;

当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域后将时间使能信号消除以及将各区域的计数清零,包括:When the time enable signal and the idle enable signal indicating that the Flash data read stop exist at the same time, compare the counts of each area, and take the area with the largest count as the target area, then cancel the time enable signal and count the counts of each area Clear, including:

当仅出现页区使能信号时,扇区持续进行计数,以具有最大错误计数的页区作为目标区域并清零页区的计数以及消除页区使能信号;When only the page area enable signal occurs, the sector continues to count, and the page area with the largest error count is used as the target area, and the count of the page area is cleared and the page area enable signal is eliminated;

当出现扇区使能信号时,以具有最大错误计数的扇区作为目标区域并同时清零扇区和页区的计数以及消除页区使能信号和扇区使能信号。When the sector enable signal occurs, the sector with the largest error count is taken as the target area, and the counts of the sector and the page area are cleared and the page area enable signal and the sector enable signal are eliminated at the same time.

总体而言,通过本发明所构思的以上技术方案与现有技术相比,能够取得下列有益效果:Generally speaking, compared with the prior art, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

本申请利用Flash内部自带的纠错模块识别读取数据中发生错误的位置信息,以对各区域的错误进行累计,通过预设周期间隔,在Flash运行期间进行计时并按照该周期间隔发出时间使能信号,当接收到时间使能信号时,说明当前周期已经结束,即将进入下一周期,此时,一旦获取到Flash停止读取的空闲信号时,则比较各区域的错误计数并以具有最大错误计数的区域作为目标区域进行局部检测,利用局部检测代替传统的全面检测以提高检测效率。This application uses the built-in error correction module of Flash to identify the position information of the error in the read data to accumulate the errors in each area. Through the preset cycle interval, time is counted during the operation of Flash and the time is issued according to the cycle interval. Enable signal, when the time enable signal is received, it indicates that the current cycle has ended and is about to enter the next cycle. At this time, once the idle signal that Flash stops reading is obtained, the error count of each area is compared and the The area with the largest error count is used as the target area for local detection, and the local detection is used to replace the traditional comprehensive detection to improve the detection efficiency.

本申请可以通过设定周期间隔调节错误检测的频率,周期间隔越长,错误检测的频率越低,周期间隔越短,错误检测的频率越高。由此可以根据Flash的性能和状态调节检测频率,若是Flash的数据读取错误率较大,则可以增大检测频率以及时发现问题,若是Flash的数据读取错误率较小,则可以减小检测频率以降低损耗。同时,本申请中,在确定当前目标区域后及时消除时间使能信号并清零错误计数,可以开始下一周期的统计,确定新的目标区域并进行检测,保证检测周期的持续进行。In the present application, the frequency of error detection can be adjusted by setting the cycle interval. The longer the cycle interval is, the lower the error detection frequency is, and the shorter the cycle interval is, the higher the error detection frequency is. Therefore, the detection frequency can be adjusted according to the performance and state of the Flash. If the data reading error rate of the Flash is large, the detection frequency can be increased to detect problems in time. If the data reading error rate of the Flash is small, the detection frequency can be reduced. Detect frequency to reduce loss. At the same time, in this application, after the current target area is determined, the time enable signal is promptly eliminated and the error count is cleared, and the statistics of the next cycle can be started, and a new target area can be determined and detected to ensure the continuation of the detection cycle.

本申请在检测过程期间,若是Flash需执行数据读取而中断正在执行的错误检测过程,则保留备份且保存检测进度,当下一个空闲时根据检测进行恢复检测,避免对已检测的部分重复检测,进一步提高检测效率。During the detection process of this application, if the Flash needs to perform data reading and interrupt the error detection process being executed, then keep the backup and save the detection progress, and resume detection according to the detection when the next idle time, avoiding repeated detection of the detected part, Further improve detection efficiency.

附图说明Description of drawings

图1是本申请一实施例中的Flash的快速检测装置的结构框图;Fig. 1 is the structural block diagram of the fast detection device of the Flash in an embodiment of the present application;

图2是本申请一实施例中的Flash的快速检测装置的具体结构图;Fig. 2 is the specific structural diagram of the rapid detection device of the Flash in an embodiment of the present application;

图3是本申请一实施例中的触发比较操作的时序图;FIG. 3 is a timing diagram of a trigger comparison operation in an embodiment of the present application;

图4是本申请一实施例中的Flash数据读取的信息格式;Fig. 4 is the information format of the Flash data read in one embodiment of the present application;

图5是本申请一实施例中的通过错误信息标记错误位置的示意图;Fig. 5 is a schematic diagram of marking an error location by error information in an embodiment of the present application;

图6是本申请一实施例中的以设定信息格式的方式进行检测的流程图;Fig. 6 is a flow chart of detecting by setting the information format in an embodiment of the present application;

图7是本申请一实施例中的备份区的结构图;Fig. 7 is a structural diagram of a backup area in an embodiment of the present application;

图8是本申请一实施例中的Flash的快速检测方法的步骤流程图。FIG. 8 is a flow chart of the steps of the fast detection method for Flash in an embodiment of the present application.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not constitute a conflict with each other.

如图1所示,Flash的快速检测装置包括纠错模块、计时模块、统计模块和错误检测模块。As shown in Figure 1, the fast detection device of Flash includes an error correction module, a timing module, a statistics module and an error detection module.

其中,纠错模块为Flash内部自带的模块,在对Flash进行数据读取时,通过纠错模块识别并纠正数据读取期间传输信息的错误。当Flash停止数据读取时,主控制器会发出空闲使能信号free_en。在本申请中,错误模块在工作期间将识别到的错误位置信息err_info传送给统计模块。Wherein, the error correction module is a built-in module in the Flash, and when reading data from the Flash, the error correction module identifies and corrects errors in the transmission information during data reading. When the Flash stops reading data, the main controller will send an idle enable signal free_en. In this application, the error module transmits the identified error location information err_info to the statistics module during operation.

其中,计时模块用于计时,并当达到设定的周期间隔时向统计模块发送时间使能信号time,根据需要设定周期间隔为Δt,每隔Δt发送一次时间使能信号time。具体的,计时模块可以通过程序控制,也可以利用内置时钟电路完成。Wherein, the timing module is used for timing, and sends the time enabling signal time to the statistics module when the set cycle interval is reached, sets the cycle interval as Δt as required, and sends the time enabling signal time every Δt. Specifically, the timing module can be controlled by a program, or can be completed by using a built-in clock circuit.

其中,统计模块具有累加和比较两个功能,累加就是根据错误位置信息err_info统计各区域的错误计数,当持续接收到多个错误位置信息err_info时,对相应区域的计数进行累加。当统计模块接收到时间使能信号和空间信号时,启动比较操作,即,当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域发送给错误检测模块。随后将时间使能信号消除以及将各区域的计数清零,由此可以执行下一周期的计数和目标区域的定位。Among them, the statistical module has two functions of accumulation and comparison. Accumulation is to count the error counts of each area according to the error location information err_info. When multiple error location information err_info are continuously received, the counts of the corresponding areas are accumulated. When the statistical module receives the time enable signal and the space signal, it starts the comparison operation, that is, when the time enable signal and the idle enable signal indicating that the Flash data reading stops exist at the same time, compare the counts of each area, and use The area with the maximum count is sent to the error detection module as the target area. Then the time enable signal is removed and the counts of each area are cleared, so that the counting of the next cycle and the positioning of the target area can be performed.

其中,当错误检测模块获取到新的目标区域地址后,在Flash数据读取空闲阶段启动错误检测工作。具体的,当出现空闲使能信号free_en时,将目标区域的数据进行备份以及备份后对目标区域进行检测;当即将执行Flash数据读取操作时,暂停检测且保留备份数据、保存检测进度,并在下次出现空闲使能信号时继续对上一未检测完毕的目标区域检测,直至当前目标区域检测结束后获取新的目标区域进行检测。Among them, after the error detection module obtains the new target area address, it starts the error detection work in the idle stage of Flash data reading. Specifically, when the idle enable signal free_en occurs, the data in the target area is backed up and the target area is detected after the backup; when the Flash data read operation is about to be performed, the detection is suspended and the backup data is kept, the detection progress is saved, and When the idle enable signal appears next time, continue to detect the target area that has not been detected until the detection of the current target area is completed and obtain a new target area for detection.

本申请利用Flash内部自带的纠错模块识别读取数据中发生错误的位置信息,以对各区域的错误进行累计。通过预设周期间隔,在Flash运行期间进行计时并按照该周期间隔发出时间使能信号,当接收到时间使能信号时,说明当前周期已经结束,即将进入下一周期。此时,一旦获取到Flash停止读取的空闲信号时,则比较各区域的错误计数并以具有最大错误计数的区域作为目标区域进行局部检测,利用局部检测代替传统的全面检测以提高检测效率。本申请可以通过设定周期间隔调节错误检测的频率,周期间隔越长,错误检测的频率越低,周期间隔越短,错误检测的频率越高。由此可以根据Flash的性能和状态调节检测频率。若是Flash的数据读取错误率较大,则可以增大检测频率以及时发现问题,若是Flash的数据读取错误率较小,则可以减小检测频率以降低损耗。同时,本申请中,在确定当前目标区域后及时消除时间使能信号并清零错误计数,可以开始下一周期的统计,确定新的目标区域并进行检测,保证检测周期的持续进行。本申请在检测过程期间,若是Flash需执行数据读取而中断正在执行的错误检测过程,则保留备份且保存检测进度,当下一个空闲时根据检测进行恢复检测,避免对已检测的部分重复检测,进一步提高检测效率。This application utilizes the built-in error correction module inside the Flash to identify the location information where errors occur in the read data, so as to accumulate the errors in each area. Through the preset cycle interval, timing is performed during the operation of the Flash and a time enable signal is sent out according to the cycle interval. When the time enable signal is received, it means that the current cycle has ended and the next cycle is about to enter. At this time, once the idle signal for Flash to stop reading is obtained, the error counts of each area are compared and the area with the largest error count is used as the target area for local detection, and local detection is used instead of traditional full detection to improve detection efficiency. In the present application, the frequency of error detection can be adjusted by setting the cycle interval. The longer the cycle interval is, the lower the error detection frequency is, and the shorter the cycle interval is, the higher the error detection frequency is. Therefore, the detection frequency can be adjusted according to the performance and state of the Flash. If the data reading error rate of Flash is high, the detection frequency can be increased to detect problems in time; if the data reading error rate of Flash is low, the detection frequency can be reduced to reduce loss. At the same time, in this application, after the current target area is determined, the time enable signal is promptly eliminated and the error count is cleared, and the statistics of the next cycle can be started, and a new target area can be determined and detected to ensure the continuation of the detection cycle. During the detection process of this application, if the Flash needs to perform data reading and interrupt the error detection process being executed, then keep the backup and save the detection progress, and resume detection according to the detection when the next idle time, avoiding repeated detection of the detected part, Further improve detection efficiency.

在一具体的实施例中,主控制器停止对Flash进行数据读取时,持续发出空闲使能信号free_en,而当即将恢复对Flash的数据读取操作时,则撤销空闲使能信号free_en,因此,可以根据是否存在空闲使能信号free_en判断当前是否处于读取空闲状态。在一具体的实施例中,当达到计时周期间隔后,发出的时间使能信号time为脉冲信号,该时间使能信号time存储于统计模块内,当确定目标区域后消除时间使能信号time,则是将存储的时间使能信号time清除。In a specific embodiment, when the master controller stops reading data from Flash, it continuously sends out the idle enable signal free_en, and when it is about to resume the data read operation on Flash, it cancels the idle enable signal free_en, so , it can be judged whether it is currently in the read idle state according to whether there is an idle enable signal free_en. In a specific embodiment, after reaching the timing cycle interval, the time enabling signal time sent is a pulse signal, and the time enabling signal time is stored in the statistics module, and when the target area is determined, the time enabling signal time is eliminated, Then, the stored time enable signal time is cleared.

在一实施例中,如图2所示,统计模块包括地址计算模块、错误计数寄存模块和最大值检测模块,其中,纠错模块可以为Flash自带的模块,而地址计算模块、错误计数寄存模块、最大值检测模块和错误检测模块可为外部拓展的快速检测模块。In one embodiment, as shown in Figure 2, the statistics module includes an address calculation module, an error count register module and a maximum value detection module, wherein the error correction module can be a built-in module of Flash, and the address calculation module, error count register The module, the maximum value detection module and the error detection module can be externally expanded fast detection modules.

其中,地址错误模块在接收到纠错模块反馈的错误位置信息err_info后,计算错误发生的地址,并通过addr_num信息将地址传输给错误计数寄存模块。需要说明的是,纠错模块所获取的传输数据中的错误位置,是在该串数据中的位置,在flash当中的数据读写是按页操作,地址计算模块会根据错误发生的位置以及读取发生的初始地址进行计算,从而确定发生错误的页区地址信息以及相应的扇区地址信息,随后把地址信息addr_num传输给错误数寄存模块。Wherein, the address error module calculates the address where the error occurs after receiving the error location information err_info fed back by the error correction module, and transmits the address to the error count register module through the addr_num information. It should be noted that the error position in the transmission data acquired by the error correction module is the position in the string of data, and the data read and write in flash is operated on a page-by-page basis. Take the generated initial address for calculation, so as to determine the address information of the page area where the error occurred and the corresponding sector address information, and then transmit the address information addr_num to the error number registration module.

所述错误计数寄存模块用于接收addr_num信息且每次接收到addr_num信息后,增加相应地址区域的计数。The error count registration module is used to receive the addr_num information and increase the count of the corresponding address area each time the addr_num information is received.

最大值检测模块用于执行比较操作,其启动工作的条件包括既接收到空闲使能信号free_en,又接收到时间使能信号time,两种信号同时存在时,才扫描错误数寄存模块中每一个区域地址addr_all对应的错误计数并进行比较,记录下最大错误计数对应的地址作为目标区域。The maximum value detection module is used to perform comparison operations. The conditions for starting work include receiving both the idle enable signal free_en and the time enable signal time. When the two signals exist at the same time, each error number register module is scanned. The error count corresponding to the area address addr_all is compared, and the address corresponding to the maximum error count is recorded as the target area.

其中,如图3所示,启动比较操作的情况有多种:Among them, as shown in Figure 3, there are many situations to start the comparison operation:

第一种,例如图3的检测计数段1,第一个周期间隔结束后发送时间使能信号time,随后间隔一段时间后才收到空闲使能信号free_en,此时启动比较操作。此时,虽然实际的检测计数段相较预设的周期间隔存在一定的偏差余量,但这个时间的偏差一般较小,其影响可以忽略。The first one, such as the detection and counting section 1 in Figure 3, sends the time enable signal time after the end of the first cycle interval, and then receives the idle enable signal free_en after a period of time, and starts the comparison operation at this time. At this time, although there is a certain deviation margin in the actual detection and counting segment compared with the preset cycle interval, the deviation of this time is generally small, and its impact can be ignored.

第二种,例如图3的检测计数段2,第二个周期间隔结束后发送时间使能信号time,此时已经处于空闲状态,因此在出现时间使能信号time时即可启动比较操作。The second type, such as the detection and counting section 2 in Figure 3, sends the time enable signal time after the end of the second cycle interval, and is already in an idle state at this time, so the comparison operation can be started when the time enable signal time appears.

第三种,当时间使能信号time和空闲使能信号free_en同时出现时,即可启动比较操作。In the third type, when the time enable signal time and the idle enable signal free_en appear simultaneously, the comparison operation can be started.

在特殊情况下,如果多个区的错误数计数同时最大则将先扫描的区作为目标区域。确定目标区域后将其地址发送给错误检测模块,随后消除时间使能信号time并对错误计数进行清零,重新开启下一周期的统计与搜索。In a special case, if multiple zones have the largest error counts at the same time, the zone scanned first will be used as the target zone. After determining the target area, send its address to the error detection module, then cancel the time enable signal time and clear the error count, and restart the statistics and search of the next cycle.

在一实施例中,如图2所示,最大值模块扫描结束后,会给错误检测模块一个dect_en信号,随即发送目标区的地址err_addr给错误检测模块,错误检测模块在结束全部检测任务之后,会把备份数据恢复至原区空间,然后发送一个dect_end信号给最大值检测模块表示检测任务已经结束。所述最大值检测模块发送上一目标区域后,判断是否接收到dect_end信号,若接收到,则选定下一目标区域并继续发送,若未接收到,则不进行工作。In one embodiment, as shown in Figure 2, after the scanning of the maximum value module, a dect_en signal will be given to the error detection module, and then the address err_addr of the target area will be sent to the error detection module. After the error detection module finishes all detection tasks, It will restore the backup data to the original space, and then send a dect_end signal to the maximum value detection module to indicate that the detection task has ended. After the maximum value detection module sends the last target area, it judges whether the dect_end signal is received, if received, selects the next target area and continues to send, if not received, does not work.

在一实施例中,如图2所示,计时模块包括页区计时子模块和扇区计时子模块,所述时间使能信号包括页区使能信号t1和扇区使能信号t2,所述页区计时子模块用于根据页区周期间隔发出页区使能信号t1,所述扇区计时子模块用于根据扇区周期间隔发出扇区使能信号t2,其中,扇区周期间隔大于页区周期间隔,一个扇区周期间隔内存在多个页区周期间隔。在空闲使能信号出现时:In one embodiment, as shown in FIG. 2, the timing module includes a page area timing submodule and a sector timing submodule, and the time enable signal includes a page area enable signal t1 and a sector enable signal t2. The page area timing sub-module is used to send the page area enable signal t1 according to the page area cycle interval, and the sector timing sub-module is used to send the sector enable signal t2 according to the sector cycle interval, wherein the sector cycle interval is greater than the page area There are multiple page area cycle intervals within one sector cycle interval. When the idle enable signal is present:

当仅存在页区使能信号t1时,扇区持续进行计数,以具有最大错误计数的页区作为目标区域并清零页区的计数以及消除页区使能信号;When there is only the page area enable signal t1, the sector continues to count, and the page area with the largest error count is used as the target area and the count of the page area is cleared and the page area enable signal is eliminated;

当仅存在扇区使能信号t2、或同时存在扇区使能信号t2和页区使能信号t1时,以具有最大错误计数的扇区作为目标区域并同时清零扇区和页区的计数以及消除页区使能信号和扇区使能信号,即扇区检测的优先级更高。When only the sector enable signal t2 exists, or both the sector enable signal t2 and the page area enable signal t1 exist, the sector with the largest error count is used as the target area and the counts of both the sector and the page area are cleared And eliminate the page area enable signal and the sector enable signal, that is, the priority of sector detection is higher.

在一实施例中,纠错模块包括BCH译码模块和错误信息纠错子模块,BCH译码模块包括校正子计算模块、错误多项式计算模块和钱搜索模块。其中,当校正子计算模块启动的时候,只要传输的数据中有错误,校正子计算结束的时候就会给错误数寄存模块一个err_en使能信号,从而启动错误数寄存模块对错误数进行记录。之后钱搜索模块会依次计算出错误位置,每得到一个错误位置,都会发送一个err_info信息给地址计算模块,err_info包括错误发生在一串数据的位置。地址计算模块会根据错误发生的位置以及读取发生的初始地址进行计算,从而确定发生错误的页区地址信息以及相应的扇区地址信息,随后把地址信息addr_num传输给错误数寄存模块。错误数寄存模块接收到目标区的地址信息,然后在相应的扇区和页区寄存模块上增加计数。In one embodiment, the error correction module includes a BCH decoding module and an error information error correction sub-module, and the BCH decoding module includes a syndrome calculation module, an error polynomial calculation module and a money search module. Wherein, when the syndrome calculation module is started, as long as there is an error in the transmitted data, an err_en enable signal will be given to the error number registration module when the syndrome calculation ends, thereby starting the error number registration module to record the error number. Afterwards, the money search module will calculate the error location in turn, and each time it gets an error location, it will send an err_info message to the address calculation module. err_info includes the location where the error occurred in a string of data. The address calculation module will calculate according to the position where the error occurs and the initial address where the read occurs, so as to determine the address information of the page area where the error occurred and the corresponding sector address information, and then transmit the address information addr_num to the error number register module. The error number registration module receives the address information of the target area, and then increases the count on the corresponding sector and page area registration module.

常见的信息包括有数据码和校验码,在一实施例中,如图4所示,信息传输方向沿着箭头方向,在原信息的基础上增加错误标志位和错误信息,这里的错误信息的初始值是一段预先设定的信息值。在对外的传输时,Flash发送出去的只有数据码,其他信息(校验码,错误标志,错误信息)都会在内部进行截取。Common information includes data codes and check codes. In one embodiment, as shown in Figure 4, the information transmission direction is along the direction of the arrow, and error flags and error information are added on the basis of the original information. The error information here is The initial value is a preset information value. During external transmission, only the data code is sent out by Flash, and other information (check code, error flag, error message) will be intercepted internally.

在纠错过程中,如图5所示,设定错误信息为全0且与原信息等长,纠错发生时(即对应位置发生电平翻转0->1),从而得到错误信息。地址模块只需要知道首地址以及扫描错误信息中1的位置即可解析出错误发生的区地址,只要错误信息内容中有一个1,即说明有错误发生,则设置错误标志位。In the error correction process, as shown in Figure 5, the error information is set to be all 0s and equal in length to the original information. When error correction occurs (that is, the level flips 0->1 at the corresponding position), the error information is obtained. The address module only needs to know the first address and scan the position of 1 in the error information to analyze the address of the area where the error occurred. As long as there is a 1 in the content of the error information, it means that there is an error, and the error flag is set.

具体的流程如图6所示,在系统启动之后,从Flash中读取数据时,纠错后的数据按照上述数据格式进行传输,检测模块会等待一个错误标志的出现,如果没有检测到,则不进行任何操作,如果出现错误标志,则会发出一个err_en使能信号给错误寄存器。The specific process is shown in Figure 6. After the system starts, when reading data from Flash, the data after error correction is transmitted according to the above data format, and the detection module will wait for an error flag to appear. If it is not detected, then Do nothing, if an error flag occurs, an err_en enable signal is sent to the error register.

接收到err_en信号后,后续的错误位置信息err_info会发送给地址计算模块。如果传输未结束,则读取数据,检测错误标志的循环过程。After receiving the err_en signal, the subsequent error location information err_info will be sent to the address calculation module. If the transmission is not over, read the data, check the loop process of the error flag.

在一实施例中,如图7所示,错误检测模块包括备份区,所述备份区包括区块信息区,检测进度区,备份数据区。其中,区块信息区和检测进度区留有外置接口。区块信息区的外置接口主要传输检测出的错误数据信息,包括错误地址和错误类型。检测进度区的外置接口用于对内置算法数据的修改。In one embodiment, as shown in FIG. 7 , the error detection module includes a backup area, and the backup area includes a block information area, a detection progress area, and a backup data area. Among them, there are external interfaces in the block information area and the detection progress area. The external interface of the block information area mainly transmits the detected error data information, including error address and error type. The external interface of the detection progress area is used to modify the built-in algorithm data.

首先,错误检测模块会优先把目标区域的地址信息放入备份区中的区块信息区,然后把目标区域中的数据备份至备份数据区,随后会对目标区域进行检测。Firstly, the error detection module will first put the address information of the target area into the block information area in the backup area, then back up the data in the target area to the backup data area, and then detect the target area.

错误检测模块会根据检测的算法分成多个不同的检测,并在每个检测结束,在检测进度区保存检测进度,同时一部分算法检测所需要的数据也存入在该区域,实际检测中从该区域中读取检测中所需的数据。The error detection module will be divided into several different detections according to the detection algorithm, and at the end of each detection, the detection progress will be saved in the detection progress area, and part of the data required for algorithm detection will also be stored in this area. Read the data required for detection in the area.

错误检测模块每次检测出错误,把错误地址以及错误类型打包成错误数据信息包,写入区块信息区。Each time the error detection module detects an error, it packs the error address and error type into an error data packet and writes it into the block information area.

在错误检测模块工作时如果空闲使能信号free_en信号结束,说明Flash存储器要恢复工作状态了。此时错误检测模块会停止工作,并把备份数据区中的数据恢复至原区,备份区保存的数据继续保留,直至下一次free_en信号的来临,此时会直接恢复检测的状态,然后根据检测进度区内进度数据,恢复保存的进度情况,然后继续进行检测。待该区检测全部结束,区块信息区内会存放所有的错误数据信息。When the error detection module is working, if the free enable signal free_en signal ends, it means that the Flash memory will resume its working state. At this time, the error detection module will stop working, and restore the data in the backup data area to the original area, and the data saved in the backup area will continue to be retained until the next free_en signal comes. Progress data in the progress area, restore the saved progress, and then continue to detect. After the detection of this area is completed, all error data information will be stored in the block information area.

错误检测模块在结束全部检测任务之后,会把备份数据恢复至原区空间,然后发送一个dect_end信号给最大值检测模块表示检测任务已经结束。最大值检测模块接收到dect_end信号后,将会开启新的一轮进程。After the error detection module completes all detection tasks, it will restore the backup data to the original space, and then send a dect_end signal to the maximum value detection module to indicate that the detection task has ended. After the maximum value detection module receives the dect_end signal, it will start a new round of process.

相应的,本申请还涉及一种Flash的快速检测方法,如图8所示,该快速检测方法包括:Correspondingly, the present application also relates to a fast detection method for Flash, as shown in FIG. 8 , the fast detection method includes:

计时:设定周期间隔,计时并根据设定的周期间隔发出时间使能信号;Timing: set the cycle interval, time and send a time enable signal according to the set cycle interval;

信息获取:在计时期间获取数据读写时传输信息的错误位置信息;Information Acquisition: Obtain the error position information of the transmitted information when reading and writing data during the timing period;

目标定位:根据所述错误位置信息统计各区域的错误计数,并当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域后将时间使能信号消除以及将各区域的计数清零。Target positioning: count the error counts of each area according to the error position information, and when the time enable signal and the idle enable signal that the Flash data reading stops exist simultaneously, compare the counts of each area, and use the one with the maximum count After the area is used as the target area, the time enable signal is eliminated and the counts of each area are cleared.

错误检测:当出现空闲使能信号时将目标区域的数据进行备份以及备份后对目标区域进行检测,当即将执行Flash数据读取操作时,暂停检测且保留备份数据、保存检测进度并在下次出现空闲使能信号时继续对上一未检测完毕的目标区域检测,直至当前目标区域检测结束后获取新的目标区域进行检测。Error detection: When the idle enable signal appears, the data in the target area is backed up and the target area is detected after the backup. When the Flash data read operation is about to be performed, the detection is suspended and the backup data is kept, the detection progress is saved and it will appear next time When the enable signal is idle, continue to detect the last target area that has not been detected until the current target area detection is completed and a new target area is obtained for detection.

具体的,在计时步骤中,可以分别设定页区周期间隔和扇区周期间隔,对页区和扇区分别计时,一旦达到页区周期间隔时发出页区使能信号t1,一旦达到扇区周期间隔时发出扇区使能信号t2。对应的,在目标定位步骤中,当仅出现页区使能信号t1时,扇区持续进行计数,以具有最大错误计数的页区作为目标区域并清零页区的计数以及消除页区使能信号t1;当出现扇区使能信号t2时,以具有最大错误计数的扇区作为目标区域并同时清零扇区和页区的计数以及消除页区使能信号t1和扇区使能信号t2。Specifically, in the timing step, the cycle interval of the page area and the cycle interval of the sector can be set respectively, and the page area and the sector are timed separately. Once the cycle interval of the page area is reached, the page area enable signal t1 is sent. The sector enable signal t2 is sent out at periodic intervals. Correspondingly, in the target positioning step, when only the page area enable signal t1 appears, the sector continues to count, and the page area with the largest error count is used as the target area, and the count of the page area is cleared and the page area enable is eliminated Signal t1; when the sector enable signal t2 appears, take the sector with the largest error count as the target area and simultaneously clear the counts of the sector and the page area and eliminate the page area enable signal t1 and the sector enable signal t2 .

该Flash的快速检测方法与上文Flash的快速检测装置对应,其中的细节可参考上文介绍,在此不再赘述。The fast detection method of the Flash corresponds to the fast detection device of the above-mentioned Flash, and the details thereof can be referred to the introduction above, and will not be repeated here.

本申请利用Flash内部自带的纠错模块识别读取数据中发生错误的位置信息,以对各区域的错误进行累计。通过预设周期间隔,在Flash运行期间进行计时并按照该周期间隔发出时间使能信号,当接收到时间使能信号时,说明当前周期已经结束,即将进入下一周期。此时,一旦获取到Flash停止读取的空闲信号时,则比较各区域的错误计数并以具有最大错误计数的区域作为目标区域进行局部检测,避免Flash存储模块全面检测,通过有针对性的检测降低检测频率,提高了检测效率和控制器利用率,同时提升Flash存储器的使用寿命。本申请可以通过设定周期间隔调节错误检测的频率,周期间隔越长,错误检测的频率越低,周期间隔越短,错误检测的频率越高。由此可以根据Flash的性能和状态调节检测频率。若是Flash的数据读取错误率较大,则可以增大检测频率以及时发现问题,若是Flash的数据读取错误率较小,则可以减小检测频率以降低损耗。同时,本申请中,在确定当前目标区域后及时消除时间使能信号并清零错误计数,可以开始下一周期的统计,确定新的目标区域并进行检测,保证检测周期的持续进行。本申请在检测过程期间,若是Flash需执行数据读取而中断正在执行的错误检测过程,则保留备份且保存检测进度,当下一个空闲时根据检测进行恢复检测,避免对已检测的部分重复检测,进一步提高检测效率。This application utilizes the built-in error correction module inside the Flash to identify the location information where errors occur in the read data, so as to accumulate the errors in each area. Through the preset cycle interval, timing is performed during the operation of the Flash and a time enable signal is sent out according to the cycle interval. When the time enable signal is received, it means that the current cycle has ended and the next cycle is about to enter. At this time, once the idle signal for Flash to stop reading is obtained, the error counts of each area are compared and the area with the largest error count is used as the target area for partial detection to avoid comprehensive detection of the Flash memory module and through targeted detection The detection frequency is reduced, the detection efficiency and the utilization rate of the controller are improved, and the service life of the Flash memory is improved at the same time. In the present application, the frequency of error detection can be adjusted by setting the cycle interval. The longer the cycle interval is, the lower the error detection frequency is, and the shorter the cycle interval is, the higher the error detection frequency is. Therefore, the detection frequency can be adjusted according to the performance and state of the Flash. If the data reading error rate of Flash is high, the detection frequency can be increased to detect problems in time; if the data reading error rate of Flash is low, the detection frequency can be reduced to reduce loss. At the same time, in this application, after the current target area is determined, the time enable signal is promptly eliminated and the error count is cleared, and the statistics of the next cycle can be started, and a new target area can be determined and detected to ensure the continuation of the detection cycle. During the detection process of this application, if the Flash needs to perform data reading and interrupt the error detection process being executed, then keep the backup and save the detection progress, and resume detection according to the detection when the next idle time, avoiding repeated detection of the detected part, Further improve detection efficiency.

本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。It is easy for those skilled in the art to understand that the above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention, All should be included within the protection scope of the present invention.

Claims (10)

1.一种Flash的快速检测装置,其特征在于,包括:1. a fast detection device of Flash, is characterized in that, comprises: 纠错模块,用于在数据读写期间识别传输信息的错误位置信息;An error correction module is used to identify the error position information of the transmitted information during data reading and writing; 计时模块,用于计时并根据设定的周期间隔发出时间使能信号;A timing module is used for timing and sending a time enable signal according to a set cycle interval; 统计模块,用于根据纠错模块反馈的错误位置信息统计各区域的错误计数,并当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域发送给错误检测模块后将时间使能信号消除以及将各区域的计数清零;The statistical module is used to count the error counts of each area according to the error position information fed back by the error correction module, and when the time enable signal and the idle enable signal indicating that the Flash data reading stops exist at the same time, compare the counts of each area, and After the area with the maximum count is sent to the error detection module as the target area, the time enable signal is eliminated and the counts of each area are cleared; 错误检测模块,用于当出现空闲使能信号时将目标区域的数据进行备份以及备份后对目标区域进行检测,当即将执行Flash数据读取操作时,暂停检测且保留备份数据、保存检测进度并在下次出现空闲使能信号时继续对上一未检测完毕的目标区域检测,直至当前目标区域检测结束后获取新的目标区域进行检测。The error detection module is used for backing up the data of the target area and detecting the target area after the backup when an idle enable signal occurs, and when the Flash data read operation is about to be performed, the detection is suspended and the backup data is retained, the detection progress is saved, and When the idle enable signal appears next time, continue to detect the target area that has not been detected until the detection of the current target area is completed and obtain a new target area for detection. 2.如权利要求1所述的Flash的快速检测装置,其特征在于,所述统计模块包括地址计算模块、错误计数寄存模块和最大值检测模块,其中,2. the fast detection device of Flash as claimed in claim 1, is characterized in that, described statistics module comprises address calculation module, error count registration module and maximum value detection module, wherein, 所述地址计算模块用于根据错误位置信息err_info计算错误发生的地址,并通过addr_num信息将地址传输给错误计数寄存模块;The address calculation module is used to calculate the address where the error occurs according to the error location information err_info, and transmit the address to the error count registration module through the addr_num information; 所述错误计数寄存模块用于接收addr_num信息且每次接收到addr_num信息后,增加相应地址区域的计数;The error count registration module is used to receive the addr_num information and increase the count of the corresponding address area after receiving the addr_num information each time; 最大值检测模块用于获取时间使能信号和空闲使能信号,并当时间使能信号和空闲使能信号同时存在时,比较各区域的错误计数,并以具有最大计数的区域作为目标区域发送给错误检测模块、同时将时间使能信号消除以及将所述错误计数寄存器中各区域的计数清零。The maximum value detection module is used to obtain the time enable signal and the idle enable signal, and when the time enable signal and the idle enable signal exist at the same time, compare the error counts of each area, and send the area with the maximum count as the target area to the error detection module, and at the same time, the time enable signal is eliminated and the counts of each area in the error count register are cleared. 3.如权利要求2所述的Flash的快速检测装置,其特征在于,所述错误检测模块在当前目标区域检测完毕后向所述最大值检测模块返回dect_end信号,所述最大值检测模块发送上一目标区域后,判断是否接收到dect_end信号,若接收到,则选定下一目标区域并继续发送,若未接收到,则不进行工作。3. the fast detection device of Flash as claimed in claim 2, is characterized in that, described error detection module returns dect_end signal to described maximum value detection module after current target region detects, and described maximum value detection module sends up After a target area, judge whether the dect_end signal is received, if received, select the next target area and continue sending, if not received, do not work. 4.如权利要求1所述的Flash的快速检测装置,其特征在于,所述纠错模块包括BCH译码器,所述BCH译码器包括校正子计算模块、错误多项式计算模块和钱搜索模块,其中,4. the fast detection device of Flash as claimed in claim 1 is characterized in that, described error correction module comprises BCH decoder, and described BCH decoder comprises syndrome calculation module, error polynomial calculation module and money search module ,in, 所述校正子计算模块识别数据传输的错误并当出现错误时发出err_en使能信号;The syndrome calculation module identifies an error in data transmission and sends an err_en enable signal when an error occurs; 所述钱搜索模块依次计算出错误位置并每当得到一个错误位置时发出一个相应的错误位置信息err_info,每个错误位置信息err_info包括对应错误发生的位置;The money search module calculates the error position in turn and sends a corresponding error position information err_info whenever an error position is obtained, and each error position information err_info includes the position where the corresponding error occurs; 所述统计模块在接收到err_en使能信号后启动统计并根据错误位置信息err_info对相应区域的错误计数进行累加。The statistics module starts statistics after receiving the err_en enable signal and accumulates the error counts in the corresponding area according to the error location information err_info. 5.如权利要求1所述的Flash的快速检测装置,其特征在于,进入纠错模块的信息格式包括数据码、校验码、错误标志位和错误信息,信息格式中的错误信息与数据码长度相同;纠错模块用于当识别到数据读取存在错误时,在错误标志位生成错误标志,且使错误信息中对应位置的电平发生翻转;纠错模块还用于在纠错后截取校验码、错误标志位和错误信息,当出现错误标志时发出err_en使能信号,并通过错误位置信息err_info将截取的错误信息发送给统计模块;5. the fast detection device of Flash as claimed in claim 1 is characterized in that, the information format that enters error correction module comprises data code, check code, error flag and error information, and the error information and data code in information format The length is the same; the error correction module is used to generate an error flag in the error flag bit when it is recognized that there is an error in the data reading, and the level of the corresponding position in the error information is reversed; the error correction module is also used to intercept the error after error correction Check code, error flag and error information, when an error flag occurs, an err_en enable signal is sent, and the intercepted error information is sent to the statistics module through the error location information err_info; 所述统计模块在接收到err_en使能信号后启动统计并根据错误位置信息err_info对相应区域的错误计数进行累加。The statistics module starts statistics after receiving the err_en enable signal and accumulates the error counts in the corresponding area according to the error location information err_info. 6.如权利要求1所述的Flash的快速检测装置,其特征在于,进入纠错模块错误信息为全0字符,错误信息中各字符的位置与数据码中对应字符的位置相同,当纠错模块所截取的错误信息中存在字符1,表示数据码在当前位置存在错误。6. the fast detection device of Flash as claimed in claim 1 is characterized in that, entering error correction module error message is all 0 characters, and the position of each character in the error message is identical with the position of corresponding character in the data code, when error correction There is a character 1 in the error message intercepted by the module, indicating that there is an error in the current position of the data code. 7.如权利要求1所述的Flash的快速检测装置,其特征在于,所述错误检测模块包括备份区,所述备份区包括备份数据区、具有外置接口的区块信息区和具有外置结构的检测进度区,其中,7. the fast detection device of Flash as claimed in claim 1 is characterized in that, described error detection module comprises backup area, and described backup area comprises backup data area, has the block information area of external interface and has external The detection progress area of the structure, where, 所述错误检测模块用于将接收到的目标区域的地址、对目标区域所检测到的错误计数据信息保存于所述区块信息区中,所述区块信息区通过对应的外置接口传输错误计数据信息;The error detection module is used to save the received address of the target area and the detected error count data information of the target area in the block information area, and the block information area is transmitted through a corresponding external interface error meter data information; 所述检测进度区用于保存检测算法,所述检测进度区的外置接口用于修改内部的检测算法,所述错误检测模块用于将目标区域的数据备份至所述备份数据区后调取所述检测进度区的检测算法对所述目标区域进行检测,并在检测中断时在检测进度区内保存检测进度以在下次检测时根据所述检测进度恢复检测。The detection progress area is used to save the detection algorithm, the external interface of the detection progress area is used to modify the internal detection algorithm, and the error detection module is used to backup the data in the target area to the backup data area and then call The detection algorithm in the detection progress area detects the target area, and saves the detection progress in the detection progress area when the detection is interrupted, so as to resume detection according to the detection progress in the next detection. 8.如权利要求1所述的Flash的快速检测装置,其特征在于,所述计时模块包括页区计时子模块和扇区计时子模块,所述时间使能信号包括页区使能信号和扇区使能信号,所述页区计时子模块用于根据页区周期间隔发出页区使能信号,所述扇区计时子模块用于根据扇区周期间隔发出扇区使能信号,其中,扇区周期间隔大于页区周期间隔;8. the fast detection device of Flash as claimed in claim 1 is characterized in that, described timing module comprises page area timing submodule and sector timing submodule, and described time enabling signal comprises page area enabling signal and sector The area enable signal, the page area timing submodule is used to send the page area enable signal according to the page area cycle interval, and the sector timing submodule is used to send the sector enable signal according to the sector cycle interval, wherein, the sector The area cycle interval is greater than the page area cycle interval; 当仅出现页区使能信号时,扇区持续进行计数,以具有最大错误计数的页区作为目标区域并清零页区的计数以及消除页区使能信号;When only the page area enable signal occurs, the sector continues to count, and the page area with the largest error count is used as the target area, and the count of the page area is cleared and the page area enable signal is eliminated; 当出现扇区使能信号时,以具有最大错误计数的扇区作为目标区域并同时清零扇区和页区的计数以及消除页区使能信号和扇区使能信号。When the sector enable signal occurs, the sector with the largest error count is taken as the target area, and the counts of the sector and the page area are cleared and the page area enable signal and the sector enable signal are eliminated at the same time. 9.一种Flash的快速检测方法,其特征在于,包括:9. A fast detection method for Flash, comprising: 设定周期间隔,计时并根据设定的周期间隔发出时间使能信号;Set the cycle interval, time and send a time enable signal according to the set cycle interval; 在计时期间获取数据读写时传输信息的错误位置信息;Obtain the error position information of the transmitted information when the data is read and written during the timing period; 根据所述错误位置信息统计各区域的错误计数,并当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域后将时间使能信号消除以及将各区域的计数清零;According to the error location information, the error counts of each area are counted, and when the time enable signal and the idle enable signal indicating that the Flash data reading stops exist at the same time, the counts of each area are compared, and the area with the largest count is used as the target After the area, the time enable signal is eliminated and the count of each area is cleared; 当出现空闲使能信号时将目标区域的数据进行备份以及备份后对目标区域进行检测,当即将执行Flash数据读取操作时,暂停检测且保留备份数据、保存检测进度并在下次出现空闲使能信号时继续对上一未检测完毕的目标区域检测,直至当前目标区域检测结束后获取新的目标区域进行检测。When the idle enable signal appears, the data in the target area is backed up and the target area is detected after the backup. When the Flash data read operation is about to be performed, the detection is suspended and the backup data is kept, the detection progress is saved, and the next time the idle enable occurs When the signal is signaled, continue to detect the last target area that has not been detected until the current target area detection is completed and a new target area is obtained for detection. 10.如权利要求9所述的Flash的快速检测方法,其特征在于,10. the fast detection method of Flash as claimed in claim 9 is characterized in that, 设定周期间隔,计时并根据设定的周期间隔发出时间使能信号,包括:Set the cycle interval, timing and send time enable signal according to the set cycle interval, including: 设定页区周期间隔和扇区周期间隔,对页区和扇区分别计时,一旦达到页区周期间隔时发出页区使能信号,一旦达到扇区周期间隔时发出扇区使能信号;Set the page area cycle interval and the sector cycle interval, time the page area and the sector separately, once the page area cycle interval is reached, the page area enable signal is sent, and once the sector cycle interval is reached, the sector enable signal is sent; 当时间使能信号和表示Flash数据读取停止的空闲使能信号同时存在时,比较各区域的计数,并以具有最大计数的区域作为目标区域后将时间使能信号消除以及将各区域的计数清零,包括:When the time enable signal and the idle enable signal indicating that the Flash data read stop exist at the same time, compare the counts of each area, and take the area with the largest count as the target area, then cancel the time enable signal and count the counts of each area Clear, including: 当仅出现页区使能信号时,扇区持续进行计数,以具有最大错误计数的页区作为目标区域并清零页区的计数以及消除页区使能信号;When only the page area enable signal occurs, the sector continues to count, and the page area with the largest error count is used as the target area, and the count of the page area is cleared and the page area enable signal is eliminated; 当出现扇区使能信号时,以具有最大错误计数的扇区作为目标区域并同时清零扇区和页区的计数以及消除页区使能信号和扇区使能信号。When the sector enable signal occurs, the sector with the largest error count is taken as the target area, and the counts of the sector and the page area are cleared and the page area enable signal and the sector enable signal are eliminated at the same time.
CN202210155645.7A 2022-02-21 2022-02-21 Flash rapid detection device and method Expired - Fee Related CN114566203B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210155645.7A CN114566203B (en) 2022-02-21 2022-02-21 Flash rapid detection device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210155645.7A CN114566203B (en) 2022-02-21 2022-02-21 Flash rapid detection device and method

Publications (2)

Publication Number Publication Date
CN114566203A CN114566203A (en) 2022-05-31
CN114566203B true CN114566203B (en) 2023-05-05

Family

ID=81713029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210155645.7A Expired - Fee Related CN114566203B (en) 2022-02-21 2022-02-21 Flash rapid detection device and method

Country Status (1)

Country Link
CN (1) CN114566203B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105304144A (en) * 2015-10-30 2016-02-03 中国科学院微电子研究所 Memory error detection method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0667989A (en) * 1992-08-13 1994-03-11 Kofu Nippon Denki Kk Patrol circuit for memory
CN103680639B (en) * 2013-11-29 2016-08-24 西安空间无线电技术研究所 The periodicity of a kind of random access memory is from error detection restoration methods
KR102435873B1 (en) * 2015-12-18 2022-08-25 삼성전자주식회사 Storage device and read reclaim method thereof
US10446243B2 (en) * 2017-12-18 2019-10-15 Macronix International Co., Ltd. Storage device and associated control method to determine target memory blocks for probe operation
CN113051100B (en) * 2020-06-01 2024-05-17 长江存储科技有限责任公司 Flash memory and error bit counting detection system thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105304144A (en) * 2015-10-30 2016-02-03 中国科学院微电子研究所 Memory error detection method and device

Also Published As

Publication number Publication date
CN114566203A (en) 2022-05-31

Similar Documents

Publication Publication Date Title
EP0032957B1 (en) Information processing system for error processing, and error processing method
US7007210B2 (en) Method and system for handling multiple bit errors to enhance system reliability
CN116880781B (en) Storage device and control method thereof
US20230325276A1 (en) Error correction method and apparatus
CN111448543B (en) Memory Access Technology and Computer System
TWI665606B (en) A system and a method for testing a data storage device
CN101567220A (en) Damaged block identification method of flash memory, storage system and controller thereof
US20150121172A1 (en) Computer Memory Access
CN114566203B (en) Flash rapid detection device and method
TW201312573A (en) Flash memory storage device and method for determining bad storage area thereof
JPH113290A (en) Memory control method
CN109669635B (en) Command LBA (logical block addressing) coincidence detection method and device for solid-state storage master control chip
WO2025152321A1 (en) Hard disk removal method and apparatus, non-volatile readable storage medium, and electronic device
CN114518972B (en) Memory error processing method, device, memory controller and processor
TW202123230A (en) Memory management method, storage controller and storage device
US20240311233A1 (en) Hardware Fault Detection Method for Internal Memory, Apparatus, and Internal Memory Controller
US8687301B1 (en) Parallel no-sync-mark retry
CN114185710B (en) A method for executing read retry operation of solid state hard disk and its application
JPS61278958A (en) Data transfer device
CN102103890B (en) Method and system for identifying chip parameters
KR100280457B1 (en) How to read and write data in flash memory
CN101620575A (en) Flash card and method for flash memory to prevent data from being damaged
CN116991651B (en) Error injection method, system on chip, computer equipment and storage medium
US20240004586A1 (en) Method for instruction transmission for memory devices and storage system
JP2011192137A (en) Memory card control system, memory card control device and memory card control method

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20230505