Firmware troubleshooting method, system, terminal device and storage medium

By compiling the SSD firmware code into an XML file and parsing the variable data, the problem of low firmware debugging efficiency was solved, and efficient debugging that adapts to different types of structures was achieved.

CN115237753BActive Publication Date: 2026-04-28GUANGZHOU ZHICUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU ZHICUN TECH CO LTD
Filing Date
2022-06-24
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Because the variable structure types in the SSD firmware code are defined by the programmer, testing personnel need to frequently rewrite the parsing program, resulting in low firmware debugging efficiency.

Method used

By acquiring firmware code, compiling it into an XML file, sending private commands to the device to read variable data, and parsing real-time variable parameters based on the XML file for troubleshooting, it can adapt to different types of variable structures.

Benefits of technology

It eliminates the need for frequent rewriting of the parsing program, improving firmware troubleshooting efficiency and simplifying the detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237753B_ABST
    Figure CN115237753B_ABST
Patent Text Reader

Abstract

The application discloses a firmware troubleshooting method and system, a terminal device and a storage medium. The firmware troubleshooting method comprises the following steps: obtaining firmware code of a to-be-tested device, and compiling a variable structure body in the firmware code to obtain a corresponding XML file; sending a preset private command to the to-be-tested device to read each variable data in a storage unit of the to-be-tested device; and based on the XML file, analyzing each variable data to obtain real-time variable parameters corresponding to each variable data, so as to perform firmware troubleshooting based on the real-time variable parameters. The application can improve the troubleshooting efficiency of the detection personnel for the firmware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of memory technology, and in particular to a firmware troubleshooting method, system, terminal device, and storage medium. Background Technology

[0002] In recent years, with the rapid development of storage technology, SSDs (Solid State Disks) are gradually replacing traditional storage devices due to their superior performance, power consumption, and environmental adaptability. However, SSD firmware is becoming increasingly powerful, resulting in a larger amount of firmware code. Consequently, the number of variable structures and corresponding configuration parameters in the firmware code is also increasing. Testing personnel typically need to connect to a JTAG (Joint Test Action Group) to examine the variable values ​​corresponding to each variable structure in the firmware on-site to perform troubleshooting.

[0003] However, since the structure types are not predefined by the system but by the programmer, when the type of a variable structure in the firmware changes, the entire program used to parse the firmware code needs to be rewritten to accommodate the changed variable structure type. This results in low debugging efficiency for testing personnel. Summary of the Invention

[0004] The main objective of this invention is to provide a firmware troubleshooting method, system, terminal device, and computer storage medium, aiming to solve the technical problem of low efficiency in firmware troubleshooting for testing personnel.

[0005] To achieve the above objectives, the present invention provides a firmware troubleshooting method, which includes the following steps:

[0006] Obtain the firmware code of the device under test, and compile the variable structure in the firmware code to obtain the corresponding XML file;

[0007] Send a preset private command to the device under test to read the variable data in the storage unit of the device under test;

[0008] Based on the XML file, the variable data is parsed to obtain the real-time variable parameters corresponding to each variable data, and firmware debugging is performed based on the real-time variable parameters.

[0009] Furthermore, prior to the step of sending a preset private command to the device under test to read the variable data in the storage unit of the device under test, the method further includes:

[0010] The firmware code is compiled using an ARM compiler to obtain the corresponding firmware file;

[0011] The firmware file is written to the storage unit of the device under test.

[0012] Furthermore, the step of compiling the variable structure in the firmware code to obtain the corresponding XML file includes:

[0013] The variable structures in the firmware code are compiled using the GCC compiler to obtain the corresponding XML files for each variable structure.

[0014] Further, the storage unit includes: the memory and / or registers of the master controller of the device under test (DUT), and the step of sending a preset private command to the DUT to read the variable data in the storage unit of the DUT includes:

[0015] Send a preset private command to the device under test so that the system firmware of the device under test can read the variable data corresponding to each variable structure in the memory and / or the register through the NVMe protocol or the SATA protocol, and return each variable data.

