Factory test detection method and system for firmware burning

By real-time detection of firmware burn integrity and automatically sending factory test trigger signals, combining layered testing and dual-channel redundant signal technology, the problems of manual dependence and incomplete testing in traditional firmware burn testing are solved, fully automated closed-loop control is realized, and production efficiency is improved and operation costs are reduced.

CN120540896APending Publication Date: 2025-08-26FUZHOU MILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510669140.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

When traditional firmware needs factory testing after burning, there are problems such as strong manual dependence, high risk of misoperation, missing exception handling, and incomplete test coverage, resulting in equipment damage and low production efficiency.

Method used

Real-time detection of firmware burn integrity, and automatic factory test trigger signals are sent through layered testing methods, combining dual-channel redundant signal technology and dynamic link library to realize fully automated closed-loop control of burning, verification and testing.

Benefits of technology

Fully automated testing after firmware burning is realized, which reduces manual intervention, improves production efficiency, reduces operating costs, and ensures the integrity and reliability of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120540896A_ABST
    Figure CN120540896A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of embedded systems, in particular to a factory test detection method and system for firmware burning. According to the method, firmware burning is carried out on a terminal to be tested, whether firmware burning is complete or not is detected in real time during burning, and when it is detected that firmware burning is complete, a factory test trigger signal is sent to a control end; after receiving the factory test trigger signal, the control end tests the terminal which completes firmware burning by a layered test method; and after the test is completed, generating a corresponding test report, combining the MAC address of the terminal, the test timestamp generated during the test and the CRC check value to generate a data identifier, binding the data identifier with the test report, and storing the data identifier and the test report. By means of the mode, when firmware burning is completed, the factory test trigger signal can be automatically sent to the control end, follow-up factory test is carried out, and therefore full-automatic closed-loop control over burning, verification and testing is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of embedded systems, and in particular to a factory testing method and system for firmware burning. Background Art

[0002] Traditional firmware requires factory testing after flashing, but this currently suffers from the following drawbacks: 1. It is highly manual, requiring operators to manually switch to test mode, which carries the risk of misoperation. 2. Exception handling is lacking, and in the event of a flash failure, there is no automatic rollback mechanism, resulting in device bricking. 3. Test coverage is incomplete, with functional testing separated from hardware testing, preventing a complete closed-loop quality control loop. Summary of the Invention

[0003] In view of this, an object of the present invention is to provide a factory test method and system for firmware burning to solve the problems mentioned in the above background technology.

[0004] In order to achieve the above object, the technical solution adopted by the present invention is: A factory test method for firmware burning includes the following steps: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

[0005] Furthermore, the method for detecting whether the firmware burning is complete in step S1 is: Obtain the hash value of the firmware image and compare the obtained hash value with the preset value. If the two match, it is determined that the firmware burning is complete.

[0006] Furthermore, step S1 further includes: When it is detected that the firmware burning is complete and the write protection flag of the storage area is cleared, the factory test trigger signal is sent to the control end through the hardware watchdog interrupt.

[0007] Furthermore, the factory test trigger signal is sent to the control end using a dual-channel redundant signal technology.

[0008] Furthermore, the hierarchical testing method in step S2 is specifically as follows: All firmware modules are classified and tested according to the hardware layer, driver layer and application layer. Each test item exists in the form of a dynamic link library, and the test sequence is loaded on demand through address remapping.

[0009] A factory test system for firmware burning includes a processor and a memory, wherein the memory stores a program or instruction. When the program or instruction is executed by the processor, the following steps are implemented: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

[0010] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: Obtain the hash value of the firmware image and compare the obtained hash value with the preset value. If the two match, it is determined that the firmware burning is complete.

[0011] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: When it is detected that the firmware burning is complete and the write protection flag of the storage area is cleared, the factory test trigger signal is sent to the control end through the hardware watchdog interrupt.

