Quick debugging method, device and equipment for computer firmware and medium

By using dummy firmware instead of the firmware to be debugged and loading and jumping through the JTAG interface, the problem of low debugging of computer firmware is solved, and rapid debugging and efficient development are achieved.

CN120179537AActive Publication Date: 2025-06-20DIANKEYUN (BEIJING) TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510326304.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-06-20
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

In the prior art, computer firmware debugging efficiency is low, and it is necessary to frequently execute the re-writing process of testing firmware, resulting in an extended development cycle.

Method used

Use dummy firmware to replace the firmware to be debugged. The binary size of the dummy firmware is smaller than the preset size threshold. The firmware to be debugged is loaded through the JTAG debugging interface, and after the dummy firmware check is completed, jump to the firmware to be debugged to run.

Benefits of technology

It greatly shortens firmware replacement and debugging time, improves debugging efficiency, and reduces the service life consumption of external storage media.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179537A_ABST
    Figure CN120179537A_ABST
Patent Text Reader

Abstract

The invention discloses a computer firmware quick debugging method and device, equipment and a medium, and the method comprises the steps: replacing firmware to be debugged with dummy firmware, and programming the dummy firmware into an external storage of a computer of the firmware to be debugged; after the computer is powered on, a central processing unit of the computer is controlled to load the dummy firmware into an internal memory of the computer from the external memory; loading the firmware to be debugged to the internal memory through the JTAG debugging interface; and the dummy firmware checks whether the loading of the firmware to be debugged is completed or not. The invention belongs to the field of computer firmware software development and testing. According to the method, the dummy firmware is introduced to replace the original debugging firmware, and the original debugging firmware which is loaded to the fixed memory address at a high speed through the JTAG debugging interface is skipped to during execution, so that the time for replacing the debugging firmware is greatly shortened in the firmware development process, and the debugging efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer firmware software development and testing, and particularly to a method, device, equipment, and medium for quickly debugging computer firmware. Background Art

[0002] Computer firmware is software embedded in hardware devices, and the firmware provides basic functions for controlling, monitoring, and supporting the device hardware. The firmware is an abstraction layer between the hardware and the operating system, ensuring that the hardware can correctly perform its basic operations and providing necessary interfaces and services for the operating system or higher-level software. Existing computer firmware (including BIOS, UEFI, U-Boot, PMON, etc.) is stored on external storage media such as EEPROM and Flash Memory. In the prior art, when the firmware needs to run on a computer device, after the processor is powered on, it is necessary to wait for the corresponding storage interface to load the firmware file from the external storage medium into the memory, and then execute it through the processor.

[0003] The debugging of computer firmware software, like the debugging of general computer software, requires a large number of source code modifications, compilations, and actual measurements to achieve stable operation. Due to the above characteristics, during the software development and debugging process of computer firmware, it is necessary to continuously execute the process of rewriting the test firmware to external storage media such as EEPROM and Flash, and for any modification to the firmware code, the entire set of firmware code compilation and rewriting processes need to be re-executed, resulting in low efficiency, inconvenient for quickly verifying debugging ideas, and having a great impact on the development cycle of computer firmware software. Therefore, there is an urgent need to provide a method for quickly debugging computer firmware to solve the problem of low efficiency in debugging computer firmware. Summary of the Invention

[0004] The present invention provides a method, device, equipment, and medium for quickly debugging computer firmware, solves the technical problem of low efficiency in debugging firmware in the prior art, and achieves the technical effect of improving the efficiency of debugging firmware.

[0005] In a first aspect, the present invention provides a method for quickly debugging computer firmware, the method comprising: Using a dummy firmware to replace the firmware to be debugged, and burning the dummy firmware into the external storage of the computer where the firmware to be debugged is located, wherein the binary size of the dummy firmware is smaller than a preset size threshold; After the computer is powered on, controlling the central processing unit of the computer to load the dummy firmware from the external storage into the internal memory of the computer; Loading the firmware to be debugged into the internal memory through a JTAG debugging interface; The dummy firmware checks whether the firmware to be debugged is loaded completely.

[0006] Further, it further includes: If the firmware to be debugged is not loaded completely, the dummy firmware checks again whether the firmware to be debugged is loaded completely; If the firmware to be debugged is loaded completely, the dummy firmware jumps to the firmware to be debugged and controls the firmware to be debugged to run.

