Flash memory testing method, device, storage medium and terminal equipment
By reading data in flash memory to generate test vectors and performing write operations without erasing, the problem of time and resource waste in existing flash memory testing methods is solved, testing efficiency and flash memory life are improved, and data errors are prevented. Revise.
Patent Information
- Application Number
- CN202110591310.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-28
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-05-28
AI Technical Summary
Existing flash memory testing methods require erasing most of the pages that do not need to be tested, resulting in a waste of time and resources, and may mistakenly modify data in areas not to be tested, affecting the service life.
Generate test vectors by reading data from the area to be tested, perform data writing operations without erasing, and test whether they are consistent to determine area functions. Flexibly select test vector types and functions to reduce the number of erasures and prevent data lost.
It achieves more efficient flash memory testing, reduces the number of erasures, extends the service life of flash memory, and prevents accidental modification of data in areas not to be tested.
Smart Images

Figure CN113223597B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of terminal equipment, and in particular to a flash memory testing method, device, storage medium and terminal equipment. Background Art
[0002] In mobile communication devices, flash memory is generally used as the storage medium. Flash memory is a non-volatile random access memory (NVRAM), a type of ROM, and can be erased and written more than 100,000 times.
[0003] In the prior art, the smallest unit of flash memory erasure is generally a block or sector. If a page in the flash memory needs to be tested to determine whether the function of the page is normal, it is usually necessary to erase most of the data corresponding to the page that does not need to be tested, which wastes a lot of time and resources. Therefore, a more efficient flash memory testing method is urgently needed. Summary of the invention
[0004] In view of this, the present disclosure proposes a flash memory testing method, apparatus, storage medium and terminal device.
[0005] According to one aspect of the present disclosure, a flash memory testing method is provided, the method comprising: reading first data from an area to be tested of the flash memory; generating a test vector based on the first data; performing a data writing operation on the flash memory based on the test vector so that second data is stored in the area to be tested; reading the second data from the area to be tested, and determining a test result for the area to be tested based on whether the second data is consistent with the test vector.
[0006] According to an embodiment of the present application, by reading first data from an area to be tested of a flash memory; generating a test vector based on the first data; performing a data writing operation on the flash memory based on the test vector so that second data is stored in the area to be tested; reading the second data from the area to be tested, and determining a test result for the area to be tested based on whether the second data is consistent with the test vector, it is possible to flexibly determine a test vector for testing based on the storage of the first data in the area to be tested when testing the function of the area to be tested, and at the same time reduce the number of flash memory erase times, save time, increase the service life of the flash memory, and prevent data in non-areas to be tested from being modified by mistake.
[0007] In a possible implementation, performing a data writing operation on a flash memory according to the test vector includes: performing a data writing operation on the flash memory according to the test vector without performing an erasing operation.
[0008] According to an embodiment of the present application, by performing a data writing operation on the flash memory according to the test vector without performing an erasing operation, it is possible to test the function of the area to be tested without erasing the entire block or sector in the flash memory, thereby preventing data loss in non-test areas and improving the service life of the flash memory.
[0009] In a possible implementation, generating a test vector based on the first data includes: when it is determined based on the first data that all or part of the bits in the area to be tested can be rewritten with data before erasure, generating a test vector for the all or part of the bits.
[0010] According to the embodiment of the present application, by: determining, based on the first data, that all or part of the bits in the area to be tested can be rewritten with data before erasing, generating a test vector for the all or part of the bits, when testing the function of the area to be tested, it is possible to test the area to be tested in which no data is written, and it is also possible to test all or part of the bits in the area to be tested in which data is written and which can be rewritten with data before erasing, thereby making the test more free and flexible.
[0011] In a possible implementation, the vector type of the test vector corresponds to a function to be tested.
[0012] Therefore, it is possible to flexibly select the type of test vector according to the test requirements to test whether the corresponding function is normal.
[0013] In a possible implementation, the vector type may include one or more of an all-0 vector, an all-1 vector, a checkerboard vector, a marchpattern vector, and a galloping pattern vector.
[0014] In a possible implementation, the test may include one or more of a short circuit test, an open circuit test, an interference test, and an address error test for the area to be tested.
[0015] Therefore, it is possible to test different functions of the area to be tested according to the test needs, making the test content more flexible and rich.
[0016] In a possible implementation, each of the to-be-tested areas is one byte.
[0017] According to one aspect of the present disclosure, a flash memory testing device is provided, which includes: a first module for reading first data from a to-be-tested area of the flash memory; a second module for generating a test vector based on the first data; a third module for performing a data write operation on the flash memory according to the test vector so that second data is stored in the to-be-tested area; and a fourth module for reading the second data from the to-be-tested area and determining a test result for the to-be-tested area based on whether the second data is consistent with the test vector.
[0018] In a possible implementation, performing a data writing operation on a flash memory according to the test vector includes: performing a data writing operation on the flash memory according to the test vector without performing an erasing operation.
[0019] In a possible implementation, generating a test vector based on the first data includes: when it is determined based on the first data that all or part of the bits in the area to be tested can be rewritten with data before erasure, generating a test vector for the all or part of the bits.
[0020] In a possible implementation, the vector type of the test vector corresponds to a function to be tested.
[0021] In a possible implementation, the vector type may include one or more of an all-0 vector, an all-1 vector, a checkerboard vector, a marchpattern vector, and a galloping pattern vector.
[0022] In a possible implementation, the test may include one or more of a short circuit test, an open circuit test, an interference test, and an address error test for the area to be tested.
[0023] In a possible implementation, each of the to-be-tested areas is one byte.
[0024] According to another aspect of the present disclosure, a terminal device is provided, characterized in that the terminal device includes a flash memory controller, and the flash memory controller is used to execute the above method.
[0025] According to another aspect of the present disclosure, a flash memory testing device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the above method.
[0026] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.
[0027] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0029] Figure 1 A structural diagram of a flash memory storage system according to an embodiment of the present application is shown.
[0030] Figure 2 A schematic diagram showing a test location in a flash memory according to an embodiment of the present application.
[0031] Figure 3 A flow chart of a flash memory testing method according to an embodiment of the present application is shown.
[0032] Figure 4 A flow chart of a flash memory testing method according to an embodiment of the present application is shown.
[0033] Figure 5 A structural diagram of a flash memory testing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0034] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0035] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0036] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0037] Figure 1 FIG. 1 shows a structural diagram of a flash memory storage system according to an embodiment of the present application. A person skilled in the art should understand that Figure 1 The structure in the example is only an example, and the embodiments of the present application are not limited to application Figure 1 The exemplary scenario shown in FIG. Figure 1As shown, the flash storage system 100 may include a flash controller 110, a bus connection interface 120, and a flash memory 130. The flash storage system 100 may be connected to a host 200, and data may be written to or read from the flash storage system 100 through the host 200. The flash storage system 100 may be a portable disk, a memory card, or a solid state drive (SSD), which is not limited in the present application.
[0038] The flash memory controller 110 may be used to coordinate the overall operation of the bus connection interface 120 and the flash memory 130, such as data storage, reading and erasing, etc. The flash memory controller 110 may include a microprocessor 110a and a flash memory interface 110b.
[0039] The microprocessor 110a can be used to manage and operate the flash memory 130, for example, to perform wear leveling, bad block management, and mapping table maintenance, etc. In the embodiment of the present application, the microprocessor 110a can be used to execute the steps of the flash memory testing method according to the embodiment.
[0040] The flash memory interface 110b is coupled to the microprocessor 110a and can be used to access the flash memory 130. For example, data that the host 200 wants to write to the flash memory 130 can be converted into a format acceptable to the flash memory 130 via the flash memory interface 110b.
[0041] In addition, although not shown Figure 1 However, the flash memory controller 110 may further include a memory management module, a buffer memory, a power management module and other functional modules commonly found in general flash memories.
[0042] The bus connection interface 120 can be used to connect the host 200. The bus connection interface 120 can be a USB interface, a PCI Express interface, an IEEE 1394 interface, a SATA interface, an MS interface, an MMC interface, an SD interface, a CF interface, an IDE interface or other suitable data transmission interface, which is not limited in the present application.
[0043] The flash memory 130 is coupled to the flash memory controller 110 and can be used to store data. The flash memory 130 can be divided into a plurality of physical blocks 130-0 to 130-N. For the convenience of explanation, the physical blocks are referred to as blocks below. In the flash memory, a block can be the smallest unit of erasure. That is, each block contains the minimum number of storage units that are erased together. In a possible implementation, according to different flash memory designs, each block can also be divided into a plurality of sectors. In this case, the sector can be the smallest unit of erasure in the flash memory. Each block (or sector) can be divided into a plurality of pages (pages) ( Figure 1 In the example, a block can be divided into several pages. A page can be the smallest unit of programming, that is, a page can be the smallest unit of writing data or reading data. Each page can be divided into 256 bytes, and each byte can include 8 bits.
[0044] A block (or sector) may be composed of any number of pages, such as 64 pages, 128 pages, 256 pages, etc. The blocks 130-0 to 130-N may also be grouped into a number of zones. The memory is managed by zones so that the zones are operated independently of each other to increase the parallelism of the operation execution and simplify the complexity of the management.
[0045] Some examples of the flash memory testing method according to the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0046] Figure 2 FIG. 1 is a schematic diagram showing a test position in a flash memory according to an embodiment of the present application. Figure 2 As shown, the entire rectangular box can represent a block (or a sector) in the flash memory. Here, block 2 (i.e., the second block) is taken as an example. Each row in the rectangular box can represent a page in the block (or sector), and n can represent the total number of pages in the block (or sector). The shaded portion in page 2 can represent bytes of written data, such as byte 2 (i.e., the second byte).
[0047] The test may be a function of a single byte in the flash memory or a function of multiple bytes, where the multiple bytes may be distributed in one or more pages. The test location (i.e., the storage address of the test) may be a byte with written data or a byte without written data.
[0048] As can be seen from the above, the smallest unit of erasure in flash memory is a block (or sector), and the smallest unit of writing or reading data is a page. For example, when a page in a block (or sector) needs to be functionally tested, if the method of erasing first and then testing is used, the data of other pages in the block (or sector) needs to be erased, which wastes a lot of time resources and may cause the loss of data in other pages.
[0049] Combination Figure 1 The exemplary application scenario shown is Figure 3 FIG. 1 is a flow chart showing a flash memory testing method according to an embodiment of the present application. Figure 3 As shown, the steps of the flash memory testing method include:
[0050] In step S301 , the microprocessor 110 a reads data in a page corresponding to a test position through the flash memory interface 110 b .
[0051] In one example, the microprocessor 110a may execute steps S301-S304 according to the test instruction of the host 200, and feed back the test result to the host.
[0052] The page corresponding to the test position may be one page or multiple pages, the corresponding page may include only the test position, or may include other positions in the page except the test position, the test position may be one byte or multiple bytes, and the multiple bytes may be continuous or non-continuous. The byte corresponding to the test position may be referred to as a to-be-tested area, and the data at the test position may be referred to as first data.
[0053] by Figure 2 For example, if the test position to be tested is the 2nd byte and the 10th byte in page 2, the read data may be all the data in page 2. According to the read data, it can be determined that the 2nd byte and the 10th byte in page 2 (i.e., the bytes corresponding to the test position) are the first data.
[0054] Step S302: the microprocessor 110a determines a test vector according to the read data.
[0055] According to the read data, the test vector can be determined according to the needs of the test. Among them, according to the read data, the bytes at the test position where no data is written, and which bits in the bytes where data is written can be rewritten before erasing can be determined, and the test vector corresponds to the bytes where no data is written, and the bits in the bytes where data is written can be rewritten before erasing, and the vector type of the test vector can be any one of an all-0 vector, an all-1 vector, a checkerboard vector, a march pattern vector, and a galloping pattern vector, and the vector type can also be any other vector, which is not limited in this application.
[0056] The functional test performed on the test position may include a short circuit test, an open circuit test, an interference test, an address error test, etc. Among them, the above-mentioned vector type may correspond to the function of the test. For example, when the vector type is an all-0 vector or an all-1 vector, the functional test performed may be a short circuit test or an open circuit test for the test position; when the vector type is a checkerboard vector (or a march pattern vector or a galloping pattern vector), the functional test performed may be an address error test or an interference test for the test position. Those skilled in the art can determine the correspondence between the vector type and the test function as needed in combination with the prior art.
[0057] It should be noted that when the test position includes a byte to which data has not been written, it can be considered that the byte can be rewritten before erasing, and the vector type of the test vector corresponding to the byte can be determined as one or more of the above-mentioned vector types as needed. In the case where the test position includes a byte to which data has been written, the function of the bit in the byte that cannot be rewritten before erasing (for example, the bit with a value of 1 in the byte to which data has been written) cannot be tested, and the function of the bit in the byte that can be rewritten before erasing (for example, the bit with a value of 0 in the byte to which data has been written) can be tested. The test vector can correspond to the bit in the byte to which the value can be rewritten, and the vector type can refer to one or more of the above-mentioned vector types. In this case, the test object can be changed from a byte to one or more bits in the byte that can be functionally tested.
[0058] In step S303 , the microprocessor 110 a writes the page containing the test vector into the test location in the flash memory through the flash memory interface 110 b .
[0059] Since the flash memory uses pages as units when writing data, and each write starts from the first byte of the corresponding page, one or more pages of data containing the test vector can be written to the one or more pages where the test position is located, wherein the length of the written data can be determined according to the number of pages of the byte distribution corresponding to the test position. Figure 2 For example, if the positions of the 2nd byte and the 10th byte in page 2 need to be tested, the length of the written data can be determined to be 1 page. If the 2nd byte in page 2 and the position of the 10th byte in page 3 need to be tested, the length of the written data is 2 pages.
[0060] At the same time, if you want to keep the data in other locations in the flash memory except the test location unchanged during testing, you can make the values of the bits in the written data, except for the test vector, consistent with the values of the corresponding bits of the data read from one or more pages corresponding to the test location in step S301, so that the original data will not be modified.
[0061] The written data may include multiple test vectors corresponding to different test positions, and the vector types of the test vectors may be the same or different, so that multi-position and multi-type test tasks can be completed quickly.
[0062] In step S304, the microprocessor 110a reads the data in the page corresponding to the test position again through the flash memory interface 110b, and determines whether the function of the test position is normal according to the read data.
[0063] When the function of the test position is normal, the data corresponding to the test position read in this step is consistent with the data in the test vector corresponding to the written test position; otherwise, it can be confirmed that the function of the test position is abnormal.
[0064] by Figure 2 For example, if the test position is the 10th byte in the 2nd page of the flash memory, and no data is written to the 10th byte before the test starts, if the data value of the 10th byte read out is consistent with the data value of the test vector of the 10th byte written in step S303, then it can be determined that the corresponding function of the 2nd page and the 10th byte in the flash memory is normal; otherwise, if the data value of the 10th byte read out again is inconsistent with the data value of the test vector of the 10th byte written in step S303, then it can be determined that the corresponding function of the 2nd page and the 10th byte in the flash memory is abnormal.
[0065] Still Figure 2 For example, if the test position is the second byte in the second page of the flash memory, the byte is the byte with written data. If in step S301, it is determined that the first 4 bits of the 8 bits in the second byte read for the first time cannot be written before erasing (for example, the first 4 bits have been written with 1), and the last 4 bits can be written before erasing (for example, the last 4 bits have been written with 0), then the test object can be changed to the last 4 bits in the second byte, and the test vector can correspond to the last 4 bits of the second byte. In the written data, the bits other than the test vector can be consistent with the bits read in step S301. For example, the values of the first 4 bits of the second byte in the written data can be consistent with the values of the first 4 bits of the second byte read in step S301 (for example, also 1111). When the value of the last 4 bits of the second byte read out is consistent with the data value of the test vector written in step S303, it can be said that the functions of the last 4 bits of the second page and the second byte are normal. Otherwise, when the last 4 bits of the value of the second byte read out again are inconsistent with the data value of the test vector written in step S303, it can be said that the functions of the last 4 bits of the second page and the second byte are abnormal.
[0066] As an example, in the above test process, after determining the test vector corresponding to the test position in S302, if the test vector is an all-0 vector, an all-1 vector, or a checkerboard vector, in S303, after writing the page containing the test vector to the test position in the flash memory, it can be determined whether the function of the test position is normal based on whether the data in the page corresponding to the test position read in S304 is consistent with the value of the written test vector. Among them, the all-0 vector can be, for example, [0,0,0...0,0], that is, the value of each element in the vector is 0; the all-1 vector can be, for example, [1,1,1.......1,1], that is, the value of each element in the vector is 1; the checkerboard vector can be, for example, [0,1,0...1,0] or [1,0,1...0,1], that is, the values of adjacent elements in the vector are opposite.
[0067] When the vector type of the test vector is a march pattern vector, for example, in S303, an all-0 vector can be written to the test position first, and in S304, the value of the test position corresponding to the first element in the vector is read. When the read value is 0, it can be determined that the function of the test position corresponding to the first element is normal. Then, the process can return to S303, and in S303, 1 is written to the test position corresponding to the first element. In S304, the value of the test position corresponding to the second element in the vector is read. When the read value is 1, it can be determined that the function of the test position corresponding to the second element is normal. For the test positions corresponding to the third element to the last element in the vector, the process can be deduced accordingly, and the process of testing the functions of the test positions corresponding to the elements in the vector in S303 and S304 can be repeated.
[0068] In the case where the vector type of the test vector is a galloping pattern vector, for example, in S303, a vector of all 0s can be written to the test position first, and 1 can be written to the test position corresponding to the first element in the vector to determine the test position as the reference position. In S304, the value of the test position corresponding to the second element in the vector is read, and the value of the reference position is read. When the value of the read test position is 0 and the value of the read reference position is 1, it can be determined that some functions of the test position corresponding to the first element are normal. Then, return to S303, write 0 to the test position corresponding to the second element, and read the value of the test position corresponding to the second element in S304. When the read value is 0, the reference position is returned to S305. In this case, it can be determined that some functions of the test position corresponding to the second element are normal; for the third element to the last element in the vector, the above process of writing 1 to the test position corresponding to the first element in the vector and the subsequent process can be repeated. After completing all operations with the test position corresponding to the first element as the reference position, 1 can be written to the test position corresponding to the second element in the vector in S303, and the test position corresponding to the second element in the vector can be used as the reference position. The process after determining the reference position is repeated until the test positions corresponding to all elements in the vector are used as the reference positions to determine whether the functions of all test positions are normal.
[0069] Optionally, after the test, the original data of the test position can be restored according to the value read in step S301 as needed. For example, the value read in step S301 can be rewritten after erasing the data modified during the test.
[0070] Figure 4 FIG. 4 is a flow chart showing a flash memory test method according to an embodiment of the present application. The method can be used in a terminal device, for example, the microprocessor 100a described above in the terminal device, such as Figure 4 As shown, the method includes:
[0071] Step S401, reading first data from a to-be-tested area of a flash memory;
[0072] Step S402, generating a test vector according to the first data;
[0073] Step S403, performing a data writing operation on the flash memory according to the test vector, so that the second data is stored in the area to be tested;
[0074] Step S404, reading the second data from the area to be tested, and determining a test result for the area to be tested according to whether the second data is consistent with the test vector.
[0075] According to an embodiment of the present application, by reading first data from an area to be tested of a flash memory; generating a test vector based on the first data; performing a data writing operation on the flash memory based on the test vector so that second data is stored in the area to be tested; reading the second data from the area to be tested, and determining a test result for the area to be tested based on whether the second data is consistent with the test vector, it is possible to flexibly determine a test vector for testing based on the storage of the first data in the area to be tested when testing the function of the area to be tested, and at the same time reduce the number of flash memory erase times, save time, increase the service life of the flash memory, and prevent data in non-areas to be tested from being modified by mistake.
[0076] The area to be tested may be the test position mentioned above. For example, each area to be tested may be a byte, wherein the bytes corresponding to the multiple areas to be tested may be distributed in one page or multiple pages. The area to be tested may be pre-set according to the needs of the test, and the area to be tested may be continuous or discontinuous, which is not limited in this application. The first data may be the above Figure 3 In step S301, the data read out corresponds to the test position, and the second data may be the data in the above Figure 3 In step S303, the data of the test vector corresponding to the test position in the data of the flash memory is written.
[0077] When the second data is consistent with the test vector, it can be determined that the function of the area to be tested is normal; when the second data is inconsistent with the test vector, it can be determined that the function of the area to be tested is abnormal.
[0078] Examples of steps S401-S404 can be found in Figure 3 Steps S301-S304.
[0079] In a possible implementation, performing a data writing operation on a flash memory according to the test vector includes: performing a data writing operation on the flash memory according to the test vector without performing an erasing operation.
[0080] According to an embodiment of the present application, by performing a data writing operation on the flash memory according to the test vector without performing an erasing operation, it is possible to test the function of the area to be tested without erasing the entire block or sector in the flash memory, thereby preventing data loss in non-test areas and improving the service life of the flash memory.
[0081] In a possible implementation, generating a test vector based on the first data includes: when it is determined based on the first data that all or part of the bits in the area to be tested can be rewritten with data before erasure, generating a test vector for the all or part of the bits.
[0082] According to the embodiment of the present application, by: determining, based on the first data, that all or part of the bits in the area to be tested can be rewritten with data before erasing, generating a test vector for the all or part of the bits, when testing the function of the area to be tested, it is possible to test the area to be tested in which no data is written, and it is also possible to test all or part of the bits in the area to be tested in which data is written and which can be rewritten with data before erasing, thereby making the test more free and flexible.
[0083] The test vector generated for all or part of the bits may be determined according to the needs of the test.
[0084] For example, the area to be tested can be the second byte in the second page of the flash memory. Based on the first data, it can be determined that the second byte is the byte with written data, and the first four bits in the byte cannot be written with values before erasing (for example, all are 1), and the last four bits can be written with values before erasing (for example, all are 0). In one possible implementation method, the vector type of the test vector corresponding to the last four bits of the second byte can be determined according to the function of the test, such as an all-0 vector, an all-1 vector, and so on.
[0085] In a possible implementation, the vector type of the test vector corresponds to a function to be tested.
[0086] Therefore, it is possible to flexibly select the type of test vector according to the test requirements to test whether the corresponding function is normal.
[0087] In a possible implementation, the vector type may include one or more of an all-0 vector, an all-1 vector, a checkerboard vector, a marchpattern vector, and a galloping pattern vector.
[0088] In a possible implementation, the test may include one or more of a short circuit test, an open circuit test, an interference test, and an address error test for the area to be tested.
[0089] Therefore, it is possible to test different functions of the area to be tested according to the test needs, making the test content more flexible and rich.
[0090] Examples of how vector types correspond to the functionality of the tests can be found above.
[0091] Figure 5 FIG. 2 shows a structural diagram of a flash memory test device according to an embodiment of the present application. The device can be used in a terminal device, for example, the microprocessor 100a described above in the terminal device, such as Figure 5 As shown, the device comprises:
[0092] The first module 501 is used to read first data from a to-be-tested area of a flash memory;
[0093] A second module 502, configured to generate a test vector according to the first data;
[0094] The third module 503 is used to perform a data writing operation on the flash memory according to the test vector, so that the second data is stored in the area to be tested;
[0095] The fourth module 504 is used to read the second data from the area to be tested, and determine a test result for the area to be tested according to whether the second data is consistent with the test vector.
[0096] According to an embodiment of the present application, by reading first data from an area to be tested of a flash memory; generating a test vector based on the first data; performing a data writing operation on the flash memory based on the test vector so that second data is stored in the area to be tested; reading the second data from the area to be tested, and determining a test result for the area to be tested based on whether the second data is consistent with the test vector, it is possible to flexibly determine a test vector for testing based on the storage of the first data in the area to be tested when testing the function of the area to be tested, and at the same time reduce the number of flash memory erase times, save time, increase the service life of the flash memory, and prevent data in non-areas to be tested from being modified by mistake.
[0097] In a possible implementation, performing a data writing operation on a flash memory according to the test vector includes: performing a data writing operation on the flash memory according to the test vector without performing an erasing operation.
[0098] According to an embodiment of the present application, by performing a data writing operation on the flash memory according to the test vector without performing an erasing operation, it is possible to test the function of the area to be tested without erasing the entire block or sector in the flash memory, thereby preventing data loss in non-test areas and improving the service life of the flash memory.
[0099] In a possible implementation, generating a test vector based on the first data includes: when it is determined based on the first data that all or part of the bits in the area to be tested can be rewritten with data before erasure, generating a test vector for the all or part of the bits.
[0100] According to the embodiment of the present application, by: determining, based on the first data, that all or part of the bits in the area to be tested can be rewritten with data before erasing, generating a test vector for the all or part of the bits, when testing the function of the area to be tested, it is possible to test the area to be tested in which no data is written, and it is also possible to test all or part of the bits in the area to be tested in which data is written and which can be rewritten with data before erasing, thereby making the test more free and flexible.
[0101] In a possible implementation, the vector type of the test vector corresponds to a function to be tested.
[0102] Therefore, it is possible to flexibly select the type of test vector according to the test requirements to test whether the corresponding functions are normal.
[0103] In a possible implementation, the vector type may include one or more of an all-0 vector, an all-1 vector, a checkerboard vector, a march pattern vector, and a galloping pattern vector.
[0104] In a possible implementation, the test includes one or more of a short circuit test, an open circuit test, an interference test, and an address error test for the area to be tested.
[0105] Therefore, it is possible to test different functions of the area to be tested according to the test needs, making the test content more flexible and rich.
[0106] In a possible implementation, each of the to-be-tested areas is one byte.
[0107] An embodiment of the present application further provides a terminal device, characterized in that the terminal device includes a flash memory controller, and the flash memory controller is used to execute the above method.
[0108] An embodiment of the present application also provides a flash memory testing device, comprising: a processor; and a memory for storing processor executable instructions; wherein the processor is configured to execute the above method.
[0109] An embodiment of the present application further provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions implement the above method when executed by a processor.
[0110] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0111] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0112] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0113] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0114] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0115] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0116] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0117] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0118] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A flash memory testing method, characterized in that: The method comprises: Reading first data from a to-be-tested area of the flash memory; Generate a test vector according to the first data; Performing a data writing operation on the flash memory according to the test vector so that the second data is stored in the area to be tested; Read the second data from the area to be tested, and determine a test result for the area to be tested according to whether the second data is consistent with the test vector; Generating a test vector according to the first data includes: When it is determined based on the first data that all or part of the bits in the area to be tested can be rewritten with data before being erased, a test vector for all or part of the bits is generated.
2. The method according to claim 1, characterized in that Performing a data writing operation on the flash memory according to the test vector includes: Without performing an erase operation, a data writing operation is performed on the flash memory according to the test vector.
3. The method according to claim 1 or 2, characterized in that: The vector type of the test vector corresponds to the function of the test.
4. The method according to claim 3, characterized in that The vector type includes one or more of an all-0 vector, an all-1 vector, a checkerboard vector, a march pattern vector, and a galloping pattern vector.
5. The method according to claim 1 or 2, characterized in that: The test includes one or more of a short circuit test, an open circuit test, an interference test, and an address error test for the area to be tested.
6. The method according to claim 1 or 2, characterized in that: Each of the areas to be tested is one byte.
7. A flash memory testing device, characterized in that: The device comprises: A first module is used to read first data from a to-be-tested area of the flash memory; A second module is used to generate a test vector according to the first data; A third module is used to perform a data writing operation on the flash memory according to the test vector, so that the second data is stored in the area to be tested; A fourth module is used to read the second data from the area to be tested, and determine a test result for the area to be tested according to whether the second data is consistent with the test vector; Generating a test vector according to the first data includes: When it is determined based on the first data that all or part of the bits in the area to be tested can be rewritten with data before being erased, a test vector for all or part of the bits is generated.
8. A terminal device, characterized in that: The terminal device comprises a flash memory controller, and the flash memory controller is used to execute the method according to any one of claims 1-7.
9. A flash memory testing device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1-6.
10. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Memory test system and memory test method
CN103093829A
Flash memory chip trimming test method and trimming test device
CN107481765A
Test control circuit, semiconductor memory apparatus and semiconductor system using the test control circuit
CN109949855A
Method and device for testing logical model in chip
CN110082672A
Test algorithm and device for 3D NAND Flash memory
CN111653305A
