Memory and test method thereof

By introducing optimized processing of the status monitoring unit and main control unit into the memory, the problem of firmware internal state machine verification is solved, more comprehensive testing and higher reliability are achieved, and fault analysis is simplified.

CN118675598AActive Publication Date: 2024-09-20合肥康芯威存储技术有限公司

Patent Information

Application Number
CN202411162172.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-09-20
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

In the existing eMMC/UFS storage technology, the verification of the internal state machine of the firmware is difficult to fully monitor, resulting in insufficient test coverage and failure to reveal potential risks and boundary conditions.

Method used

A status monitoring unit is introduced into the memory to monitor the running status of the firmware in real time, including read data status, write data status and mapping table status, and optimize processing in abnormal situations through the main control unit to ensure the comprehensiveness and accuracy of the test.

Benefits of technology

It significantly improves the reliability and test coverage of firmware and main control unit, provides a transparent firmware internal state machine monitoring platform, can accurately detect potential risks and abnormal points, and simplifies fault analysis and debugging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675598A
    Figure CN118675598A
Patent Text Reader

Abstract

The invention provides a memory and a test method thereof, and the memory comprises a main control unit which is used for responding to a read / write instruction and carrying out read / write operation on a memory block through firmware; the data transmission unit is used for writing / reading data into / out of the storage block; the state monitoring unit is used for monitoring the running state of the firmware in real time; wherein the main control unit is also used for sending out a power-off instruction, carrying out power-off processing on the memory, and carrying out power-on again after the memory is powered off; when the main control unit judges that the running state of the firmware is incomplete, the executed actions are as follows: storing the current running state of the firmware, and continuing to perform read / write operation on the storage block; and when the main control unit judges that the firmware cannot work normally, the executed action is to optimize the part with problems in the firmware running process. According to the memory and the test method thereof provided by the invention, the memory can be comprehensively tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage, and in particular to a storage device and a testing method thereof. Background Art

[0002] In the existing eMMC / UFS storage technology, the verification process of the main controller and firmware faces a series of challenges. In particular, for the monitoring of the operation of the internal state machine of the firmware, most of the current technologies use black box testing methods. Although this testing method can verify the memory to a certain extent, it cannot accurately monitor the operation of the firmware, resulting in insufficient test coverage. This limitation cannot fully reveal the boundary conditions and potential risks that may exist in the firmware. Therefore, there is room for improvement. Summary of the invention

[0003] The object of the present invention is to provide a memory and a testing method thereof, which can comprehensively test the memory.

[0004] In order to solve the above technical problems, the present invention is achieved through the following technical solutions: The present invention provides a memory, which is connected to a test board to build a corresponding test environment, and the memory includes: Storage blocks, used to store data; A main control unit, for performing a read / write operation on the storage block through firmware in response to a read / write instruction; a data transmission unit, used for writing / reading data into / from the storage block; and A status monitoring unit, used for monitoring the running status of the firmware in real time, wherein the running status includes a data reading status, a data writing status and a mapping table status; The main control unit is further used to issue a power-off instruction to power off the memory, and to power on the memory again after the memory is powered off; When the main control unit determines that the running state of the firmware is incomplete, the actions performed are: saving the current running state of the firmware and continuing to perform read / write operations on the storage block; When the main control unit determines that the firmware cannot work normally, the action performed is: optimizing the part where the problem occurs during the operation of the firmware.

[0005] In one embodiment of the present invention, after the memory is powered on again, when the main control unit determines that the operating state is complete, the action performed is: repeatedly powering off the memory until the operating state is incomplete.

[0006] In one embodiment of the present invention, after the memory is powered on again, when the main control unit determines that the read data status is incomplete, the action performed is: issuing a feedback instruction, and performing a read operation on the storage block in response to the read instruction of the test board.

[0007] In one embodiment of the present invention, after the memory is powered on again, when the main control unit determines that the data write status is incomplete, the action performed is: saving the relevant information of the firmware writing data when the power is off, and in response to the write instruction of the main control unit, the firmware performs a write operation on the storage block.

[0008] In one embodiment of the present invention, after the memory is powered on again, when the main control unit determines that the mapping table status is incomplete, the action performed is: saving the relevant information written to the mapping table by the firmware when the power is off, and in response to the write instruction of the main control unit, the firmware performs a write operation on the storage block.

[0009] In one embodiment of the present invention, after the memory is powered on again, when the main control unit determines that the firmware can work normally, the action performed is: repeatedly powering off the memory until the firmware cannot work normally.

[0010] The present invention also provides a memory testing method, comprising: Connecting the memory to the test board to build a test environment for the memory; In response to a read / write instruction, a read / write operation is performed on a storage block of the memory, and a running state of the firmware is monitored in real time, wherein the running state includes a read data state, a write data state, and a mapping table state; In response to the power-off instruction, powering off the memory; After power-on, the running state of the firmware is monitored, and when the running state is incomplete, the current running state of the firmware is saved, and the reading / writing operation on the storage block of the memory is continued; The working status of the firmware is monitored, and when the firmware fails to work properly, the problematic part of the firmware is optimized.