[0016] Further, the step of parsing the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data includes:

[0017] Based on the variable structure corresponding to each of the variable data, determine the variable name and corresponding XML file for each of the variable data.

[0018] The variable data is parsed through the corresponding XML file to obtain the variable values ​​of each variable data;

[0019] For each of the aforementioned variable data, the variable name and the variable value of the variable data are respectively used as the real-time variable parameters corresponding to the variable data.

[0020] Furthermore, after the step of parsing the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data, the method further includes:

[0021] The real-time variable parameters are compared with the preset configuration parameters to determine whether there are any erroneous variable parameters in the real-time variable parameters that are inconsistent with the corresponding preset configuration parameters;

[0022] If it is determined that there is an erroneous variable parameter among the real-time variable parameters that is inconsistent with the preset configuration parameters, a prompt message including the erroneous variable parameter will be output.

[0023] Further, the step of comparing the real-time variable parameters with the preset configuration parameters includes:

[0024] Determine the real-time variable parameters corresponding to the preset configuration parameters;

[0025] Determine whether the parameter value of the preset configuration parameter is consistent with the variable value of the corresponding real-time variable parameter;

[0026] If the parameter value is determined to be inconsistent with the variable value, then the real-time variable parameter is determined to be the erroneous variable parameter.

[0027] Furthermore, to achieve the above objectives, the present invention also provides a firmware debugging system, the firmware debugging system comprising:

[0028] The compilation module is used to obtain the firmware code of the device under test and compile the variable structure in the firmware code to obtain the corresponding XML file;

[0029] The reading module is used to send a preset private command to the device under test to read the variable data in the storage unit of the device under test;

[0030] The parsing module is used to parse the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data, so as to perform firmware debugging based on the real-time variable parameters.

[0031] In addition, to achieve the above objectives, the present invention also provides a terminal device, the terminal device comprising: a memory, a processor, and a firmware debugging program stored in the memory and executable on the processor, wherein the firmware debugging program, when executed by the processor, implements the steps of the firmware debugging method as described above.

[0032] In addition, to achieve the above objectives, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the firmware troubleshooting method described above.

[0033] The firmware troubleshooting method, system, terminal device, and computer storage medium proposed in this invention obtain the firmware code of the device under test (DUT) and compile the variable structures in the firmware code to obtain corresponding XML files. A preset private command is sent to the DUT to read variable data from its storage unit. Based on the XML file, each variable data is parsed to obtain corresponding real-time variable parameters, which are then used for firmware troubleshooting. In this invention, since the XML file is obtained by compiling the variable structures in the firmware code, it can parse the variable data read from the storage unit of the DUT. Furthermore, unlike traditional solutions where the type of the variable structure in the firmware needs to be rewritten, this method can adapt to different variable structure types, thereby improving the efficiency of firmware troubleshooting for testing personnel. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the structure of the terminal device in the hardware operating environment involved in the embodiments of the present invention;

[0035] Figure 2 This is a flowchart illustrating an embodiment of a firmware troubleshooting method according to the present invention;

[0036] Figure 3 This is a schematic diagram of the structural relationship of a firmware troubleshooting system according to the present invention.

[0037] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0039] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0040] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0041] like Figure 1 As shown, Figure 1 This is a schematic diagram of the structure of a terminal device in the hardware operating environment involved in the embodiments of the present invention.

[0042] The terminal device in this embodiment of the invention can be a device that executes the firmware troubleshooting method provided by the present invention. Specifically, the terminal device can be a mobile terminal, a data storage control terminal, a PC (Personal Computer), or a portable computer.

[0043] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0044] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0045] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a firmware debugging program. The operating system is a program that manages and controls the hardware and software resources of the sample terminal device, and supports the operation of the firmware debugging program and other software or programs.

[0046] exist Figure 1In the terminal device shown, the user interface 1003 is mainly used for data communication with various terminals; the network interface 1004 is mainly used for connecting to the backend server and communicating with the backend server; and the processor 1001 can be used to call the firmware troubleshooting program stored in the memory 1005 and perform the following operations:

[0047] Obtain the firmware code of the device under test, and compile the variable structure in the firmware code to obtain the corresponding XML file;

[0048] Send a preset private command to the device under test to read the variable data in the storage unit of the device under test;

[0049] Based on the XML file, the variable data is parsed to obtain the real-time variable parameters corresponding to each variable data, and firmware debugging is performed based on the real-time variable parameters.

[0050] Furthermore, the processor 1001 can call the firmware troubleshooting program stored in the memory 1005 and also perform the following operations:

[0051] The firmware code is compiled using an ARM compiler to obtain the corresponding firmware file;

[0052] The firmware file is written to the storage unit of the device under test.

[0053] Furthermore, the processor 1001 can call the firmware troubleshooting program stored in the memory 1005 and also perform the following operations:

[0054] The variable structures in the firmware code are compiled using the GCC compiler to obtain the corresponding XML files for each variable structure.

[0055] Furthermore, the processor 1001 can call the firmware troubleshooting program stored in the memory 1005 and also perform the following operations:

[0056] Send a preset private command to the device under test so that the system firmware of the device under test can read the variable data corresponding to each variable structure in the memory and / or the register through the NVMe protocol or the SATA protocol, and return each variable data.

[0057] Furthermore, the processor 1001 can call the firmware troubleshooting program stored in the memory 1005 and also perform the following operations:

[0058] Based on the variable structure corresponding to each of the variable data, determine the variable name and corresponding XML file for each of the variable data.

[0059] The variable data is parsed through the corresponding XML file to obtain the variable values ​​of each variable data;

[0060] For each of the aforementioned variable data, the variable name and the variable value of the variable data are respectively used as the real-time variable parameters corresponding to the variable data.

[0061] Furthermore, the processor 1001 can call the firmware troubleshooting program stored in the memory 1005 and also perform the following operations:

[0062] The real-time variable parameters are compared with the preset configuration parameters to determine whether there are any erroneous variable parameters in the real-time variable parameters that are inconsistent with the corresponding preset configuration parameters;

[0063] If it is determined that there is an erroneous variable parameter among the real-time variable parameters that is inconsistent with the preset configuration parameters, a prompt message including the erroneous variable parameter will be output.

[0064] Furthermore, the processor 1001 can call the firmware troubleshooting program stored in the memory 1005 and also perform the following operations:

[0065] Determine the real-time variable parameters corresponding to the preset configuration parameters;

[0066] Determine whether the parameter value of the preset configuration parameter is consistent with the variable value of the corresponding real-time variable parameter;

[0067] If the parameter value is determined to be inconsistent with the variable value, then the real-time variable parameter is determined to be the erroneous variable parameter.

[0068] Based on the above structure, various embodiments of the firmware debugging method of the present invention are proposed.

[0069] It should be noted that in this embodiment, due to the rapid development of storage technology in recent years, SSDs (Solid State Disks) are gradually replacing traditional storage devices due to their excellent performance, power consumption, and environmental adaptability. As SSD firmware becomes increasingly powerful, the amount of firmware code increases, leading to a proliferation of variable structures and corresponding configuration parameters. Testing personnel typically need to connect to a JTAG (Joint Test Action Group) to examine the variable values ​​of each variable structure in the firmware on-site to perform troubleshooting.

[0070] However, since the structure types are not predefined by the system but by the programmer, when the type of a variable structure in the firmware changes, the entire program used to parse the firmware code needs to be rewritten to accommodate the changed variable structure type. This results in low debugging efficiency for testing personnel.

[0071] To address the aforementioned issues, this application provides a firmware troubleshooting method. This method involves acquiring the firmware code of the device under test (DUT) and compiling the variable structures within the firmware code to obtain a corresponding XML file. A preset private command is then sent to the DUT to read variable data from its storage unit. Based on the XML file, each variable data is parsed to obtain corresponding real-time variable parameters, which are then used for firmware troubleshooting. In this application, since the XML file is obtained by compiling the variable structures in the firmware code, it can parse the variable data read from the DUT's storage unit to obtain the corresponding real-time variable parameters. Unlike traditional solutions where the type of the variable structure in the firmware needs to be rewritten when the type changes, this method can adapt to different variable structure types, thereby improving the efficiency of firmware troubleshooting for testing personnel.