[0012] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: the factory test trigger signal is sent to the control end using a dual-channel redundant signal technology.

[0013] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented: All firmware modules are classified and tested according to the hardware layer, driver layer and application layer. Each test item exists in the form of a dynamic link library, and the test sequence is loaded on demand through address remapping.

[0014] The beneficial effects of the present invention are: The present invention provides a factory test detection method and system for firmware burning, which burns the firmware of the terminal to be tested and detects whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, a factory test trigger signal is sent to the control end; after the control end receives the factory test trigger signal, it tests the terminal that has completed the firmware burning using a layered testing method; after the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC checksum value are combined to generate a data identifier, and the data identifier is bound to the test report and stored. Through the above method, when the firmware burning is completed, the factory test trigger signal can be automatically sent to the control end for subsequent factory testing, thereby realizing fully automated closed-loop control of burning, verification, and testing. Through the design of no human intervention in the entire process, the multiple manual confirmation operations required for the traditional production line are simplified to a zero-contact process, production efficiency is improved, and operating costs are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 FIG2 is a flowchart showing the steps of a factory test method for firmware burning of the present invention; Figure 2 FIG2 is a structural block diagram of a factory test system for firmware burning according to the present invention; Description of Figure Numbers: 1-Processor; 2-Memory. DETAILED DESCRIPTION

[0016] The present invention will be further described below with reference to the accompanying drawings and specific embodiments: like Figure 1 As shown, the present invention provides a factory test method for firmware burning, comprising the following steps: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

[0017] From the above description, it can be seen that the present invention has the following beneficial effects: The present invention provides a factory test detection method for firmware burning, which burns the firmware of the terminal to be tested and detects whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, a factory test trigger signal is sent to the control end; after the control end receives the factory test trigger signal, it tests the terminal that has completed the firmware burning using a layered test method; after the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC checksum value are combined to generate a data identifier, and the data identifier is bound to the test report and stored. Through the above method, when the firmware burning is completed, the factory test trigger signal can be automatically sent to the control end for subsequent factory testing, thereby realizing fully automated closed-loop control of burning, verification, and testing. Through the full-process no-human-intervention design, the multiple manual confirmation operations required for the traditional production line are simplified to a zero-contact process, production efficiency is improved, and operating costs are reduced.

[0018] Furthermore, the method for detecting whether the firmware burning is complete in step S1 is: Obtain the hash value of the firmware image and compare the obtained hash value with the preset value. If the two match, it is determined that the firmware burning is complete.

[0019] From the above description, it can be seen that the above method can be used to determine whether the firmware burning is complete, which can serve as a basis for determining whether to trigger subsequent factory testing.

[0020] Furthermore, step S1 further includes: When it is detected that the firmware burning is complete and the write protection flag of the storage area is cleared, the factory test trigger signal is sent to the control end through the hardware watchdog interrupt.

[0021] From the above description, it can be seen that the linkage between programming and factory testing is achieved through the above method.

[0022] Furthermore, the factory test trigger signal is sent to the control end using a dual-channel redundant signal technology.

[0023] From the above description, we can see that the dual-channel redundant signal technology specifically adopts the method of triggering the main channel by the GPIO level and the backup channel by sending the 0xFA command word by the UART, thereby ensuring 100% reliability of the mode switching signal.

[0024] Furthermore, the hierarchical testing method in step S2 is specifically as follows: All firmware modules are classified and tested according to the hardware layer, driver layer and application layer. Each test item exists in the form of a dynamic link library, and the test sequence is loaded on demand through address remapping.

[0025] From the above description, we can see that using dynamic link libraries can greatly reduce space usage, and using address remapping can avoid memory address duplication, greatly improving test stability.

[0026] See Figure 2 The present invention also provides a factory test system for firmware burning, comprising a processor 1 and a memory 2, wherein the memory 2 stores a program or instruction, and when the program or instruction is executed by the processor 1, the following steps are implemented: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