[0011] In one embodiment of the present invention, the step of monitoring the running state of the firmware after power-on, saving the current running state of the firmware when the running state is incomplete, and continuing to perform read / write operations on the storage block of the memory includes: After power-on, monitoring the running status of the firmware and determining whether the running status is complete; When the running state is complete, repeatedly powering off the memory until the running state becomes incomplete; When the running state is incomplete, the current running state of the firmware is saved, and the reading / writing operation on the storage block of the memory is continued.

[0012] In one embodiment of the present invention, when the running state is incomplete, the step of saving the current running state of the firmware and continuing to perform a read / write operation on a storage block of the memory includes: When the read data state is incomplete, a feedback instruction is issued, and in response to the test board read instruction, a read operation is performed on the storage block of the memory; When the data writing state is incomplete, saving the relevant information of the firmware writing data when the power is off, and performing a write operation on the storage block of the storage in response to a write instruction of the main control unit of the storage; When the mapping table is incomplete, the related information of the firmware writing into the mapping table when the power is off is saved, and in response to the write instruction of the main control unit of the memory, a write operation is performed on the storage block of the memory.

[0013] In one embodiment of the present invention, the step of monitoring the working state of the firmware and optimizing the part having problems during the operation of the firmware when the firmware fails to work properly comprises: Monitor the working status of the firmware to determine whether the firmware can work normally; When the firmware can work normally, repeatedly power off the memory until the firmware fails to work normally; When the firmware fails to work properly, the part where the problem occurs during the operation of the firmware is optimized.

[0014] As described above, the present invention provides a memory and a test method thereof. By setting a data transmission unit and a state monitoring unit in the memory, the potential risk points of the main control unit and firmware of the memory when encountering an abnormal power failure can be accurately found in the product development stage, significantly improving the reliability and test coverage of the firmware and the main control unit. At the same time, the present application can provide a transparent firmware internal state machine monitoring platform, which can effectively reveal and locate the potential risks and abnormal points of the main control unit and the firmware through controllable verification tests, significantly improving the comprehensiveness and accuracy of the test. The test scheme introduced in the present application is not only systematic and comprehensive, but also can carefully monitor various states and potential risk points in the operation of the firmware through precise control of the test process, providing strong technical support for research and development. Finally, when the risk points of the main control unit and the firmware are detected, the fault site information can be effectively saved, which greatly facilitates the subsequent analysis and debugging work, and solves the problem of low analysis efficiency caused by the loss or insufficiency of fault site information in traditional technologies.

[0015] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0017] Figure 1 A schematic diagram of a test system according to an embodiment of the present invention; Figure 2 is a schematic diagram of a memory in one embodiment of the present invention; Figure 3 A schematic diagram of a monitoring process in one embodiment of the present invention; Figure 4 is a flow chart of a method for testing a memory in one embodiment of the present invention; Figure 5 for Figure 4 Flow chart of step S10; Figure 6 for Figure 4 Flow chart of step S40; Figure 7 for Figure 6 Flow chart of step S43; Figure 8 for Figure 4 Flow chart of step S50 in FIG.

[0018] In the figure: 100, processing module; 200, power module; 300, storage module; 400, memory module; 500, interface module; 600, power management module; 700, first transceiver interface; 800, interrupt module; 900, memory; 910, main control unit; 921, second transceiver interface; 922, transmission interface unit; 930, read-only storage unit; 940, random storage unit; 950, storage block; 960, error correction unit; 970, cache unit; 980, data transmission unit; 990, status monitoring unit; 1000. Monitoring process. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] See also Figure 1 The present invention provides a memory test system capable of testing a memory 900. In the actual application environment of the memory 900, in the case of abnormal power failure, the integrity and stability of data, system images, mapping tables, etc. are protected. The test system may include a test board, a processing module 100, a power module 200, a storage module 300, a memory module 400, an interface module 500, a power management module 600, a first transceiver interface 700, and an interrupt module 800.

[0021] In one embodiment, the processing module 100 may be installed on a test board. The processing module 100 may be a central processing unit (CPU). The central processing unit (CPU) is responsible for interpreting and executing instructions in a program, and controlling and processing data.

[0022] In one embodiment, the power module 200 may be installed on a test board and may provide power to the test board to drive the processing module 100 to work smoothly.

[0023] In one embodiment, the storage module 300 can be installed on the test board. The storage module 300 can be a secure digital card (SD). The storage module 300 can be used as a boot disk of the test board, which can store an operating system, application programs, and other necessary configuration files, so that the test board can boot and run from the SD card.

[0024] In one embodiment, the memory module 400 may be mounted on the test board. The memory module 400 may be a dynamic random access memory (DRAM). The memory module 400 may be used to store data and program codes so that the processing module 100 can quickly access them.

[0025] In one embodiment, the interface module 500 can be installed on the test board. The interface module 500 can be a Universal Serial Bus (USB). The interface module 500 can be used to connect various peripheral devices (such as keyboard, mouse, printer, mobile hard disk, etc.). The processing module 100 can communicate data and provide power with the peripheral devices through the interface module 500.