[0072] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the firmware troubleshooting method of the present invention.

[0073] This invention provides an embodiment of a firmware troubleshooting method, which is applied to the aforementioned terminal device. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0074] In this embodiment, the firmware troubleshooting method of the present invention includes:

[0075] Step S100: Obtain the firmware code of the device under test, and compile the variable structure in the firmware code to obtain the corresponding XML file;

[0076] The device under test (DUT) can be a solid-state drive (SSD) or a device with an SSD installed. The firmware code of the DUT can be obtained, and the variable structures within the firmware code can be compiled to obtain the corresponding XML (Extensible Markup Language) file. Since XML can be used to mark up data, define data types, and provide a unified method for describing and exchanging structured data independent of applications or vendors, the resulting XML file obtained by compiling the variable structures can be used to parse the variable data corresponding to each variable structure in the DUT's storage unit during runtime. It is understood that the variable structure can be a collection of one or more variables, which can be of different types, organized under a single name for ease of processing.

[0077] S100 includes the following steps:

[0078] Step S100: Compile each of the variable structures in the firmware code using the GCC compiler to obtain the corresponding XML file for each variable structure.

[0079] The GCC (GNU Compiler Collection) compiler is a programming language compiler developed by GNU. It can extract various variable structures from firmware code, and then compile these structures using the GCC compiler to obtain the corresponding XML files.

[0080] Step S200: Send a preset private command to the device under test to read the variable data in the storage unit of the device under test;

[0081] The terminal device sends a preset private command to the device under test (DUT). Upon receiving the preset private command, the DUT can respond by returning the variable data from the corresponding storage unit, thereby reading the variable data from the DUT's storage unit. The storage unit can be the DUT's memory and / or register.

[0082] The storage unit includes: the memory and / or registers of the main controller of the device under test, and step S200 includes:

[0083] Step S210: Send a preset private command to the device under test so that the system firmware of the device under test can read the variable data corresponding to each variable structure in the memory and / or the register through the NVMe protocol or the SATA protocol, and return each variable data.

[0084] Specifically, the storage unit of the device under test (DUT) includes: the memory and / or registers of the DUT's master controller. After the terminal device sends a preset private command to the DUT, the DUT's system firmware determines, based on the type of solid-state drive used, whether to send the command via NVMe protocol or read the variable data corresponding to each variable structure in the DUT's master controller's memory and / or registers via SATA protocol, and returns the variable data to the terminal device.

[0085] Further, prior to step S200, the method includes:

[0086] Step S220: Compile the firmware code using an ARM compiler to obtain the corresponding firmware file;

[0087] Step S220: Write the firmware file into the storage unit of the device under test.

[0088] When firmware code runs in the device under test (DUT), the source code is compiled into a format executable by the DUT's microprocessor. ARM (Advanced RISC Machines) compilers include ARMCC, IAR, and GCC for ARM. The firmware code is compiled using an ARM compiler to obtain the corresponding firmware file; the type of ARM compiler can be selected based on specific usage requirements. The compiled firmware file is then written to the DUT's storage unit, enabling the firmware code to run in the DUT.

[0089] Step S300: Based on the XML file, parse each of the variable data to obtain the real-time variable parameters corresponding to each of the variable data, and perform firmware debugging based on the real-time variable parameters.