[0007] Further, it further includes: Determine the actual occupied space of the binary file of the firmware to be debugged; Determine the assumed occupied space of the binary file of the firmware to be debugged according to the actual occupied space; Fill the binary file of the firmware to be debugged in the form of 0xFF for each byte until the actual occupied space of the binary file of the firmware to be debugged changes to the assumed occupied space.

[0008] Further, determining the assumed occupied space of the binary file of the firmware to be debugged according to the actual occupied space includes: Round up according to the size of the actual occupied space to obtain the size of the assumed occupied space of the binary file of the firmware to be debugged.

[0009] Further, the dummy firmware checks whether the firmware to be debugged is loaded completely, including: Set the last 16 bytes of the programming address in the binary file of the firmware to be debugged to 0x00; The dummy firmware checks whether the last 16 bytes are all 0xFF in the internal memory of the computer; If they are all, it is loaded completely, if not, it is not loaded completely.

[0010] Further, burning the dummy firmware to the external storage of the computer of the firmware to be debugged includes: Based on the JTAG debugging interface, burn the dummy firmware to the external storage of the computer of the firmware to be debugged.

[0011] Further, burning the dummy firmware to the external storage of the computer of the firmware to be debugged further includes: Based on Serial Peripheral Interface, Inter Integrated Circuit, Universal Asynchronous Receiver / Transmitter or USB, burn the dummy firmware to the external storage of the computer of the firmware to be debugged.

[0012] In a second aspect, the present invention provides a computer firmware rapid debugging device, and the device includes: A replacement module is used to replace the firmware to be debugged with dummy firmware and burn the dummy firmware into the external storage of the computer where the firmware to be debugged is located. The binary size of the dummy firmware is smaller than a preset size threshold. A first loading module is used to control the central processing unit of the computer to load the dummy firmware from the external storage into the internal memory of the computer after the computer is powered on. A second loading module is used to load the firmware to be debugged into the internal memory through a JTAG debugging interface. An inspection and running module is used to check whether the firmware to be debugged is loaded completely by the dummy firmware.

[0013] In a third aspect, the present invention provides an electronic device, including: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to execute to implement a computer firmware rapid debugging method provided in the first aspect as described above.

[0014] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute and implement a computer firmware rapid debugging method provided in the first aspect as described above.

[0015] One or more technical solutions provided in the present invention have at least the following technical effects or advantages: In the present invention, by introducing dummy firmware with an extremely small binary file and extremely little burning time, replacing the original debugging firmware, and quickly burning it into external storage media such as EEPROM and Flash Memory, and jumping to the original debugging firmware loaded at a fixed memory address through the JTAG debugging interface during execution, the time for replacing the debugging firmware in the firmware development process is greatly shortened, and the debugging efficiency is improved.

[0016] In the method provided in the present invention, during the debugging process, the dummy firmware only needs to be burned into external storage media such as EEPROM and Flash Memory once, and then the firmware development and debugging can be carried out an unlimited number of times, greatly reducing the consumption of the service life of the external storage media.

[0017] In the method provided in the present invention, when only small function points need to be modified during firmware debugging, the modification operation can be carried out in the dummy firmware, achieving the effect of quickly verifying the debugging idea without modifying the debugging firmware. Description of the Drawings

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0019] Figure 1 It is a schematic flowchart of a method for quickly debugging computer firmware provided by the present invention; Figure 2 It is a schematic flowchart of an existing firmware debugging method provided by the present invention; Figure 3 It is a schematic structural diagram of an existing firmware debugging provided by the present invention; Figure 4 It is a schematic structural diagram of a method for quickly debugging computer firmware provided by the present invention; Figure 5 It is a schematic flowchart of another method for quickly debugging computer firmware provided by the present invention. Specific embodiments

[0020] By providing a method for quickly debugging computer firmware in the embodiments of the present invention, the technical problem of low efficiency in quickly debugging firmware in the prior art is solved.

[0021] The technical solution of the present invention to solve the above technical problem is generally as follows: A method for quickly debugging computer firmware, the method includes: using a dummy firmware to replace the firmware to be debugged, and burning the dummy firmware into the external storage of the computer where the firmware to be debugged is located, where the binary size of the dummy firmware is smaller than a preset size threshold; after the computer is powered on, controlling the central processing unit of the computer to load the dummy firmware from the external storage into the internal memory of the computer; loading the firmware to be debugged into the internal memory through the JTAG debugging interface; the dummy firmware checks whether the firmware to be debugged is loaded completely.