[0026] In one embodiment, the power management module 600 may be installed on the test board. The power management module 600 may be a power management integrated circuit (PMIC). The power management module 600 may be used to control the conversion, distribution and management of the power module 200. The power management module 600 may also accurately control the power on and off of the VCC / VCCQ pins of the memory 900 to ensure the power on and off of the memory 900.

[0027] In one embodiment, the first transceiver interface 700 may be installed on a test board. The first transceiver interface 700 may be a Universal Asynchronous Receiver / Transmitter (UART). The processing module 100 may communicate with the peripheral device via the first transceiver interface 700 to exchange data.

[0028] In one embodiment, the interrupt module 800 can be installed on the test board. The interrupt module 800 can be an interrupt service routine hardware (ISR). The interrupt module 800 can enable the memory 900 to be able to respond to a specific event (power on, power off) without the need for the processing module 100 to continuously query the status of the memory 900. The memory 900 uses the interrupt module 800 to send a signal to the processing module 100 when a specific event occurs, and the processing module 100 will process the interrupt signal immediately after receiving it.

[0029] In one embodiment, the memory 900 may be a memory to be tested. The type of the memory to be tested may be an embedded MultiMediaCard (eMMC) or a Universal Flash Storage (UFS). The memory 900 may communicate with the processing module 100 through the CMD line and the DATA0~7 lines, and perform operations such as reading, writing, and erasing by receiving instructions from the processing module 100. The processing module 100 may send instructions through the CMD line and transmit data through the DATA0~7 lines. The line between the memory 900 and the processing module 100 may follow the JEDEC protocol.

[0030] See also Figure 2 The present invention also provides a memory, and the memory 900 may include a main control unit 910, a second transceiver interface 921, a transmission interface unit 922, a read-only storage unit 930, a random storage unit 940, a storage block 950, an error correction unit 960, a cache unit 970, a data transmission unit 980, and a status monitoring unit 990.

[0031] In one embodiment, the main control unit 910 may be a microcontroller unit (MCU). The main control unit 910 may be used to perform specific control tasks, such as reading data, processing instructions from the processing module 100, etc. The processing core of the main control unit 910 may be designed based on the RISC-V architecture to perform various control and computing tasks.

[0032] In one embodiment, the second transceiver interface 921 may be connected to the main control unit 910. The second transceiver interface 921 may also be an asynchronous transceiver transmitter. The main control unit 910 may communicate serially with peripheral devices through the second transceiver interface 921 to exchange data.

[0033] In one embodiment, the transmission interface unit 922 may be a transmission interface between the main control unit 910 and the processing module 100. The transmission interface unit 922 may receive instructions from the processing module 100, and return data or status information to the processing module 100. The transmission interface unit 922 may receive instructions from the processing module 100 through the CMD line and the DATA line, perform corresponding read / write operations, and return result data or execution status to the processing module 100 through the DATA line.

[0034] In one embodiment, the read-only storage unit 930 may be a non-volatile memory (ROM) for long-term data storage. Firmware may be stored in the read-only storage unit 930. The firmware may be a set of pre-written instructions that instruct the main control unit 910 on how to start and run. These instructions include device initialization, peripheral configuration, and a possible boot loader. The boot loader may be used to load an updated program or operating system, etc.

[0035] In one embodiment, the random access memory unit 940 may be a volatile memory (Random Access Memory, RAM) for temporarily storing data and program codes. The random access memory unit 940 may be used to temporarily store data. When the main control unit 910 executes a program, the program code may be loaded from the read-only storage unit 930 into the random access memory unit 940 for execution.

[0036] In one embodiment, the storage block 950 may be a physical unit for storing data in the memory 900. The memory 900 may be composed of a plurality of storage blocks 950. Each storage block 950 may contain a plurality of pages. Each page is the minimum unit of a read / write operation, and a block is the minimum unit of an erase operation. Data is usually read and written in units of pages, and the entire block needs to be erased when erasing.

[0037] In one embodiment, the error correction unit 960 may check the data integrity to detect and correct data errors in the memory 900 or during transmission. The error correction unit 960 may use a low-density parity check (LDPC) method for checking.

[0038] In one embodiment, the cache unit 970 can be used as a high-speed temporary storage area between the main control unit 910 and the random access storage unit 940 to store data and instructions frequently accessed by the main control unit 910 to achieve the function of accelerating data transmission.

[0039] In one embodiment, a data transmission unit 980 (Direct Memory Access Engine, DMAEngine) may be connected between the error correction unit 960 and the storage block 950. By configuring different DMA channels (such as CODE DMA, Table DMA, DATA DMA) through the data transmission unit 980, the parallel data processing capability within the main control unit 910 can be enhanced.

[0040] Specifically, by adding a data transmission unit 980 to the memory 900, it is possible to manage and execute data transmission tasks between memories, reducing the burden on the main control unit 910. The data transmission unit 980 can automatically handle the reading, transmission and writing of data, allowing the main control unit 910 to process data transmission in parallel while processing other tasks.

[0041] Furthermore, the data transfer unit 980 assigns DMA operations to different channels (e.g., CODE DMA is used for code execution data, Table DMA is used for table lookup data, and DATA DMA is used for general data transfer), which can effectively parallelize different types of data operations. Improving the parallel capability of data processing is crucial for accelerating response time, improving user experience, and processing complex calculations. The introduction of different DMA channels can meet the needs of data-intensive application scenarios while ensuring that data is quickly and accurately transferred between different processing units and the memory 900.