[0027] From the above description, it can be seen that the present invention has the following beneficial effects: The present invention provides a factory test detection system for firmware burning, which burns the firmware of the terminal to be tested and detects whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, a factory test trigger signal is sent to the control end; after the control end receives the factory test trigger signal, it tests the terminal that has completed the firmware burning using a layered testing method; after the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC checksum value are combined to generate a data identifier, and the data identifier is bound to the test report and stored. Through the above method, when the firmware burning is completed, the factory test trigger signal can be automatically sent to the control end for subsequent factory testing, thereby realizing fully automated closed-loop control of burning, verification, and testing. Through the full-process no-human-intervention design, the multiple manual confirmation operations required for the traditional production line are simplified to a zero-contact process, production efficiency is improved, and operating costs are reduced.

[0028] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: Obtain the hash value of the firmware image and compare the obtained hash value with the preset value. If the two match, it is determined that the firmware burning is complete.

[0029] From the above description, it can be seen that the above method can be used to determine whether the firmware burning is complete, which can serve as a basis for determining whether to trigger subsequent factory testing.

[0030] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: When it is detected that the firmware burning is complete and the write protection flag of the storage area is cleared, the factory test trigger signal is sent to the control end through the hardware watchdog interrupt.

[0031] From the above description, it can be seen that the linkage between programming and factory testing is achieved through the above method.

[0032] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: the factory test trigger signal is sent to the control end using a dual-channel redundant signal technology.

[0033] From the above description, we can see that the dual-channel redundant signal technology specifically adopts the method of triggering the main channel by the GPIO level and the backup channel by sending the 0xFA command word by the UART, thereby ensuring 100% reliability of the mode switching signal.

[0034] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented: All firmware modules are classified and tested according to the hardware layer, driver layer and application layer. Each test item exists in the form of a dynamic link library, and the test sequence is loaded on demand through address remapping.

[0035] From the above description, we can see that using dynamic link libraries can greatly reduce space usage, and using address remapping can avoid memory address duplication, greatly improving test stability.

[0036] Several preferred embodiments or application examples are listed below to help those skilled in the art better understand the technical content of the present invention and the technical contribution made by the present invention relative to the prior art: Preferred embodiment one: like Figure 1 As shown, the present invention provides a factory test method for firmware burning, comprising the following steps: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; In this embodiment, the method for detecting whether the firmware burning is complete in step S1 is: Obtain the hash value of the firmware image and compare it with a preset value. If the two match, the firmware is considered to have been burned successfully. When the firmware is detected to be burned successfully and the write-protect flag of the storage area is cleared, a factory test trigger signal is sent to the control end via a hardware watchdog interrupt. This factory test trigger signal is sent to the control end using dual-channel redundant signaling technology.

[0037] Specifically, when the burn-in verification module detects that the firmware image's SHA256 checksum matches the preset value and the memory area write-protect flag (WRP_Flag) is cleared, a hardware watchdog interrupt triggers a switch to factory test mode. Furthermore, a dual-channel redundant signal design (primary channel: GPIO level trigger; backup channel: UART sending the 0xFA command word) ensures 100% reliability of the mode switching signal.

[0038] Dual-channel redundant signal design: Step 1: After programming is complete, the main MCU performs the following operations simultaneously: GPIO channel: outputs a specific level sequence (10ms high level -> 5ms low level -> 10ms high level); UART channel: Send the OxFA command word (including start bit, data bit, and stop bit, 0x7E 0xFA 0x00).

[0039] Step 2: Target device receives the signal: GPIO monitoring: Detects level changes through hardware interrupts and triggers mode switching if a preset sequence is matched.

[0040] UART analysis: Check whether the received command is 0xFA. If it is correct, execute the switch.

[0041] Step 3: Target device feedback status: The master MCU confirms the successful switching by returning a confirmation frame via UART.