[0090] After reading the variable data from the storage unit of the device under test (DUT), the variable data can be parsed based on the XML file to obtain the real-time variable parameters corresponding to each variable data. This allows for firmware troubleshooting based on the real-time variable parameters. For example, the real-time variable parameters can be visualized for testing personnel to use in firmware troubleshooting. It is understood that the visualization method is not limited in this embodiment; for example, it can be displayed directly or summarized into charts or other forms. The real-time variable parameters can include variable names and corresponding variable values, such as debug configuration parameter names and corresponding values, runtime and corresponding duration, power-on counts and corresponding counts, etc. Therefore, testing personnel can determine the configuration status (whether the configuration is correct) and operating status (whether the variables corresponding to the variable structures are running abnormally) of the firmware of the DUT using the obtained real-time variable parameters. Furthermore, since the real-time variable parameters also include parameters representing the firmware operating status, operating logs, and other device operating information, testing personnel can also determine the overall operating status of the DUT.

[0091] Step S300 includes the following steps:

[0092] Step S310: Based on the variable structure corresponding to each variable data, determine the variable name and corresponding XML file for each variable data.

[0093] Step S311: Parse each variable data through the corresponding XML file to obtain the variable value of each variable data; for each variable data, use the variable name and the variable value of the variable data as the real-time variable parameter corresponding to the variable data.

[0094] It is understood that the variable structure defines the variable names of that structure. Therefore, by determining the variable names of each variable data based on its corresponding variable structure, and the XML file to be used to parse each variable data (i.e., the XML file obtained by compiling the variable structure corresponding to that variable data), the variable data is then parsed through the corresponding XML file to obtain the variable values ​​of each variable data. For each variable data, the variable name and variable value are respectively used as the real-time variable parameters corresponding to that variable data.

[0095] In one embodiment of the present invention, the firmware code of the device under test (DUT) is obtained, and the variable structures in the firmware code are compiled to obtain corresponding XML files. A preset private command is sent to the DUT to read variable data from its storage unit. Based on the XML file, the variable data is parsed to obtain real-time variable parameters corresponding to each variable data, and firmware debugging is performed based on these real-time variable parameters. In this embodiment, since the XML file is obtained by compiling the variable structures in the firmware code, it can parse the variable data read from the storage unit of the DUT to obtain the corresponding real-time variable parameters. Unlike traditional solutions, where the type of the variable structure in the firmware needs to be rewritten when the type changes, this method can adapt to different variable structure types, thereby improving the efficiency of firmware debugging for testing personnel.

[0096] Furthermore, in another embodiment, after the step of parsing the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data, the method further includes:

[0097] Step S320: Compare the real-time variable parameters with the preset configuration parameters to determine whether there are any erroneous variable parameters in the real-time variable parameters that are inconsistent with the corresponding preset configuration parameters;

[0098] Step S321: If it is determined that there is an erroneous variable parameter in the real-time variable parameters that is inconsistent with the preset configuration parameters, then a prompt message including the erroneous variable parameter is output.

[0099] The preset configuration parameters are pre-set parameters used to maintain the normal operation of the firmware in the device under test. The real-time variable parameters can be compared with the preset configuration parameters to determine if there are any erroneous variable parameters among the real-time variable parameters that are inconsistent with the corresponding preset configuration parameters. If it is determined that there are erroneous variable parameters among the real-time variable parameters that are inconsistent with the preset configuration parameters, a prompt message including the erroneous variable parameter is output. The erroneous variable parameter may include the erroneous variable parameter name and the corresponding parameter value. In this embodiment, by comparing the real-time variable parameters with the preset configuration parameters, it can help testers quickly identify the problematic erroneous variable parameters, thereby improving the efficiency of troubleshooting variables in the firmware.

[0100] Step S320 includes:

[0101] Step a: Determine the real-time variable parameters corresponding to the preset configuration parameters;

[0102] Step b: Determine whether the parameter value of the preset configuration parameter is consistent with the variable value of the corresponding real-time variable parameter;

[0103] Step b1: If it is determined that the parameter value is inconsistent with the variable value, then the real-time variable parameter is determined to be the erroneous variable parameter.