[0042] In one embodiment, the state monitoring unit 990 (Firmware State Unit, FW STATE) may be connected between the main control unit 910 and the data transmission unit 980. The state monitoring unit 990 may track and monitor the running state of the firmware, including whether it is running normally, whether an error is encountered, or whether a specific event occurs.

[0043] Specifically, by adding the status monitoring unit 990 to the memory 900, the firmware status information can be transmitted to the specified memory location in the automated data transmission process without the participation of the main control unit 910. The status monitoring unit 990 can improve the efficiency and response speed of monitoring because DMA can process data quickly and in parallel.

[0044] Furthermore, the data transmission unit 980 cooperates with the status monitoring unit 990 to monitor the status of the firmware in real time and without delay, such as the operating status, performance indicators, error logs, etc. When the status monitoring unit 990 updates the status, the main control unit 910 can check the status information. For example, in some cases, the status monitoring unit 990 may trigger an interrupt request, which can then notify the main control unit 910 to immediately process a specific event.

[0045] Furthermore, when the main control unit 910 learns through the ISR that the status monitoring unit 990 indicates that an event has occurred that requires power management (for example, the memory needs to be restarted, the memory needs to be powered on or off, enter a low power consumption mode, or resume normal working state), the main control unit 910 can send instructions to the processing module 100 to perform corresponding power on and off operations.

[0046] In one embodiment, when the memory 900 needs to be tested, a test board can be used to build a test environment for the memory 900 .

[0047] In one embodiment, during the process of building a test environment, the processing module 100 can be used to download a system image file to a test board.

[0048] Specifically, the processing module 100 can be used to download the system image file to the storage module 300. The system image file is run by the storage module 300 to quickly deploy and start the operating system and test program. The system image file can be a complete software including the operating system, application programs, drivers, and system settings.

[0049] In one embodiment, after the system image file is burned into the storage module 300, the memory 900 can be connected to the test board to initialize the memory 900, thereby completing the construction of the test environment.

[0050] Specifically, the initialization process of the memory 900 refers to performing a series of settings and preparations before the memory 900 can be used normally, including setting the size, speed, timing, voltage and other operating parameters of the memory to ensure that the memory 900 can operate stably under a specific operating environment.

[0051] After the initialization process of the memory 900 is completed, the memory 900 can be used as a subsidiary disk and a full capacity test can be performed on the memory 900 to test all available space of the memory 900 to ensure that each part can work normally.

[0052] In one embodiment, after the test environment is built, the memory 900 can be tested. During the test, the processing module 100 can send a read / write instruction to the main control unit 910 through the transmission interface unit 922. The main control unit 910 can respond to the read / write instruction to perform a read / write operation on the storage block 950 through the data transmission unit 980.

[0053] In one embodiment, the status monitoring unit 990 can monitor the running status of the firmware in real time during the process of the main control unit 910 performing read / write operations on the storage block 950. The running status of the firmware can include the read data status, the write data status and the mapping table status.

[0054] In one embodiment, when the main control unit 910 performs a read operation on the storage block 950, the status monitoring unit 990 can monitor the firmware's data read status in real time. The read operation refers to the process in which the program in the firmware controls the main control unit 910 to perform a data read operation and reads data from the storage block 950. The firmware can control the main control unit 910 to read data, which includes the conversion of logical to physical addresses, the selection of data transmission paths, etc.

[0055] Furthermore, in the process of monitoring the firmware data read status, data such as [Total Data, Mapping Table] can be monitored. Total Data refers to the overall data in the memory 900, which includes user data and some system data that cannot be directly accessed. Mapping Table records the mapping relationship between the logical address and the physical address of the storage block 950.

[0056] Furthermore, when the main control unit 910 processes the read operation, the firmware will continuously monitor the read data status of the entire read process to ensure normal operation. The monitoring of the read data status may include error checking, verification, retry logic and other fault handling mechanisms.

[0057] In one embodiment, when the main control unit 910 performs a write operation on the storage block 950, the status monitoring unit 990 can monitor the data writing status of the firmware in real time. The write operation refers to the process in which the program in the firmware controls the main control unit 910 to perform a data write operation and writes data into the storage block 950. The firmware can control the main control unit 910 to write data, which includes how to physically store, how to allocate space, how to achieve wear leveling, and how to manage bad blocks.

[0058] Furthermore, in the process of monitoring the firmware data writing status, data such as [Host Data, GCData] can be monitored. Host Data refers to data from the processing module 100, that is, data that needs to be written into the storage block 950. GC Data refers to data that is moved or sorted during the garbage collection (GC) process.

[0059] Furthermore, when the main control unit 910 processes the write operation, the firmware will continuously monitor the write data status of the entire write process to ensure that it proceeds normally. The monitoring of the write data status may include the successful writing of data, the detection and processing of possible write errors, the management of the wear leveling and bad block mapping of the write process, etc.