[0022] To better understand the above technical solution, the following will describe the above technical solution in detail in combination with the accompanying drawings of the specification and specific embodiments.

[0023] First, it should be noted that the term "and / or" appearing in this article is only a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.

[0024] Such as Figure 2As shown, when debugging computer firmware, after each modification of the computer firmware source code, the newly compiled set of debug firmware needs to perform a flashing operation on the external storage of the computer for storing the firmware through the JTAG debug interface (or other access methods for EEPROM and Flash storage). The operation time is short, ranging from 3 to 5 minutes, and in some hardware architectures, it can be as long as 10 to 20 minutes. Once the attempt to modify the code this time has no effect or introduces new bugs, even if we don't consider the time for debugging and analyzing the problems, it still takes such a long time to deploy the test version firmware again. This has a great impact on the efficiency of R & D work.

[0025] As Figure 3 shown, when debugging existing computer firmware, the "official firmware" to be debugged (i.e., the firmware to be debugged in the present invention) is burned from the debugging and development computer to the computer to be debugged through the JTAG debugger and is loaded into the memory after the computer to be debugged is powered on.

[0026] The present invention provides a Figure 1 computer firmware fast debugging method as shown, including steps S11 - S14. In addition Figure 1 to this, the method provided by the present invention can also refer to Figure 4 and Figure 5 . The debug firmware in Figure 4 is the firmware to be debugged in the present invention, and the official firmware in Figure 5 is also the firmware to be debugged in the present invention: Step S11, use a dummy firmware to replace the firmware to be debugged and burn the dummy firmware into the external storage of the computer of the firmware to be debugged, where the binary size of the dummy firmware is less than a preset size threshold.

[0027] The firmware to be debugged in the present invention includes, but is not limited to, legacy BIOS, UEFI - BIOS, U - Boot, PMON, and its main work is hardware initialization, booting the operating system, and performing basic function configuration of the computer.

[0028] The dummy firmware in the present invention refers to computer firmware software with an extremely small binary size that can be burned into computer firmware storage peripherals (including but not limited to EEPROM, Flash Memory). The dummy firmware can run in the computer central processing unit, has functions such as memory access and peripheral IO operations, and causes the central processing unit to jump to the computer firmware (including but not limited to legacyBIOS, UEFI - BIOS, U - Boot, PMON firmware) of the (to - be - debugged) computer for operation. This firmware software can be written in assembly code compatible with the central processing unit architecture to ensure the smallest compiled binary code size, or can also be written in high - level languages such as the commonly used C language in computer firmware (the binary code size is slightly larger than that of assembly code).

[0029] When written in assembly code and only having the functions of checking the completion of burning the debug firmware and jumping to run the debug firmware, the dummy firmware can be as small as 1KB. Compared with the conventional size of the to - be - debugged firmware, which is in the range of 1MB - 3MB, the dummy firmware is only 1 / 3000 - 1 / 1000 of it. The preset size threshold can be determined according to the actual situation and is not limited here.

[0030] Based on the JTAG debug interface, the dummy firmware can be burned into the external storage of the computer with the to - be - debugged firmware.

[0031] JTAG (Joint Test Action Group) is a standardized test and debug interface, originally designed for board - level testing and diagnosis. With the development of time, the JTAG interface has been widely used in embedded system development, especially in the debugging and programming of devices such as microcontrollers, processors, and FPGAs.

[0032] The original design purpose of the JTAG debug interface was to perform interconnection tests on the circuit board to ensure normal connections between components. By adding a shift register chain (called the boundary - scan register) at the boundary of each IC chip, the signal paths on the circuit board can be tested without directly accessing the signal pins.

[0033] In embedded system development, the JTAG interface is often used for debugging and programming target devices. Developers can perform operations such as online debugging of the device, downloading firmware, setting breakpoints, and viewing register and memory contents through the JTAG interface.

[0034] The JTAG debug interface supports debugging the device at runtime, including functions such as single - stepping, viewing variable values, and setting breakpoints, helping developers quickly locate and solve problems.

[0035] In addition, burning the dummy firmware into the external storage of the computer with the to - be - debugged firmware also includes: Burn the dummy firmware to the external storage of the computer for the firmware to be debugged based on Serial Peripheral Interface, Inter Integrated Circuit, Universal Asynchronous Receiver / Transmitter or USB.