[0042] Process design: 1. After the burning tool completes firmware writing, it notifies the main control MCU to start factory testing through specific pin levels or serial port commands.

[0043] 2. The main MCU performs dual-channel signal transmission, and the target device enters factory test mode.

[0044] 3. After the factory test is completed, the target device returns the test results via UART.

[0045] S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; In this embodiment, the hierarchical testing method in step S2 is specifically as follows: All firmware modules are categorized and tested according to the hardware layer, driver layer, and application layer. Each test item is stored as a dynamic link library (DLL), and address remapping is used to enable on-demand loading of test sequences. Using a DLL significantly reduces memory usage, and address remapping avoids memory address duplication, significantly improving test stability. In this embodiment, independent memory space is allocated for each test item.

[0046] Specifically, a layered testing architecture consisting of hardware, driver, and application layers is used in firmware testing. Its unique features lie in modular isolation, scalability, debugging efficiency, and resource reuse, as follows: 1. Modular isolation and precise positioning The hardware layer test focuses on physical layer functions such as GPIO level triggering and UART communication. The driver layer verifies the device driver's abstraction and control logic of the hardware, and the application layer simulates user scenarios to test business logic.

[0047] The layered design deconstructs complex systems. If a UART command word fails to be sent, it can be quickly located at the driver or hardware layer, avoiding full system troubleshooting.

[0048] 2. Scalability and dynamic loading Each layer of testing is implemented in the form of a dynamic link library DLL. For example, the hardware layer test package is hardwaretest.dll, and the driver layer is drivertest.dll.

[0049] Through address remapping technology, the test framework can load the corresponding DLL on demand, avoiding the full code from being resident in memory and reducing resource usage.

[0050] 3. Debugging efficiency and automation Layered testing supports independent debugging. For example, when debugging GPIO signals at the hardware layer, there is no need to enable driver layer or application layer code.

[0051] Automated test scripts can call DLLs at different layers to implement full-link automated testing from hardware to application, improving regression testing efficiency.

[0052] 4. Resource reuse and standardization The hardware layer test DLL can be reused for different products, and the driver layer DLL can be adapted to multiple operating systems.

[0053] Standardization of layered interfaces can reduce cross-layer coupling and improve code reusability.

[0054] Optimization and changes of DLL and address remapping in this solution This solution improves existing technologies in three main dimensions: dynamism, resource efficiency, and flexibility. The details are as follows: 1. Dynamic enhancement: on-demand loading and hot replacement Traditional DLL: Usually loaded when the program starts, and the process needs to be restarted after modification.

[0055] Optimization of this solution: Dynamic loading and unloading at runtime is achieved through address remapping.

[0056] 2. Improved resource efficiency: memory sharing and redundancy elimination Traditional DLL: Multiple processes need to load multiple copies of the DLL, resulting in high memory usage.

[0057] Optimization of this solution: Multiple processes share the same DLL instance through address remapping.

[0058] 3. Improved flexibility: dynamic configuration and multi-version support Traditional DLL: Version conflicts require SxS (Side-by-Side) technology or modifying the PATH environment variable.

[0059] This solution optimizes address remapping to dynamically switch between multiple DLL versions. For example, the test framework can maintain a DLL version pool and map UARTTest_v1.dll or UARTTest_v2.dll to the same address space based on test requirements.

[0060] Application scenario: In the automatic factory test after burning, the corresponding test DLL can be dynamically loaded according to the device model without recompiling the test framework.

[0061] In this embodiment, the hardware layer: The power management unit performs voltage and current ripple testing. The driver layer: The peripheral controller verifies I2C / SPI and other bus communications. The application layer: The stress test module simulates high-load operating scenarios.

[0062] S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

[0063] Preferred embodiment 2: See Figure 2 The present invention also provides a factory test system for firmware burning, comprising a processor 1 and a memory 2, wherein the memory 2 stores a program or instruction, and when the program or instruction is executed by the processor 1, the following steps are implemented: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