[0060] In one embodiment, when the main control unit 910 performs a write operation on the storage block 950, the status monitoring unit 990 can also monitor the mapping table status of the firmware in real time. The mapping table refers to a data structure used to maintain data location information in the memory 900. The mapping table can provide a conversion from a logical address to a physical address.

[0061] Furthermore, in the process of monitoring the mapping table status of the firmware, data such as [Update Table, GC Table] can be monitored. Among them, Update Table refers to a table that maintains the mapping information of data write operations. This table records the locations of the storage block 950 from which the data is written, and how the data at these locations is updated and changed over time. Update Table can be used to quickly locate data and track the latest status of the data. GC Table refers to a table closely related to the garbage collection process. GC Table can record information about the space that needs to be reclaimed, as well as the new location of the data moved during the garbage collection process.

[0062] Furthermore, when the main control unit 910 processes the write operation, the firmware will continuously monitor the mapping table status of the entire write process to ensure normal operation. While writing data, the firmware also needs to write or update tables directly related to the storage operation. Since the data in the memory 900 is dynamically managed, all write, update and delete operations need to be reflected in the mapping table to maintain data consistency and accessibility.

[0063] In one embodiment, during the process of the memory 900 performing a read / write operation, the main control unit 910 can send a power-off instruction to the processing module 100 at any time through the interrupt module 800. After receiving the power-off instruction, the processing module 100 can control the power management module 600 to perform a power-off operation on the lines (VCC and VCCQ) of the memory 900. Among them, VCC refers to the main power supply voltage of the memory 900, and VCCQ refers to the I / O port power supply voltage of the memory 900.

[0064] In one embodiment, after the power-off process of the memory 900 is completed, the main control unit 910 may issue a power-on instruction to the power management module 600, thereby controlling the power management module 600 to power on the memory 900. Since the read / write operation of the memory 900 is interrupted due to the power-off, after the power-on of the memory 900 is completed, the state monitoring unit 990 may re-monitor the running state of the firmware, and the main control unit 910 may determine whether the running state of the firmware is complete.

[0065] Specifically, in the process of the main control unit 910 judging whether the running status of the firmware is complete, it can judge whether the read data status is complete, whether the write data status is complete, and whether the mapping table status is complete according to the operation performed by the current firmware. For example, when the firmware is performing a read operation, the main control unit 910 can judge whether the read data status is complete. For another example, when the firmware is performing a write operation, the main control unit 910 can judge whether the write data status and the mapping table status are complete.

[0066] In one embodiment, when the main control unit 910 determines whether the read data status of the firmware is complete, a startup recovery sequence, an error detection and correction code, etc. may be used to verify whether the read data status is complete.

[0067] For example, the firmware may include a startup recovery sequence, which may be automatically executed after the memory 900 is powered on. The sequence may check the data structure inside the memory 900, including the Total Data and the Mapping Table, to determine whether their states are consistent and not damaged. If the states are consistent, it means that the read data state is complete, otherwise, it means that the read data state is incomplete.

[0068] For another example, the firmware can verify whether the read data status is complete by using error detection and correction code (ECC). When the power is turned on again after power failure, the firmware can detect whether the read data status is complete by performing ECC verification on the data. If the verification passes, it means that the read data status is complete, otherwise, it means that the read data status is incomplete.

[0069] In one embodiment, when the main control unit 910 determines whether the write data status of the firmware is complete, log verification, CRC verification, ECC verification, etc. can be used to verify whether the write data status is complete.

[0070] For example, the firmware can use the Write-Ahead Logging (WAL) method to verify whether the write data status is complete. The transaction log of the log verification can record all modification operations, ensuring that even in unexpected situations such as power failure, these operations can be replayed or undone from the log to restore to a consistent state. If the verification passes, it means that the write data status is complete, otherwise, it means that the write data status is incomplete.

[0071] In one embodiment, when the main control unit 910 determines whether the mapping table status of the firmware is complete, timestamp verification, log verification, CRC verification, ECC verification, etc. can be used to verify whether the mapping table status is complete.

[0072] For example, the firmware can verify the integrity of the mapping table state by means of timestamp verification. The firmware can implement version control or timestamp mechanisms for each table entry or the entire table in the mapping table, thereby allowing detection after power is restored of which tables were successfully updated during the power outage and which may have been interrupted by the power outage. By comparing timestamps, the firmware can determine whether the mapping table state is complete.

[0073] In one embodiment, when the main control unit 910 determines that the running state of the firmware is complete, the main control unit 910 can continue to execute the current read / write operation, and then send a power-off instruction to the processing module 100 through the interrupt module 800. By repeatedly powering off and powering on the memory 900, the firmware can be repeatedly stress-tested until the running state in the firmware is incomplete.

[0074] In one embodiment, when the main control unit 910 determines that the running status of the firmware is incomplete, the current running status of the firmware can be saved, and the read / write operation on the storage block 950 can be continued.

[0075] Furthermore, when the firmware read data status is incomplete, it can indicate that the data is incorrect or incomplete. At this time, the main control unit 910 can return a specific error signal (DATA Timeout) to the processing module 100 to inform the processing module 100 that the data reading failed and the returned data is unreliable. Afterwards, the processing module 100 can repeatedly initiate the read instruction to read the required data from the storage block 950 again.