[0104] In real-time variable parameters, only some may correspond to the preset configuration parameters. Therefore, to improve the detection process of real-time variable parameters, the real-time variable parameters corresponding to the preset configuration parameters can be determined first, and then it can be determined whether the parameter value of the preset configuration parameters is consistent with the variable value of the corresponding real-time variable parameters. If the parameter value is inconsistent with the variable value, it indicates that the real-time variable parameter may have been configured incorrectly, and thus the real-time variable parameter is determined to be an erroneous variable parameter. If the parameter value is inconsistent with the variable value, it indicates that the real-time variable parameter may have been configured incorrectly, and if the real-time variable parameter is configured correctly, then the real-time variable parameter is determined not to be an erroneous variable parameter. In this embodiment, by determining the real-time variable parameters corresponding to the preset configuration parameters and then determining whether the parameter value of the preset configuration parameters is consistent with the variable value of the corresponding real-time variable parameters, it is possible to determine whether the real-time variable parameter is an erroneous variable parameter. This avoids traversing a large number of real-time variable parameters, thereby improving the efficiency of debugging variables in the firmware.

[0105] In addition, please refer to Figure 3 This invention also proposes a firmware troubleshooting system, which includes:

[0106] The compilation module 10 is used to obtain the firmware code of the device under test and compile the variable structure in the firmware code to obtain the corresponding XML file.

[0107] The reading module 20 is used to send a preset private command to the device under test to read the variable data in the storage unit of the device under test;

[0108] The parsing module 30 is used to parse the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data, so as to perform firmware debugging based on the real-time variable parameters.

[0109] Furthermore, the firmware troubleshooting system also includes: a writing module 40, used for...

[0110] The firmware code is compiled using an ARM compiler to obtain the corresponding firmware file;

[0111] The firmware file is written to the storage unit of the device under test.

[0112] Furthermore, compilation module 10 is also used for

[0113] The variable structures in the firmware code are compiled using the GCC compiler to obtain the corresponding XML files for each variable structure.

[0114] Furthermore, the reading module 20 is also used for

[0115] Send a preset private command to the device under test so that the system firmware of the device under test can read the variable data corresponding to each variable structure in the memory and / or the register through the NVMe protocol or the SATA protocol, and return each variable data.

[0116] Furthermore, the parsing module 30 is also used for

[0117] Based on the variable structure corresponding to each of the variable data, determine the variable name and corresponding XML file for each of the variable data.

[0118] The variable data is parsed through the corresponding XML file to obtain the variable values ​​of each variable data;

[0119] For each of the aforementioned variable data, the variable name and the variable value of the variable data are respectively used as the real-time variable parameters corresponding to the variable data.

[0120] Furthermore, the firmware troubleshooting system also includes: a comparison module 50, used for...

[0121] The real-time variable parameters are compared with the preset configuration parameters to determine whether there are any erroneous variable parameters in the real-time variable parameters that are inconsistent with the corresponding preset configuration parameters;

[0122] If it is determined that there is an erroneous variable parameter among the real-time variable parameters that is inconsistent with the preset configuration parameters, a prompt message including the erroneous variable parameter will be output.

[0123] Furthermore, the comparison module 50 is also used for

[0124] Determine the real-time variable parameters corresponding to the preset configuration parameters;

[0125] Determine whether the parameter value of the preset configuration parameter is consistent with the variable value of the corresponding real-time variable parameter;

[0126] If the parameter value is determined to be inconsistent with the variable value, then the real-time variable parameter is determined to be the erroneous variable parameter.

[0127] Furthermore, this embodiment of the invention also proposes a computer storage medium for use in a computer. The computer storage medium can be a non-volatile computer-readable storage medium, on which a firmware debugging program is stored. When the firmware debugging program is executed by the processor, it implements the steps of the firmware debugging method described above.

[0128] The steps implemented when the firmware debugging program running on the processor is executed can be referred to in various embodiments of the firmware debugging method of the present invention, and will not be repeated here.