[0064] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: Obtain the hash value of the firmware image and compare the obtained hash value with the preset value. If the two match, it is determined that the firmware burning is complete.

[0065] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: When it is detected that the firmware burning is complete and the write protection flag of the storage area is cleared, the factory test trigger signal is sent to the control end through the hardware watchdog interrupt.

[0066] Furthermore, when the program or instruction is executed by the processor, the following steps are implemented: the factory test trigger signal is sent to the control end using a dual-channel redundant signal technology.

[0067] Furthermore, when the program or instruction is executed by the processor, the following steps are specifically implemented: All firmware modules are classified and tested according to the hardware layer, driver layer and application layer. Each test item exists in the form of a dynamic link library, and the test sequence is loaded on demand through address remapping.

[0068] The present invention has been described with reference to the above embodiments and accompanying drawings. However, the above embodiments are merely exemplary embodiments of the present invention. It should be noted that the disclosed embodiments do not limit the scope of the present invention. On the contrary, modifications and equivalents falling within the spirit and scope of the claims are intended to be within the scope of the present invention.

Claims

1. A factory test method for firmware burning, characterized in that: The following steps are involved: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

2. The factory test method for firmware burning according to claim 1, characterized in that: The method for detecting whether the firmware burning is complete in step S1 is: Obtain the hash value of the firmware image and compare the obtained hash value with the preset value. If the two match, it is determined that the firmware burning is complete.

3. The factory test method for firmware burning according to claim 2, wherein: Step S1 further includes: When it is detected that the firmware burning is complete and the write protection flag of the storage area is cleared, the factory test trigger signal is sent to the control end through the hardware watchdog interrupt.

4. A factory test method for firmware burning according to claim 1 or 3, characterized in that: The factory test trigger signal is sent to the control end using a dual-channel redundant signal technology.

5. The factory test method for firmware burning according to claim 1, characterized in that: The hierarchical testing method in step S2 is specifically as follows: All firmware modules are classified and tested according to the hardware layer, driver layer and application layer. Each test item exists in the form of a dynamic link library, and the test sequence is loaded on demand through address remapping.

6. A factory test system for firmware burning, characterized in that: The system comprises a processor and a memory, wherein the memory stores a program or instruction, and when the program or instruction is executed by the processor, the following steps are implemented: S1. Burn the firmware of the terminal to be tested, and detect whether the firmware burning is complete in real time during burning. When it is detected that the firmware burning is complete, send a factory test trigger signal to the control terminal; S2. After receiving the factory test trigger signal, the control terminal tests the terminal that has completed firmware burning using a layered test method; S3. After the test is completed, a corresponding test report is generated, and the MAC address of the terminal, the test timestamp generated during the test, and the CRC check value are combined to generate a data identifier, and the data identifier is bound to the test report and stored.

7. The factory test system for firmware burning according to claim 6, characterized in that: When the program or instruction is executed by the processor, the following steps are implemented: Obtain the hash value of the firmware image and compare the obtained hash value with the preset value. If the two match, it is determined that the firmware burning is complete.

8. The factory test system for firmware burning according to claim 7, characterized in that: When the program or instruction is executed by the processor, the following steps are implemented: When it is detected that the firmware burning is complete and the write protection flag of the storage area is cleared, the factory test trigger signal is sent to the control end through the hardware watchdog interrupt.

9. A factory test system for firmware burning according to claim 6 or 8, characterized in that: When the program or instruction is executed by the processor, the following steps are implemented: the factory test trigger signal is sent to the control end using a dual-channel redundant signal technology.

10. The factory test system for firmware burning according to claim 6, characterized in that: When the program or instruction is executed by the processor, the following steps are specifically implemented: All firmware modules are classified and tested according to the hardware layer, driver layer and application layer. Each test item exists in the form of a dynamic link library, and the test sequence is loaded on demand through address remapping.