[0076] Furthermore, when the firmware write data state is incomplete, it can indicate data corruption or inconsistent state. At this time, the firmware can quickly save the current operation and related information (such as the logical address, physical address, completed data size, environmental status flag, etc. of the data to be written) to the storage block 950. After powering on again, the main control unit 910 will check the key status information saved when the power is off. If an unfinished write operation is detected, the main control unit 910 will read the saved address information and other status data. After confirming that there is no risk of data corruption, the main control unit 910 can issue a write instruction, and the firmware can use the saved information to continue or retry the previously unfinished write operation according to the write instruction. After completing the write operation, data verification can be performed, such as using mechanisms such as CRC or ECC to ensure that the written data is correct.

[0077] Further, when the mapping table state of the firmware is incomplete, it can be indicated that there is a problem with the mapping table. At this time, the firmware can save the mapping table currently being written to the storage block 950, which includes key information such as the target address of the write, the degree of the completed write, etc. After powering on again, the main control unit 910 will read the previously saved mapping table state to determine whether there is an unfinished write operation, and then the main control unit 910 can issue a write instruction, and the firmware can safely continue the unfinished write operation according to the write instruction. After the write operation is completed, the main control unit 910 will verify the accuracy and integrity of the data, for example, using mechanisms such as CRC or ECC to ensure that the mapping table is correct.

[0078] In one embodiment, when the main control unit 910 determines that the running state of the firmware is incomplete, the current running state of the firmware can be saved, and the read / write operation can continue to be performed on the storage block 950. Due to the sudden power failure of the memory 900, the firmware may be damaged at this time, resulting in failure to perform the read / write operation. At this time, the working state of the firmware needs to be monitored by the state monitoring unit 990, and the main control unit 910 can determine whether the firmware can work normally.

[0079] In one embodiment, when the main control unit 910 determines that the firmware can work normally, that is, the firmware can continue to perform read / write operations after powering on again, the memory 900 can be repeatedly powered off until the firmware fails to work normally.

[0080] In one embodiment, when the main control unit 910 determines that the firmware cannot work properly, that is, the firmware cannot continue to perform read / write operations after powering on again, this may indicate that there is a problem with the firmware, and the part of the firmware that has problems during operation is optimized.

[0081] In one embodiment, when the read data status is incomplete and causes the firmware to fail to work properly, the firmware can be optimized using ECC verification mechanism, log mechanism, incremental update and checkpoint mechanism, continuous monitoring and dynamic adjustment mechanism, etc.

[0082] For example, when the firmware is optimized by using an ECC check mechanism, for errors that can be repaired, the firmware should automatically repair them through ECC. For problems that cannot be repaired directly, the firmware can preset an error handling strategy.

[0083] For example, when optimizing firmware using a log mechanism, the risk of incomplete data reads can be reduced by implementing a log recording mechanism. Logging before critical data operations can ensure that the interval can be rolled back to the most recent consistent state after a power outage.

[0084] For another example, when optimizing the firmware using incremental updates and checkpoint mechanisms, incremental updates can be used instead of full updates to reduce the risk of data corruption. At the same time, checkpoints are set to save the current state when the system is running stably. After a power outage and restart, if data inconsistencies are found, the most recent checkpoint state can be restored.

[0085] For another example, when the firmware is optimized using a continuous monitoring and dynamic adjustment mechanism, the state of the memory 900 can be continuously monitored, and the operation strategy can be dynamically adjusted according to the state of the memory 900, such as reducing data writing operations when frequent power failures are detected to ensure data consistency and integrity.

[0086] Through these strategies, the firmware recovery process after power failure can be optimized to a certain extent, the problems caused by incomplete data read status can be reduced, and the stability of the firmware and the security of the data can be improved.

[0087] In one embodiment, when the write data status is incomplete and causes the firmware to fail to work properly, the firmware can be optimized using write failure recovery mechanism, data structure atomic operation mechanism, log mechanism, write buffer and cache management mechanism.

[0088] For example, when optimizing the firmware by using a write failure recovery mechanism, the failure recovery mechanism can be pre-written in the firmware. The failure recovery mechanism refers to transaction management of write operations to ensure that the operation can be rolled back to a safe state when a failure occurs, or that an unfinished write operation can be completed after power is restored.

[0089] For another example, when optimizing firmware by using the atomic operation mechanism of data structures, the data structures and write operations can be designed in the firmware to maintain atomicity, so that each write operation is complete and indivisible. In this way, even if a power outage occurs during the operation, the system can maintain data consistency and integrity.

[0090] For another example, when optimizing the firmware using a log mechanism, a log system can be set up. The log system can record the details of ongoing write operations. After a power outage and restart, the firmware can understand which operations were interrupted through the log, and thus decide which write operations need to be re-executed or canceled.

[0091] For another example, when the firmware is optimized by using a write buffer and cache management mechanism, the firmware can optimize the write buffer and cache management strategy to ensure that data is safely stored before being finally written. In the event of a power outage, the data in the cache can be quickly persisted or marked for rapid recovery after power is restored.

[0092] Through the above method, the ability of the firmware to recover to a normal state after power failure can be significantly increased, the security of data and the reliability of the device can be improved, and the negative impact of power failure on data integrity can be minimized.