[0036] SPI is a synchronous serial communication interface widely used for communication between microcontrollers and peripherals.

[0037] Embedded systems can use SPI Flash as a storage medium and directly program the Flash through the SPI interface.

[0038] I²C (Inter Integrated Circuit) is a two-wire serial bus mainly used for short-distance communication. I²C is often used to configure and control devices and can also be used for burning small-capacity firmware.

[0039] UART is an asynchronous serial communication interface often used for data exchange with external devices. Some devices support firmware updates through the UART interface.

[0040] USB is a general serial bus standard widely used for connecting computers and their peripherals.

[0041] Step S12: After the computer is powered on, control the central processing unit of the computer to load the dummy firmware from the external storage into the internal memory of the computer.

[0042] When the computer is powered on, it will first execute the POST process, which is part of the BIOS or UEFI firmware. The POST process checks the basic functions of the hardware and initializes the system. After the POST is completed, the computer will try to load the bootloader from a specified boot device (such as a hard disk, SSD, Flash, etc.). The bootloader is responsible for further loading the operating system or other key firmware.

[0043] After burning the dummy firmware into an external storage device (such as a Flash memory), the central processing unit of the computer loads the dummy firmware from the external storage into the internal memory of the computer.

[0044] In addition, it further includes: determining the actual occupied space of the binary file of the firmware to be debugged; determining the assumed occupied space of the binary file of the firmware to be debugged according to the actual occupied space; performing a filling process on the binary file of the firmware to be debugged in the form of 0xFF for each byte until the actual occupied space of the binary file of the firmware to be debugged is changed to the assumed occupied space.

[0045] Determining the assumed occupied space of the binary file of the firmware to be debugged according to the actual occupied space includes: rounding up according to the size of the actual occupied space to obtain the size of the assumed occupied space of the binary file of the firmware to be debugged.

[0046] When compiling and generating the binary file of the firmware to be debugged, perform data filling processing on the end of the binary file.

[0047] Specifically: The size of the binary file of the firmware to be debugged can be designed to be rounded up to MB (megabyte).

[0048] Currently, the sizes of computer firmware generally range from several hundred KB (kilobyte) to several MB (megabyte). The most common sizes of U-Boot and UEFI-BIOS firmware are about 4MB. Rounding up to MB can ensure that more possibilities of the size increase of the firmware to be debugged can be dealt with under the condition that the memory address of the dummy firmware remains unchanged.

[0049] For example, if the effective binary size of the firmware to be debugged is 1.2MB, then the binary size after filling is rounded up to 2MB. Even if more functions and codes are added to the firmware to be debugged during the subsequent debugging process, there is still 0.8MB of space for its expansion. This maximally ensures that the judgment logic in the dummy firmware code does not need to be changed.

[0050] Each byte of the content of the filling data can be 0xFF. After the content of the general external storage device Flash is erased, the data content is only 0xFF (determined by the Flash storage unit based on the floating gate transistor technology, that is, 0xFF represents the default data in Flash storage). In addition, when the filling data is 0xFF, it will not be regarded as a valid instruction by the CPU and executed unexpectedly.

[0051] Step S13: Load the firmware to be debugged into the internal memory through the JTAG debug interface.

[0052] The firmware to be debugged can be loaded into the internal memory of the computer based on the JTAG debug interface.

[0053] Step S14: The dummy firmware checks whether the firmware to be debugged is loaded completely.

[0054] Specifically, it includes: setting the last 16 bytes of the write address in the binary file of the firmware to be debugged to 0x00; the dummy firmware checks whether the last 16 bytes are all 0xFF in the internal memory of the computer; if so, the loading is completed, if not, the loading is not completed.

[0055] It is possible to write the last 16 consecutive byte contents of the write address in the binary file of the firmware to be debugged as 0x00, and then repeatedly read the internal memory to check whether its value is 0xFF.

[0056] It should be particularly emphasized that filling 0xff in the binary file of the firmware to be debugged here is the invalid data space in the binary file and does not replace the original data in the binary file filling.

[0057] Specifically: when the dummy firmware runs, the running code of the dummy firmware is responsible for the operation of setting 0x00 once, and after the dummy firmware sets the memory to 0x00, it starts to repeatedly check whether the last 16 bytes are 0xff (0xff exists only after the JTAG writes to the memory is completed).

