Debugging method and debugging system
By activating the connection of the external memory in the memory storage device, obtaining and storing error information, and disconnecting, the problems of low maintenance efficiency and data leakage risks in the prior art are solved, and efficient remote error debugging and automated maintenance are achieved.
Patent Information
- Application Number
- CN202210361471.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-04-07
AI Technical Summary
The prior art is inefficient in the repair when an abnormality or failure of the memory storage device occurs, and requires on-site inspection or customer return the device for repair, and there is a risk of data leakage.
By activating the connection between the memory storage device and the external memory, error information is obtained and stored in the external memory, and disconnected after the information is stored, the maintenance personnel are allowed to analyze the error information remotely for debugging.
It improves the maintenance efficiency of memory storage devices, reduces the demand for on-site repairs and customer returns, reduces the risk of data leakage, and supports automated error debugging.
Smart Images

Figure CN114724617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a device debugging technology, and more particularly to a debugging method and a debugging system. Background Art
[0002] There are many reasons why a memory storage device may fail or malfunction, including firmware code failure in the storage controller or access failure of the memory module. Generally speaking, after the memory storage device is shipped, if the memory storage device fails or malfunctions, maintenance personnel need to go to the site to perform equipment inspection and maintenance (remote maintenance may cause data leakage) or the customer needs to return the entire memory storage device to the maintenance factory, which is time-consuming, labor-intensive and inefficient in maintenance processing. Summary of the invention
[0003] The invention provides a debugging method and a debugging system, which can improve the inspection efficiency of a memory storage device.
[0004] An embodiment of the present invention provides a debugging method for a memory storage device. The debugging method comprises: activating the connection between the memory storage device and an external memory; acquiring error information from the memory storage device and storing the error information in the external memory; determining whether the error information is stored in the external memory; and after the error information is stored in the external memory, disconnecting the connection between the memory storage device and the external memory.
[0005] The embodiment of the present invention further provides a debugging system, which includes a host system and a memory storage device. The memory storage device is connected to the host system. The memory storage device is used to: activate the connection between the memory storage device and an external memory; obtain error information from the memory storage device and store the error information in the external memory; determine whether the error information is stored in the external memory; and after the error information is stored in the external memory, disconnect the connection between the memory storage device and the external memory.
[0006] Based on the above, after activating the connection between the memory storage device and the external memory, the memory storage device can obtain error information related to the memory storage device and store the error information in the external memory. After the error information is stored in the external memory, the memory storage device can disconnect the memory storage device from the external memory. Thereafter, maintenance personnel can perform (remote) debugging on the memory storage device based on the information (such as error information) in the external memory, or the memory storage device can also perform preliminary automated debugging in the debugging program based on the error information. Compared with the traditional maintenance personnel who need to go to the site to perform equipment inspection and maintenance or the customer needs to return the entire memory storage device, the present invention can effectively improve the maintenance efficiency of the memory storage device. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 is a schematic diagram of a debugging system according to an embodiment of the present invention;
[0008] Figure 2 is a flowchart of a debugging method according to an embodiment of the present invention;
[0009] Figure 3 is a flow chart of a debugging method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0010] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0011] Figure 1 is a schematic diagram of a debugging system according to an embodiment of the present invention. Figure 1 , the debugging system 10 includes a host system 11 and a memory storage device 12. The host system 11 can be connected to the memory storage device 12. The host system 11 can be used to store data (such as user data) in the memory storage device 12 or read data from the memory storage device 12. For example, the host system 11 can include various computer systems such as a smart phone, a tablet computer, a notebook computer, a desktop computer, an industrial computer, or a server host. In addition, the host system 11 can be configured with various electronic circuit elements required for its operation, such as a central processing unit (CPU), a buffer memory, and a power management circuit.
[0012] The memory storage device 12 can be used to store data. The memory storage device 12 may include a connection interface circuit 121 , a memory controller 122 , and a memory module 123 . The memory controller 122 is connected to the connection interface circuit 121 and the memory module 123 .
[0013] The connection interface circuit 121 is used to connect the memory storage device 12 to the host system 11. For example, the connection interface circuit 121 can support various connection interface standards such as universal serial bus (USB) or high-speed peripheral component interconnect interface (PCI Express). The memory storage device 12 can communicate with the host system 11 through the connection interface circuit 121.
[0014] The memory controller 122 is responsible for the overall or partial operation of the memory storage device 12. The memory controller 122 may include a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessors, digital signal processors (DSP), programmable controllers, application specific integrated circuits (ASIC), programmable logic devices (PLD), or other similar devices or combinations of these devices. In addition, the memory controller 122 may be used to control the memory module 123. The following description of the memory controller 122 is equivalent to the description of the memory storage device 12.
[0015] The memory module 123 can be used to store data. For example, the memory module 13 may include one or more rewritable non-volatile memory modules. Each rewritable non-volatile memory module may include a single-level cell (SLC) NAND flash memory module, a multi-level cell (MLC) NAND flash memory module, a triple-level cell (TLC) NAND flash memory module, a quad-level cell (QLC) NAND flash memory module, or other flash memory modules or other memory modules with the same or similar characteristics.
[0016] It should be noted that the memory storage device 12 may also be connected to an external memory 124. For example, the external memory 124 may include a one-time programmable memory such as an electrically-erasable programmable read-only memory (EEPROM) or an erasable programmable read-only memory (EPROM) or other types of memory. The external memory 124 may be connected to the memory controller 122 via a circuit board of the memory storage device 12.
[0017] In one embodiment, the external memory 124 is soldered to the circuit board of the memory storage device 12, and is electrically connected to the memory controller 122 through the soldering points on the circuit board. Alternatively, in one embodiment, the external memory 124 may also be connected to the memory storage device 12 through an external socket of the memory storage device 12, and electrically connected to the memory controller 122 through pins in the external socket.
[0018] When the memory storage device 12 needs to be debugged, the memory controller 122 can activate the external memory 124. For example, the memory controller 122 can supply power to the external memory 124 and / or establish an access channel between the memory storage device 12 and the external memory 124 to activate the external memory 124. In one embodiment, activating the external memory 124 may include or be considered as activating the connection between the memory storage device 12 and the external memory 124. The external memory 124 that is activated by activation can be used to store data. For example, after supplying power to the external memory 124 and establishing the connection between the memory storage device 12 and the external memory 124, the memory controller 122 can store the data in the memory module 123 in the external memory 124 through the access channel.
[0019] The memory controller 122 may run a debugger in the memory storage device 12 to obtain error information related to the memory storage device 12 and store the error information in the external memory 124. For example, the debugger may be used to monitor the operating status of the memory storage device 12 and obtain error information related to the memory storage device 12 from the memory storage device 12. Then, the debugger may automatically store the error information in the external memory 124.
[0020] In one embodiment, the error information may include an error log generated during the operation of the memory storage device 12. The error log may be information related to abnormal events or error events that occur during the operation of the memory storage device 12. In addition, in one embodiment, the error information may also include any information that is helpful for debugging the software, firmware or hardware in the memory storage device 12 (such as variables in the firmware code or program code or detection data generated by executing the debugging program, etc.), which is not limited by the present invention.
[0021] In one embodiment, the error information may be preset to be stored in a specific area (e.g., a system area) in the memory module 123. When the debugging program is run, the memory controller 122 may load a mapping table into the buffer memory. The memory controller 122 may query the mapping table to obtain the storage address of the error information. For example, the storage address may be expressed as DXBYPZ, where X is the die number, Y is the physical block number, and X is the physical page number. Then, the memory controller 122 may issue a read instruction to instruct the memory module 123 to read the error information from the storage address. After obtaining the error information, the memory controller 122 may store the error information in the external memory 124.
[0022] In one embodiment, in the debugging procedure, the memory controller 122 may automatically analyze the error information and try to automatically solve the abnormal event of the memory storage device 12. In one embodiment, the memory controller 122 may determine whether a hardware abnormality or a firmware abnormality occurs based on the error information. If it is determined that a hardware abnormality occurs, such as an abnormality in the interface or connection with the host system (for example, the error information shows that the connection between the host system is interrupted multiple times or drops from Gen3 to Gen2, etc.), the memory controller 122 may perform hardware re-modulation to try to re-modulate part of the system parameters of the connection interface circuit 121 (for example, increase the driving voltage of the connection interface circuit 121). After re-modulating part of the system parameters of the connection interface circuit 121, if the hardware abnormality is solved, the memory controller 122 may end or exit the debugging procedure. However, after re-modulating part of the system parameters of the connection interface circuit 121, if the hardware abnormality is still not solved, the memory controller 122 may generate a prompt message to provide the user with a solution recommended by the prompt message. For example, the prompt information may suggest the user to replace the physical connection line between the memory storage device 12 and the host system and / or replace the physical interface of the connection interface circuit 121, etc.
[0023] On the other hand, if it is determined that a firmware abnormality occurs, such as a portion of the mapping table is lost, the memory controller 122 may perform a mapping table reconstruction to attempt to rebuild the lost mapping table. For example, the memory controller 122 may read information required for rebuilding the lost mapping table from the memory module 123. Generally speaking, more important information is often backed up in the memory module 123 in case of emergency. Thereafter, the memory controller 122 may rebuild the lost mapping table based on the read information. It should be noted that the technical details of rebuilding the mapping table should be known to technicians in the relevant field and will not be elaborated here. After rebuilding the lost mapping table, the memory controller 122 may restore the normal operation of the memory storage device 12 based on the newly built mapping table.
[0024] In one embodiment, during the debugging procedure, the memory controller 122 may also update the bad block management table to force damaged or inefficiently used physical blocks to be included in the bad block management table. For example, the memory controller 122 may add management information of physical blocks with a bit error rate that is too high (e.g., higher than a threshold value) to the bad block management table. Thereafter, the memory controller 122 may stop using some physical blocks to store data according to the updated bad block management table, thereby avoiding abnormal events such as user data loss and / or mapping table loss from occurring again.
[0025] After completing the debugging procedure and completely storing the error information in the external memory 124, the memory controller 122 may disconnect the external memory 124. For example, the memory controller 122 may cut off the power supply to the external memory 124 and / or cut off the access channel between the memory storage device 12 and the external memory 124 to disconnect the memory storage device 12 from the external memory 124.
[0026] In one embodiment, the memory controller 122 may determine whether the error information is stored in the external memory 124. After the error information is stored in the external memory 124, the memory controller 122 may disconnect the memory storage device 12 from the external memory 124.
[0027] It should be noted that after disconnecting the external memory 124 or disconnecting the memory storage device 12 from the external memory 124, the error information can continue to be stored in the external memory 124 and will not disappear due to power failure. Afterwards, after obtaining the external memory 124, the maintenance personnel can analyze the error information stored in the external memory 124 to debug the firmware or other software / hardware of the memory storage device 12 and provide solutions.
[0028] In one embodiment, the memory controller 122 may encrypt the error information before storing the error information in the external memory 124. Then, the error information may be stored in the external memory 124 in an encrypted form. Thereafter, maintenance personnel may use a specific device (e.g., a computer system) to read the error information from the external memory 124 and decrypt it to obtain the original error information and analyze it.
[0029] In one embodiment, before executing the debugging program, the host system 11 can detect whether the memory storage device 12 supports a customized operation mode (also called a debugging mode). For example, the host system 11 can send a query command to the memory storage device 12 to inquire whether the memory storage device 12 supports the debugging mode. The memory controller 122 can send a response message to the host system 11 according to the query command to inform the host system 11 whether it supports the debugging mode.
[0030] In one embodiment, in response to the memory storage device 12 not supporting the debugging mode (for example, the memory storage device 12 does not have firmware for executing the debugging program), the host system 11 may burn firmware for executing the debugging program into the memory storage device 12. Then, the memory controller 122 may run the firmware to execute the debugging program.
[0031] In one embodiment, the operation of the host system 11 detecting whether the memory storage device 12 supports the debug mode includes detecting whether the memory storage device 12 can store the error information in the external memory 124. In response to the memory storage device 12 being unable to store the error information in the external memory 124 (i.e., the memory storage device 12 does not support the debug mode or the memory storage device 12 does not have firmware for executing the debug program), the host system 11 may burn firmware corresponding to realizing the ability to store the error information in the external memory 124 (i.e., firmware for executing the debug program) into the memory storage device 12.
[0032] In one embodiment, in response to the memory storage device 12 supporting the debugging mode (for example, the memory storage device 12 has firmware for executing the debugging program and the memory storage device 12 can store the error information in the external memory 124), the host system 12 can issue a debugging instruction to the memory storage device 12. The debugging instruction is used to instruct the memory storage device 12 to execute the debugging program. According to the debugging instruction, the memory controller 122 can run the firmware to execute the debugging program and store the error information in the external memory 124.
[0033] In one embodiment, in response to the execution of the debugging program (i.e., the error information can be stored in the external memory 124), the memory controller 122 can detect whether the external memory 124 has been written with data before the current debugging program is executed. In one embodiment, in response to the external memory 124 having been written with data before the current debugging program is executed, the memory controller 122 can generate a prompt message (e.g., a write failure message) and stop storing the error information in the external memory 124 to avoid unexpected events such as write errors or loss of data previously stored in the external memory 124. In one embodiment, in response to the external memory 124 not having been written with data before the current debugging program is executed, the memory controller 122 can allow the error information to be stored in the external memory 124.
[0034] In one embodiment, if the external memory 124 is soldered to the circuit board of the memory storage device 12, after the memory controller 122 disconnects the external memory 124 or disconnects the memory storage device 12 from the external memory 124, the user of the memory storage device 12 can desolder the external memory 124 to remove the external memory 124 from the circuit board of the memory storage device 12.
[0035] Alternatively, in one embodiment, if the external memory 124 is connected to the memory storage device 12 via an external slot, the user of the memory storage device 12 can directly unplug the external memory 124 from the external slot after the memory controller 122 disconnects the external memory 124 or disconnects the memory storage device 12 from the external memory 124. Then, the customer of the memory storage device 12 can provide (e.g., mail) the external memory 124 to a maintenance person and obtain a solution based on the maintenance person's debugging results.
[0036] Figure 2 is a flowchart of a debugging method according to an embodiment of the present invention. Figure 2 In step S201, the connection between the memory storage device and the external memory is activated. In step S202, error information is obtained from the memory storage device and stored in the external memory. In step S203, it is determined whether the error information is stored in the external memory. After the error information is stored in the external memory, in step S204, the connection between the memory storage device and the external memory is disconnected. In addition, if the error information has not been stored in the external memory, step S203 can be repeatedly executed to continuously store the error information.
[0037] Figure 3is a flowchart of a debugging method according to an embodiment of the present invention. Figure 3 In step S301, the memory storage device is connected to the host system. In step S302, it is determined whether the memory storage device supports the debugging mode. In response to the memory storage device not supporting the debugging mode, in step S303, the host system burns the firmware corresponding to the debugging program into the memory storage device. Alternatively, in response to the memory storage device supporting the debugging mode, in step S304, the host system issues a debugging instruction to the memory storage device to instruct the memory storage device to execute the debugging program. After steps S303 and S304, in step S305, the memory storage device executes the debugging program.
[0038] However, Figure 2 and Figure 3 The steps in the above are described in detail, so I will not repeat them here. It is worth noting that Figure 2 and Figure 3 Each step in the above process can be implemented as multiple program codes or circuits, and the present invention is not limited thereto. Figure 2 and Figure 3 The method can be used in conjunction with the above exemplary embodiments or can be used alone, and the present invention is not limited thereto.
[0039] In summary, the debugging method and debugging system of the exemplary embodiment of the present invention can store the error information automatically generated by the memory storage device in an external memory in an encrypted manner to prevent the information from being stolen during the information transmission process. Thereafter, the maintenance personnel can perform (remote) debugging on the memory storage device based on the information (such as error information) in the external memory, or the memory storage device can also perform preliminary automated debugging in the debugging program based on the error information. Compared with the traditional maintenance personnel who need to go to the site to perform equipment inspection and maintenance or the customer needs to return the entire memory storage device, the present invention can effectively improve the maintenance efficiency of the memory storage device.
[0040] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A debugging method, characterized in that: For a memory storage device, the debugging method comprises: activating the connection between the memory storage device and the external memory; Acquiring error information from the memory storage device and storing the error information in the external memory; Determining whether the error information is stored in the external memory; After the error information is stored in the external memory, disconnecting the connection between the memory storage device and the external memory; In response to being able to store the error information in the external memory, detecting whether data has been written into the external memory; In response to the external memory having been written with data, generating a prompt message; and In response to the external memory not having been written with data, the error information is allowed to be stored in the external memory.
2. The debugging method according to claim 1, wherein the step of acquiring the error information from the memory storage device and storing the error information in the external memory comprises: detecting whether the memory storage device can store the error information in the external memory; as well as In response to the memory storage device being unable to store the error information in the external memory, firmware corresponding to enabling the error information to be stored in the external memory is burned into the memory storage device.
3. The debugging method according to claim 2, further comprising: In response to the memory storage device being able to store the error information in the external memory, issuing a debugging instruction to the memory storage device; as well as The debugging instruction is received and the error information is stored in the external memory.
4. The debugging method according to claim 1, wherein the error information is stored in the external memory in an encrypted form.
5. The debugging method according to claim 1, wherein the external memory is a one-time programmable memory.
6. The debugging method according to claim 1, wherein the error information is preset and stored in a system area of a memory module in the memory storage device, and obtaining the error information from the memory storage device comprises: Loading the mapping table into the buffer memory; Querying the mapping table to obtain a storage address of the error information; as well as A read instruction is issued to instruct the memory module to read the error information from the storage address.
7. The debugging method according to claim 1, further comprising: In the debugging procedure, judging whether a hardware abnormality or a firmware abnormality occurs according to the error information; If the hardware anomaly occurs, perform hardware re-modulation; as well as If the firmware exception occurs, the mapping table is rebuilt.
8. A debugging system, characterized in that: include: Host system; as well as a memory storage device connected to the host system, Wherein the memory storage device is used for: activating the connection between the memory storage device and the external memory; Acquiring error information from the memory storage device and storing the error information in the external memory; Determining whether the error information is stored in the external memory; as well as After the error information is stored in the external memory, disconnecting the connection between the memory storage device and the external memory; In response to being able to store the error information in the external memory, detecting whether data has been written into the external memory; In response to the external memory having been written with data, generating a prompt message; as well as In response to the external memory not having been written with data, the error information is allowed to be stored in the external memory.
9. The debugging system according to claim 8, wherein the acquiring the error information from the memory storage device and storing the error information in the external memory comprises: detecting whether the memory storage device can store the error information in the external memory; as well as In response to the memory storage device being unable to store the error information in the external memory, the host system burns firmware corresponding to enabling the error information to be stored in the external memory into the memory storage device.
10. The debugging system according to claim 9, wherein the acquiring the error information from the memory storage device and storing the error information in the external memory further comprises: In response to the memory storage device being able to store the error information in the external memory, the host system issues a debugging instruction to the memory storage device; as well as The debugging instruction is received and the error information is stored in the external memory.
11. The debugging system according to claim 8, wherein the error information is stored in the external memory in an encrypted form.
12. The debugging system according to claim 8, wherein the external memory is a one-time programmable memory.
13. The debugging system according to claim 8, wherein the error information is preset and stored in a system area of a memory module in the memory storage device, and obtaining the error information from the memory storage device comprises: Loading the mapping table into the buffer memory; Querying the mapping table to obtain a storage address of the error information; as well as A read instruction is issued to instruct the memory module to read the error information from the storage address.
14. The debugging system according to claim 8, wherein the memory storage device is further configured to: In the debugging procedure, judging whether a hardware abnormality or a firmware abnormality occurs according to the error information; If the hardware anomaly occurs, perform hardware re-modulation; as well as If the firmware exception occurs, the mapping table is rebuilt.
Citation Information
Patent Citations
In-circuit debugging system and related method
CN101727387A