[0093] In one embodiment, when the mapping table status is incomplete and the firmware cannot work properly, the firmware can be optimized by using log verification, checkpoint mechanism, version control and snapshot mechanism, double buffer mechanism, data consistency verification and self-repair mechanism, fail-safe and retry strategy mechanism, etc.

[0094] For example, when optimizing firmware using log verification, you can use log verification transaction logs to ensure the persistence of write operations, that is, before actually modifying the table, the changes are recorded in the log. In this way, after a power outage, these logs can be used to restore to the last consistent state.

[0095] For example, when the firmware is optimized using the checkpoint mechanism, the firmware can periodically create checkpoints of the table to solidify the current full state or incremental state into persistent storage. Even if a power outage occurs, it can quickly restore to the most recent checkpoint state, thereby reducing the scope of data rollback.

[0096] For another example, when the firmware is optimized by using version control and snapshot mechanism, the firmware can add version control for each update operation of the mapping table, or regularly create snapshots of the data. If a version of the mapping table is found to be incomplete after power failure, you can choose to roll back to the previous version or snapshot state.

[0097] For another example, when the firmware is optimized by using a double buffer mechanism, the firmware can use a double buffer strategy when updating the mapping table. That is, two copies of the mapping table are maintained, one for the current version and the other for writing updates. Only when the new update is completely written and verified, the switch is made. This ensures that at least one version of the mapping table is complete when the power is off.

[0098] For another example, when optimizing the firmware by using data consistency check and self-repair mechanism, the firmware should include data consistency check mechanism in the update process of mapping table. Automatic check should be performed after each power failure and power-on again to check the data inconsistency problems that may be caused by power failure, and try to automatically repair or mark those problems that require manual intervention.

[0099] For another example, when the firmware is optimized using a fail-safe and retry strategy mechanism, after the firmware is powered off and then powered on again, the firmware should be able to identify unfinished operations to update the mapping table and decide whether to directly cancel or retry these operations based on a preset strategy.

[0100] Through the above optimization strategy, the data recovery capability of the firmware in the event of a power outage can be effectively improved, the risk of data damage or loss can be reduced, and the continuous and reliable operation of the system can be ensured.

[0101] See also Figure 3 , Figure 3 The monitoring process 1000 of the running state of the firmware is shown. During the process of the memory 900 performing the read / write operation, since the main control unit 910 can send a power-off instruction to the processing module 100 at any time through the interrupt module 800, the memory 900 may be powered off when performing the read operation and powered off when performing the write operation. Therefore, the read data state, write data state and mapping table state of the firmware can be monitored in parallel.

[0102] It can be seen that in the above scheme, by setting the data transmission unit and the state monitoring unit in the memory, the potential risk points of the main control unit and firmware of the memory when encountering abnormal power failure can be accurately found in the product development stage, significantly improving the reliability and test coverage of the firmware and the main control unit. At the same time, the present application can provide a transparent firmware internal state machine monitoring platform, which can effectively reveal and locate the potential risks and abnormal points of the main control unit and firmware through controllable verification tests, significantly improving the comprehensiveness and accuracy of the test. The test scheme introduced in the present application is not only systematic and comprehensive, but also can carefully monitor various states and potential risk points in the operation of the firmware through precise control of the test process, providing strong technical support for research and development. Finally, when the risk points of the main control unit and the firmware are detected, the fault site information can be effectively saved, which greatly facilitates the subsequent analysis and debugging work, and solves the problem of low analysis efficiency caused by the loss or insufficiency of fault site information in traditional technologies.

[0103] See also Figure 4 The present invention also provides a memory testing method, which can be applied to the above-mentioned test system to test the memory 900. The test method may include the following steps: Step S10, building a test environment for the memory; Step S20, in response to the read / write instruction, performing a read / write operation on the storage block, and monitoring the running state of the firmware in real time, the running state including the read data state, the write data state and the mapping table state; Step S30, in response to the power-off instruction, powering off the memory; Step S40: monitor the running status of the firmware after power-on, and when the running status is incomplete, save the current running status of the firmware and continue to perform read / write operations on the storage block; Step S50: monitor the working status of the firmware. When the firmware cannot work normally, optimize the part where the problem occurs during the operation of the firmware.

[0104] See also Figure 5 In one embodiment, when executing step S10, specifically, step S10 may include the following steps: Step S11, downloading the system image file to the test board; Step S12: Initialize the memory to build a test environment.

[0105] See also Figure 6 In one embodiment, when executing step S40, specifically, step S40 may include the following steps: Step S41, monitor the running status of the firmware after power-on, and determine whether the running status is complete; Step S42: when the running state is complete, repeatedly power off the memory until the running state becomes incomplete; Step S43: When the running status is incomplete, save the current running status of the firmware and continue to perform read / write operations on the storage block.

[0106] See also Figure 7 In one embodiment, when executing step S43, specifically, step S43 may include the following steps: Step S431: When the read data status is incomplete, a feedback instruction is issued, and in response to the read instruction, a read operation is performed on the storage block; Step S432: when the data writing state is incomplete, save the relevant information of the firmware writing data when the power is off, and perform a write operation on the storage block in response to the write instruction; Step S433: When the mapping table is incomplete, save the relevant information of the firmware writing the mapping table when the power is off, and perform a write operation on the storage block in response to the write instruction.