[0058] First, setting the internal memory to 0x00 is to distinguish it from the 0xFF filled by the debug firmware. At the same time, the maximum size of a valid instruction in the current mainstream processor architectures is 15 bytes for the x86 architecture, and for other instruction sets such as ARM, MIPS, RISC-V, etc., generally one instruction is less than 8 bytes. Therefore, if the last 16 consecutive byte contents are 0xFF, it can be shown that this section of memory is the final filled value rather than the executable instruction of the firmware to be debugged itself.

[0059] It also includes: if the firmware to be debugged is not loaded completely, the dummy firmware checks again whether the firmware to be debugged is loaded completely; if the firmware to be debugged is loaded completely, the dummy firmware jumps to the firmware to be debugged and controls the operation of the firmware to be debugged.

[0060] In summary, the present invention provides a method for quickly debugging computer firmware. The method includes: using a dummy firmware to replace the firmware to be debugged, and burning the dummy firmware into the external storage of the computer where the firmware to be debugged is located, wherein the binary size of the dummy firmware is smaller than a preset size threshold; after the computer is powered on, controlling the central processing unit of the computer to load the dummy firmware from the external storage into the internal memory of the computer; loading the firmware to be debugged into the internal memory through the JTAG debugging interface; and the dummy firmware checks whether the firmware to be debugged is loaded completely. In the prior art, for each debugging after code changes, the entire set of firmware needs to be burned into the external storage medium again. The erasing and writing speeds of external storage media such as EEPROM and Flash Memory are slow, which wastes a lot of precious R & D and debugging time. For each debugging after code changes, the entire set of firmware needs to be burned into the external storage medium again. The storage particles currently used in external storage media such as EEPROM and Flash Memory have a limited number of erasing and writing cycles. For better particles, the TLC (three-layer storage cell) has about 1000 erasing and writing cycles, while the more common QLC (four-layer storage cell) has only about 150 erasing and writing cycles. Excessive repeated erasing and writing during debugging is very likely to cause the storage particles to consume their service life, which in turn leads to unstable firmware operation problems, and at the same time introduces more consumption of R & D and debugging time and manpower. In the ordinary debugging method, even a very small code change requires the entire set of firmware to be recompiled, which greatly hinders the quick verification of firmware debugging ideas and the rapid iteration of firmware code. The present invention introduces a dummy firmware with a very small binary file size and extremely short burning time to replace the original debugging firmware, quickly burns it into external storage media such as EEPROM and Flash Memory, and jumps to the original debugging firmware that is quickly loaded to a fixed memory address through the JTAG debugging interface during execution, so that the time for replacing the debugging firmware during the firmware development process is greatly shortened and the debugging efficiency is improved. In the method provided by the present invention, during the debugging process, the dummy firmware only needs to be burned into external storage media such as EEPROM and Flash Memory once, and then the firmware development and debugging can be carried out unlimited times, greatly reducing the consumption of the service life of the external storage media. In the case where only small functional points need to be modified during firmware debugging, the method provided by the present invention can perform modification operations in the dummy firmware to achieve the effect of quickly verifying debugging ideas without modifying the debugging firmware.

[0061] Based on the same inventive concept, the present invention provides a device for quickly debugging computer firmware. The device includes: A replacement module, configured to use a dummy firmware to replace the firmware to be debugged, and burn the dummy firmware into the external storage of the computer where the firmware to be debugged is located, wherein the binary size of the dummy firmware is smaller than a preset size threshold; The first loading module is used to control the central processing unit of the computer to load the dummy firmware from an external storage to the internal memory of the computer after the computer is powered on; The second loading module is used to load the firmware to be debugged into the internal memory through the JTAG debugging interface; The checking and running module is used for the dummy firmware to check whether the firmware to be debugged is loaded completely.

[0062] Based on the same inventive concept, the present invention further provides an electronic device, including: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to execute to implement a computer firmware rapid debugging method as provided above.

[0063] Based on the same inventive concept, the present invention further provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute to implement a computer firmware rapid debugging method as provided above.