[0129] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0130] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0131] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a computer storage medium (such as Flash memory, ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a controller in a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to control the data read and write operations of the storage medium to execute the methods described in the various embodiments of the present invention.

[0132] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A firmware troubleshooting method, characterized in that, The firmware troubleshooting method includes the following steps: Obtain the firmware code of the device under test, and compile the variable structure in the firmware code to obtain the corresponding XML file; Send a preset private command to the device under test to read the variable data in the storage unit of the device under test, wherein the variable data includes the data corresponding to each variable structure; Based on the XML file, the real-time variable parameters corresponding to each variable data are obtained by parsing the variable data, and firmware debugging is performed based on the real-time variable parameters. The step of parsing the XML file to obtain the real-time variable parameters corresponding to each variable data includes: Based on the variable structure corresponding to each variable data, determine the variable name and corresponding XML file for each variable data; parse each variable data through the corresponding XML file to obtain the variable value for each variable data; for each variable data, use the variable name and variable value as the real-time variable parameter corresponding to the variable data.

2. The firmware troubleshooting method as described in claim 1, characterized in that, Before the step of sending a preset private command to the device under test to read the variable data in the storage unit of the device under test, the method further includes: The firmware code is compiled using an ARM compiler to obtain the corresponding firmware file; The firmware file is written to the storage unit of the device under test.

3. The firmware troubleshooting method as described in claim 1, characterized in that, The step of compiling the variable structure in the firmware code to obtain the corresponding XML file includes: The variable structures in the firmware code are compiled using the GCC compiler to obtain the corresponding XML files for each variable structure.

4. The firmware troubleshooting method as described in claim 1, characterized in that, The storage unit includes: the memory and / or registers of the main controller of the device under test (DUT), and the step of sending a preset private command to the DUT to read the variable data in the storage unit of the DUT includes: A preset private command is sent to the device under test (DUT) so that the DUT's system firmware can read the variable data corresponding to each variable structure in the memory and / or register via the NVMe or SATA protocol, and return each variable data.

5. The firmware troubleshooting method as described in any one of claims 1 to 4, characterized in that, After the step of parsing the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data, the method further includes: The real-time variable parameters are compared with the preset configuration parameters to determine whether there are any erroneous variable parameters in the real-time variable parameters that are inconsistent with the corresponding preset configuration parameters; If it is determined that there is an erroneous variable parameter among the real-time variable parameters that is inconsistent with the preset configuration parameters, a prompt message including the erroneous variable parameter will be output.

6. The firmware troubleshooting method as described in claim 5, characterized in that, The step of comparing the real-time variable parameters with the preset configuration parameters includes: Determine the real-time variable parameters corresponding to the preset configuration parameters; Determine whether the parameter value of the preset configuration parameter is consistent with the variable value of the corresponding real-time variable parameter; If the parameter value is determined to be inconsistent with the variable value, then the real-time variable parameter is determined to be the erroneous variable parameter.

7. A firmware troubleshooting system, characterized in that, The firmware troubleshooting system includes: The compilation module is used to obtain the firmware code of the device under test and compile the variable structure in the firmware code to obtain the corresponding XML file; The reading module is used to send a preset private command to the device under test to read the variable data in the storage unit of the device under test, wherein the variable data includes the data corresponding to each variable structure; The parsing module is used to parse the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data, so as to perform firmware debugging based on the real-time variable parameters. The step of parsing the variable data based on the XML file to obtain the real-time variable parameters corresponding to each variable data includes: Based on the variable structure corresponding to each variable data, determine the variable name and corresponding XML file for each variable data; parse each variable data through the corresponding XML file to obtain the variable value for each variable data; for each variable data, use the variable name and variable value as the real-time variable parameter corresponding to the variable data.

8. A terminal device, characterized in that, The terminal device includes: a memory, a processor, and a firmware debugging program stored in the memory and executable on the processor, wherein when the firmware debugging program is executed by the processor, it implements the steps of the firmware debugging method as described in any one of claims 1 to 6.

9. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the firmware troubleshooting method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for convertion between extensive makeup language (XML) message and C language program structure

    CN101739245A

  • Interface parameter transfer method, interface parameter transfer device, interface parameter transfer equipment and computer-readable storage medium

    CN107908485A