[0107] See also Figure 8 In one embodiment, when executing step S50, specifically, step S50 may include the following steps: Step S51, monitoring the working status of the firmware to determine whether the firmware can work normally; Step S52: when the firmware can work normally, repeatedly power off the memory until the firmware cannot work normally; Step S53: When the firmware fails to work properly, the problematic part of the firmware is optimized.

[0108] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A memory, characterized in that: The memory is connected to the test board to build a corresponding test environment, and the memory includes: Storage blocks, used to store data; A main control unit, for performing a read / write operation on the storage block through firmware in response to a read / write instruction; a data transmission unit, used for writing / reading data into / from the storage block; and A status monitoring unit, used for monitoring the running status of the firmware in real time, wherein the running status includes a data reading status, a data writing status and a mapping table status; The main control unit is further used to issue a power-off instruction to power off the memory, and to power on the memory again after the memory is powered off; When the main control unit determines that the running state of the firmware is incomplete, the actions performed are: saving the current running state of the firmware and continuing to perform read / write operations on the storage block; When the main control unit determines that the firmware cannot work normally, the action performed is: optimizing the part where the problem occurs during the operation of the firmware.

2. The memory according to claim 1, characterized in that: After the memory is powered on again, when the main control unit determines that the running state is complete, the action performed is: repeatedly powering off the memory until the running state is incomplete.

3. The memory according to claim 2, characterized in that: After the memory is powered on again, when the main control unit determines that the read data state is incomplete, the action performed is: issuing a feedback instruction, and performing a read operation on the storage block in response to the read instruction of the test board.

4. The memory according to claim 2, characterized in that: After the memory is powered on again, when the main control unit determines that the data write status is incomplete, the action performed is: saving the relevant information of the firmware writing data when the power is off, and responding to the write instruction of the main control unit, the firmware performs a write operation on the storage block.

5. The memory according to claim 2, characterized in that: After the memory is powered on again, when the main control unit determines that the mapping table status is incomplete, the action performed is: saving the relevant information written into the mapping table by the firmware when the power is off, and in response to the write instruction of the main control unit, the firmware performs a write operation on the storage block.

6. The memory according to claim 1, characterized in that: After the memory is powered on again, when the main control unit determines that the firmware can work normally, the action performed is: repeatedly powering off the memory until the firmware cannot work normally.

7. A memory testing method, characterized in that: include: Connecting the memory to the test board to build a test environment for the memory; In response to a read / write instruction, a read / write operation is performed on a storage block of the memory, and a running state of the firmware is monitored in real time, wherein the running state includes a read data state, a write data state, and a mapping table state; In response to the power-off instruction, powering off the memory; After power-on, the running state of the firmware is monitored, and when the running state is incomplete, the current running state of the firmware is saved, and the reading / writing operation on the storage block of the memory is continued; The working status of the firmware is monitored, and when the firmware fails to work properly, the problematic part of the firmware is optimized.

8. The memory testing method according to claim 7, characterized in that: The step of monitoring the running state of the firmware after power-on, saving the current running state of the firmware when the running state is incomplete, and continuing to perform read / write operations on the storage blocks of the memory comprises: After power-on, monitoring the running status of the firmware and determining whether the running status is complete; When the running state is complete, repeatedly powering off the memory until the running state becomes incomplete; When the running state is incomplete, the current running state of the firmware is saved, and the reading / writing operation on the storage block of the memory is continued.

9. The memory testing method according to claim 8, characterized in that: The step of saving the current running state of the firmware and continuing to perform read / write operations on the storage block of the memory when the running state is incomplete comprises: When the read data state is incomplete, a feedback instruction is issued, and in response to the test board read instruction, a read operation is performed on the storage block of the memory; When the data writing state is incomplete, saving the relevant information of the firmware writing data when the power is off, and performing a write operation on the storage block of the storage in response to a write instruction of the main control unit of the storage; When the mapping table is incomplete, the related information of the firmware writing into the mapping table when the power is off is saved, and in response to the write instruction of the main control unit of the memory, a write operation is performed on the storage block of the memory.

10. The memory testing method according to claim 7, characterized in that: The step of monitoring the working state of the firmware and optimizing the part having problems during the operation of the firmware when the firmware fails to work properly comprises: Monitor the working status of the firmware to determine whether the firmware can work normally; When the firmware can work normally, repeatedly power off the memory until the firmware fails to work normally; When the firmware fails to work properly, the part where the problem occurs during the operation of the firmware is optimized.

Citation Information

Patent Citations

  • Memory test system and operation method thereof

    CN108694988A

  • Storage system and control method thereof

    CN115495275A

  • Verification method and device and system-on-chip chip

    CN116795616A

  • Method for processing abnormal data of storage device and storage device

    CN117806893A

  • Control method of firmware simulation system, terminal equipment and readable storage medium

    CN117908785A

Cited By

  • Method and device for storing firmware debugging information during abnormal power failure of storage equipment

    CN119759624A