[0064] Since the electronic device introduced in this embodiment is the electronic device adopted for implementing the information processing method in the embodiments of the present invention, based on the information processing method introduced in the embodiments of the present invention, those skilled in the art can understand the specific implementation manners and various variations of the electronic device in this embodiment. Therefore, the specific implementation of how this electronic device implements the method in the embodiments of the present invention will not be described in detail here. As long as it is the electronic device adopted by those skilled in the art to implement the information processing method in the embodiments of the present invention, it falls within the scope of protection of the present invention.

[0065] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0066] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce means for implementing the functions specified in one or more flows Figure 1 or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks.

[0067] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means for implementing the functions specified in one or more flows Figure 1 or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks.

[0068] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows Figure 1 or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks.

[0069] Although the preferred embodiments of the present invention have been described, additional changes and modifications can be made to these embodiments by those skilled in the art once they learn the basic creative concept. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0070] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims

1. A computer firmware fast debugging method, characterized in that: The method comprises: Using dummy firmware to replace the firmware to be debugged, and burning the dummy firmware into the external storage of the computer of the firmware to be debugged, wherein the binary size of the dummy firmware is smaller than a preset size threshold; After the computer is powered on, a central processing unit controlling the computer loads the dummy firmware from the external storage into an internal memory of the computer; Loading the firmware to be debugged into the internal memory via the JTAG debugging interface; The dummy firmware checks whether the firmware to be debugged has been loaded.

2. A computer firmware fast debugging method as claimed in claim 1, characterized in that: Also includes: If the firmware to be debugged has not been loaded, the dummy firmware rechecks whether the firmware to be debugged has been loaded; If the firmware to be debugged is loaded completely, the dummy firmware jumps to the firmware to be debugged and controls the firmware to be debugged to run.

3. A computer firmware fast debugging method as claimed in claim 1, characterized in that: Also includes: Determine the actual occupied space of the binary file of the firmware to be debugged; Determine the proposed occupied space of the binary file of the firmware to be debugged according to the actual occupied space; The binary file of the firmware to be debugged is filled with 0xFF per byte until the actual occupied space of the binary file of the firmware to be debugged is changed to the planned occupied space.

4. A computer firmware fast debugging method as claimed in claim 3, characterized in that: Determining the proposed occupied space of the binary file of the firmware to be debugged according to the actual occupied space includes: The size of the space actually occupied is rounded up to obtain the size of the space planned to be occupied by the binary file of the firmware to be debugged.

5. A computer firmware fast debugging method as claimed in any one of claims 3 or 4, characterized in that: The dummy firmware checks whether the firmware to be debugged has been loaded, including: The last 16 bytes of the burning address in the binary file of the firmware to be debugged are all set to 0x00; The dummy firmware checks in the internal memory of the computer whether the last 16 bytes are all 0xFF; If both are true, the loading is complete; if not, the loading is not complete.

6. A computer firmware fast debugging method as claimed in claim 1, characterized in that: Burning the dummy firmware into the external storage of the computer of the firmware to be debugged includes: Based on the JTAG debugging interface, the dummy firmware is burned into the external storage of the computer of the firmware to be debugged.

7. A computer firmware fast debugging method as claimed in claim 1, characterized in that: Burning the dummy firmware into the external storage of the computer of the firmware to be debugged also includes: Based on Serial Peripheral Interface, Inter Integrated Circuit, Universal Asynchronous Receiver / Transmitter or USB, the dummy firmware is burned into the external storage of the computer of the firmware to be debugged.

8. A computer firmware rapid debugging device, characterized in that: The device comprises: A replacement module, used for replacing the firmware to be debugged with a dummy firmware, and burning the dummy firmware into an external storage of a computer of the firmware to be debugged, wherein the binary size of the dummy firmware is smaller than a preset size threshold; A first loading module, used for controlling a central processing unit of the computer to load the dummy firmware from the external storage into an internal memory of the computer after the computer is powered on; A second loading module, used for loading the firmware to be debugged into the internal memory through a JTAG debugging interface; The checking and running module is used for the dummy firmware to check whether the firmware to be debugged has been loaded.

9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute to implement a computer firmware fast debugging method as claimed in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement a computer firmware fast debugging method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for recording mobile phone firmware

    CN102480552A

  • Method for dynamically loading application program of embedded system

    CN102541579A

  • UEFI-based firmware module debugging method and system

    CN109992517A

  • Trusted operating system debugging and updating method and system

    CN112286562A

  • Firmware updating method, system and device, computer equipment, readable storage medium and program product

    CN119536764A