An automatic identification and testing method and system for embedded device production test stage
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI BENYUAN INTERNET OF THINGS TECH CO LTD
- Filing Date
- 2026-06-30
- Publication Date
- 2026-08-07
AI Technical Summary
[0005]本发明的目的在于提供一种嵌入式设备生产测试阶段的自动识别与测试方法及系统,以解决现有技术中因测试阶段不同而需维护多个固件版本、依赖人工切换测试模式、返修流程复杂低效等问题
1.由于所述固件镜像同时集成了阶段判别模块、第一测试程序与第二测试程序,使得同一镜像可在PCBA测试阶段与整机测试阶段通用。无论生产流程进行到哪一阶段,均只需烧录此唯一固件,从而无需为不同测试阶段维护、分发和匹配多个固件版本。从根源上杜绝了因固件版本混淆而导致的烧录错误,并显著简化了物料管理,降低了生产与仓储成本。
Smart Images

Figure CN122525345A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of embedded device production testing technology, and more specifically, to an automatic identification and testing method and system for the embedded device production testing stage. Background Technology
[0002] In the mass production process of embedded devices (such as IoT terminals, industrial control boards, and automotive devices), there are typically two stages: PCBA testing and system testing. The PCBA testing stage involves testing the basic functions of the bare board, such as power supply, clock, communication interfaces, and sensors, after the printed circuit board is mounted to ensure there are no manufacturing defects such as short circuits or poor soldering. The system testing stage involves assembling the PCBA board into a housing and connecting all peripherals (such as displays, touchscreens, cameras, and batteries) to test the overall functionality, performance, and user experience.
[0003] Currently, PCBA testing and system assembly testing typically require burning different firmware images. For example, PCBA factories use PCBA test firmware containing only bare board testing logic, while system assembly plants use system assembly firmware containing overall system functional testing logic. Maintaining multiple firmware versions across different factories not only increases firmware management costs but also greatly increases the risk of burning errors and version confusion. Furthermore, switching between different testing phases often requires manual intervention, such as manually selecting test modes via buttons, DIP switches, or serial port commands. This not only increases the number of steps but also raises the probability of human error. Additionally, when PCBA testing fails and requires rework, existing methods usually require re-burning the firmware or manually re-entering the test mode after rework, resulting in a complex rework process and low production efficiency.
[0004] Therefore, how to provide a production testing method that can automatically identify the production stage, unify firmware versions, and is rework-friendly has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of this invention is to provide an automatic identification and testing method and system for embedded devices during the production testing phase, in order to solve the problems in the prior art such as the need to maintain multiple firmware versions due to different testing phases, reliance on manual switching of test modes, and complex and inefficient rework processes.
[0006] To solve the above problems, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides an automatic identification and testing method for embedded devices during the production testing phase, comprising: A firmware image is burned to the non-volatile storage medium of the device under test, wherein the non-volatile storage medium contains a predefined serial number storage area; the firmware image includes a first test program, a second test program, and a stage discrimination module; the stage discrimination module is configured to start after the device under test is powered on. After the device under test is powered on, the stage discrimination module initiates a read request to the preset integrated circuit bus address through the integrated circuit bus; If the reading fails, the device under test is determined to be in the bare PCBA stage, and the first test program is called to perform PCBA testing. If the reading is successful, the serial number storage area is further read. If the serial number storage area contains a valid serial number, the device under test is determined to be in the stage of complete assembly. The second test program is then called to perform the complete machine test. When the first or second test program fails and is returned for repair, there is no need to re-burn the firmware image. Simply powering on will trigger the stage discrimination module to re-identify the current production test stage and automatically execute the corresponding test program.
[0007] In some embodiments, the read failure includes: if the first read fails, retrying the read according to a preset number of times and time intervals; if the retry still fails, the read is ultimately determined to have failed. The successful reading includes: if the first reading is successful, then retry reading according to a preset number of times and time intervals; if the retry reading is still successful, then the reading is finally determined to be successful.
[0008] In some embodiments, performing PCBA testing further includes: If the device under test fails the PCBA test, an error indication is output and the device awaits repair. If the device under test passes the PCBA test, the first test program is automatically deleted, and the device is powered off or disconnected, awaiting the start of the assembly process.
[0009] In some embodiments, it also includes: After the assembly process is completed, the serial number of the device under test is written into the serial number storage area using an external tool.
[0010] In some embodiments, performing the whole-machine test further includes: If the device under test passes the overall test, the second test program and the stage discrimination module are automatically deleted. If the device under test fails the overall test, an error message is output and the device is returned to the assembly stage for repair.
[0011] In some embodiments, a valid serial number refers to a serial number in the serial number storage area that begins with a preset prefix.
[0012] In some embodiments, the firmware image further includes official product firmware; after automatically deleting the second test program, the method further includes: The device under test automatically restarted and entered the official product firmware mode.
[0013] In some embodiments, after determining that the device under test is in the stage of complete assembly and before calling the second test program, the method further includes: Check if the first test program exists; if it does, delete the first test program.
[0014] In some embodiments, the non-volatile storage medium includes an eMMC, the eMMC including a first test partition and a second test partition, the first test partition being used to store the first test program, and the second test partition being used to store the second test program.
[0015] Secondly, the present invention also provides an automatic identification and testing system for the production testing phase of embedded devices, comprising: The device under test includes a non-volatile storage medium containing a predefined serial number storage area; a firmware image is burned into the non-volatile storage medium, the firmware image including a first test program, a second test program, and a stage discrimination module; The stage discrimination module is configured to start after the device under test is powered on, and initiate a read request to a preset integrated circuit bus address through the integrated circuit bus; if the read fails, the device under test is determined to be in the PCBA bare board stage, and the first test program is called to perform PCBA testing; if the read is successful, the serial number storage area is further read, and if the serial number storage area contains a valid serial number, the device under test is determined to be in the complete assembly stage, and the second test program is called to perform complete assembly testing. When the first or second test program fails and is returned for repair, there is no need to re-burn the firmware image. Simply powering on will trigger the stage discrimination module to re-identify the current production test stage and automatically execute the corresponding test program.
[0016] Compared to existing technologies, the beneficial effects of this invention include at least the following: 1. Because the firmware image integrates a stage discrimination module, a first test program, and a second test program, the same image can be used in both the PCBA testing stage and the overall device testing stage. Regardless of the stage of the production process, only this single firmware needs to be burned, eliminating the need to maintain, distribute, and match multiple firmware versions for different testing stages. This fundamentally eliminates burning errors caused by firmware version confusion, significantly simplifies material management, and reduces production and warehousing costs.
[0017] 2. This invention automatically activates the stage discrimination module after the device under test (DUT) is powered on, initiating a read request to a preset address via the integrated circuit bus. The peripheral corresponding to the preset address is either not mounted or does not exist during the bare PCBA stage; it only exists and can be accessed normally after the entire device is assembled. Therefore, a read failure indicates the DUT is in the bare PCBA stage and the first test program is executed. A successful read further reads the serial number storage area; only when the serial number is valid is the device considered assembled and the second test program is executed. The entire process requires no manual operation from production line personnel, such as pressing buttons, adjusting jumpers, or sending commands via serial port, thus improving testing efficiency and completely avoiding operational errors that may be introduced by manual intervention.
[0018] 3. For scenarios involving test failures, this invention provides a simplified rework process. In this invention, when the first or second test program fails and enters the rework phase, there is no need to re-flash the firmware image. Simply powering on triggers the stage discrimination module to reread the preset address and verify the serial number storage area via the integrated circuit bus. Based on the actual hardware status and serial number information of the reworked device, it automatically enters the corresponding test process. The entire process requires no firmware re-flashing or any manual mode configuration, allowing reworked products to seamlessly and automatically return to the normal production testing flow, significantly improving the efficiency of anomaly handling.
[0019] 4. The stage discrimination logic of this invention relies on the existence of the I2C peripheral and the validity of the serial number information, exhibiting extremely high robustness. For example, even if the initial firmware image is mistakenly re-flashed to the device after the complete assembly is completed, the stage discrimination module will still correctly determine that the device under test is in the complete assembly stage based on the objective facts that "the I2C peripheral actually exists" and "a valid serial number exists in the serial number storage area" after the device is powered on. This allows the system to initiate complete assembly testing instead of PCBA testing, effectively avoiding batch testing process disruptions caused by operational errors such as accidental flashing during the production process, and ensuring the stable operation of the production line. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating an automatic identification and testing method for embedded devices during the production testing phase, as provided in an embodiment of the present invention. Figure 2This is a flowchart illustrating the PCBA testing stage in an automatic identification and testing method for embedded devices during the production testing stage, as provided in an embodiment of the present invention. Figure 3 This is a flowchart illustrating the assembly and testing phase of an automatic identification and testing method for embedded devices during the production testing phase, as provided in an embodiment of the present invention. Detailed Implementation
[0021] The present invention will be further described below with reference to specific embodiments.
[0022] As described in the background section, in the prior art, PCBA testing and complete machine testing require burning different firmware images separately. Different factories need to maintain multiple firmware versions, which increases firmware management costs and is prone to burning errors and version confusion. When switching between different testing stages, manual intervention is required, which not only increases the number of operation steps but also increases the probability of human error. After the test is completed, the test program will remain in the final product, occupying storage space, and users may accidentally enter the test mode. In addition, when the test fails and needs to be repaired, the prior art requires re-burning the firmware or manually re-entering the test mode, resulting in a complex repair process and low production efficiency.
[0023] To address the above technical issues, this embodiment provides an automatic identification and testing method for embedded devices during the production testing phase. Please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a flowchart illustrating the automatic identification and testing method for the embedded device production testing phase provided in this embodiment. The method includes: Step S1: Burn a firmware image to the non-volatile storage medium of the device under test, wherein the non-volatile storage medium contains a predefined serial number storage area; the firmware image includes a first test program, a second test program, and a stage discrimination module; the stage discrimination module is configured to start after the device under test is powered on. Step S2: After the device under test is powered on, the stage discrimination module initiates a read request to the preset integrated circuit bus address through the integrated circuit bus (Inter-Integrated Circuit, hereinafter referred to as I2C); Step S31: If the reading fails, it is determined that the device under test is in the PCBA bare board stage, and the first test program is called to perform PCBA testing; Step S32: If the reading is successful, the serial number storage area is further read. If the serial number storage area contains a valid serial number, the device under test is determined to be in the complete assembly stage. The second test program is called to perform the complete machine test. When the first or second test program fails and is returned for repair, there is no need to re-burn the firmware image. Simply powering on will trigger the stage discrimination module to re-identify the current production test stage and automatically execute the corresponding test program.
[0024] In this embodiment, the first test program, the second test program, and the stage discrimination module are integrated into the same firmware image and burned into the non-volatile storage medium of the device under test (DUT). After the DUT is powered on, the stage discrimination module is started, and a read request is initiated to a preset I2C address through the stage discrimination module. If the read is successful, the serial number validity is further verified to determine the production stage of the DUT and execute the corresponding test program. In this embodiment, the same image can be used in both the PCBA testing stage and the complete machine testing stage. Only this single firmware needs to be burned, eliminating the need to maintain, distribute, and match multiple firmware versions for different testing stages. Furthermore, no manual operation is required from production line personnel, such as pressing buttons, adjusting jumpers, or sending commands via serial port, avoiding operational errors that may be introduced by manual intervention. After the PCBA or complete machine test fails and is reworked, the operator only needs to power on the device again. The device will automatically re-execute the stage discrimination module and, based on the current actual hardware state, re-enter the correct test process (PCBA test or complete machine test).
[0025] In some embodiments, step S31, where the read fails, specifically includes: if the first read fails, retrying the read a preset number of times and time intervals; if the retry still fails, the read is ultimately determined to have failed. Step S32, where the read succeeds, specifically includes: if the first read succeeds, retrying the read a preset number of times and time intervals; if the retry still succeeds, the read is ultimately determined to have succeeded. For example, the number of retries can be set to 3, with each retrieval spaced 10 milliseconds apart. The stage determination module only makes a final determination if multiple consecutive read results are consistent.
[0026] This embodiment effectively eliminates single misreads caused by accidental factors such as instantaneous noise of the integrated circuit bus, contact jitter, or power-on timing fluctuations by introducing a retry confirmation mechanism. This significantly improves the accuracy of stage discrimination and system robustness, ensuring that the device will not mistakenly enter an incompatible test process due to occasional interference.
[0027] In some embodiments, during step S31, if the device under test (DUT) fails the PCBA test, an error indication is output, and the device awaits rework. The error indication can be achieved by an LED indicator flashing at a specific frequency or a buzzer sounding intermittently, allowing production line personnel to quickly identify the issue. If the DUT passes the PCBA test, the first test program is automatically deleted, and the device is powered off or shut down, awaiting the assembly process.
[0028] This embodiment incorporates a self-deletion function for the first test program, enabling it to automatically delete itself after passing PCBA testing. This ensures that test code from the bare PCBA stage does not remain in the equipment entering the assembly process. This not only frees up occupied storage space but also prevents the PCBA test program from being accidentally carried over to subsequent stages, guaranteeing the cleanliness of the testing process.
[0029] In some embodiments, after the assembly process is completed, the serial number of the device under test (DUT) is written into the serial number storage area using an external tool. Specifically, in this embodiment, a worker scans the barcode affixed to the casing of the DUT and writes the obtained serial number into the serial number storage area. After the writing operation is completed, the serial number storage area contains valid serial number data for subsequent verification during complete machine testing.
[0030] Specifically, in step S32, a valid serial number refers to a serial number in the serial number storage area that begins with a preset prefix. For example, the preset prefix is "ZM1". After reading the serial number from the serial number storage, the stage discrimination module checks whether its first three characters are "ZM1". If so, the serial number is determined to be valid, and the whole machine test can continue; if not, the serial number is determined to be invalid, an error message is output, and the whole machine test is prohibited. By using prefix verification, it is possible to quickly identify whether the serial number has been written correctly and to prevent other data from being mistakenly treated as a valid serial number, thus improving the accuracy and efficiency of the verification.
[0031] In some embodiments, after the waiting period for repair, the device under test (DUT) is powered on again after repair, and the stage discrimination module is restarted. The stage discrimination module initiates a read request to a preset I2C address via the I2C bus. Since the repaired device is still in the bare PCBA state, the peripheral corresponding to the preset I2C address still does not exist, and the read will still fail. The stage discrimination module will then determine that it is in the bare PCBA stage again, and thus automatically re-enter the PCBA testing process.
[0032] This embodiment addresses the scenario of PCBA test failure. After the repair is completed, the device only needs to be powered on again. The system will automatically re-determine the stage based on the current hardware status and enter the correct test mode. No firmware re-burning or any manual configuration is required throughout the process, enabling the repaired product to seamlessly and automatically return to the normal production test flow, greatly improving the efficiency of anomaly handling.
[0033] In some embodiments, during step S32, if the device under test (DUT) passes the overall system test, the second test program and the stage discrimination module are automatically deleted. If the DUT fails the overall system test, an error message is output, and the device is returned to the assembly stage for rework. The error message can be output by displaying the error code on the screen, printing an error log via the serial port, or reporting the fault information over the network.
[0034] This embodiment automatically deletes the second test program and the stage discrimination module after the whole machine test, ensuring that all code introduced for production testing is cleared after its mission is completed, so that no test programs remain in the final delivered product. This not only frees up storage space, but also fundamentally eliminates the possibility of users accidentally entering test mode, as well as the potential security risks that test code may harbor.
[0035] In some embodiments, after the return assembly stage for repair, the device under test (DUT) is powered on again, and the stage discrimination module is restarted. The stage discrimination module initiates a read request to a preset I2C address via the I2C bus. The stage discrimination module reads the serial number storage area. Since the peripherals are still fully assembled and a valid serial number is still stored in the serial number storage area during the repair, the read is successful and the serial number is valid. The stage discrimination module will then determine that the device is in the complete assembly stage again, thus automatically re-entering the complete device testing process.
[0036] In this embodiment, after the whole machine test fails and is returned for repair, the operator only needs to power on the equipment again. The system will automatically re-determine the stage based on the current hardware status and enter the whole machine test mode. There is no need to re-burn the firmware or any manual mode configuration, which allows the returned product to seamlessly continue the testing process and ensures production efficiency.
[0037] In some embodiments, the firmware image further includes the production product firmware. After automatically deleting the second test program, the device under test automatically reboots and enters the production product firmware mode. At this time, only the production product firmware and related boot code are retained in the storage medium; all test-related code has been cleared.
[0038] In this embodiment, after the overall machine test passes, the device automatically restarts and switches to the official product firmware mode, making the device directly ready for delivery. The entire process requires no manual intervention, achieving a seamless switch from the testing state to the delivery state, further improving the automation level of the production process.
[0039] In some embodiments, after determining that the device under test is in the complete assembly stage and before invoking the second test program, the method further includes: checking whether the first test program exists; if it exists, deleting the first test program. This check operation can prevent the first test program from remaining in the complete assembly stage due to abnormalities in the PCBA testing stage (such as failure to complete self-deletion properly).
[0040] This embodiment adds a check and cleanup step to the first test program before the start of the whole machine test, forming a dual protection mechanism to ensure that the test code in the PCBA stage will not remain in the whole machine test or the final product under any circumstances, thus further improving the cleanliness of the test code.
[0041] In some embodiments, the non-volatile storage medium includes an eMMC, which includes a first test partition and a second test partition. The first test partition stores the first test program, and the second test partition stores the second test program. When the first test program needs to be deleted, the first test partition can be erased; when the second test program needs to be deleted, the second test partition can be erased. Hardware partitioning isolates the test programs, ensuring that deletion operations do not affect other critical system code.
[0042] This embodiment achieves hardware-level isolation between test code and system code by storing different test programs in independent physical partitions. This makes deletion operations simple, thorough, and safe, avoiding the risk of accidentally deleting critical system code. It also facilitates storage space management and reclamation, improving system maintainability.
[0043] Specifically, the following section uses an IoT terminal device based on the RK3562 platform as an example. Figure 2 and Figure 3 The specific application of the method described in this invention will be further explained below.
[0044] The main control chip is RK3562. The power meter (an I2C peripheral used for stage identification) is only connected during the assembly stage. Its I2C address is 0x36. This device is not mounted during the PCBA bare board stage and is only connected during assembly. The storage medium is eMMC, with the following partitioning: uboot partition, kernel partition, rootfs partition (containing the official product firmware), test_pcba partition (containing the first test program), test_assembly partition (containing the second test program), and a serial number storage area.
[0045] The same Debian root file system is used to create a firmware image, which includes: the pcba_test executable file (i.e., the first test program) and the assembly_test executable file (i.e., the second test program) in the / usr / local / bin / directory; and the startup script S00_stage_detect placed in the / etc / init.d / directory. This script runs in the early stages of system startup and plays the role of the stage discrimination module.
[0046] After the surface mount technology (SMT) assembly is completed, the firmware image mentioned above is burned into the eMMC using a programming fixture.
[0047] Upon powering on the device, the S00_stage_detect script automatically runs after system startup. This script calls the i2cget tool to initiate a read request to I2C address 0x36. At this point, the fuel gauge is not yet connected, the bus returns no response, and the read fails. The script determines that the current stage is the bare PCBA board stage and then calls / usr / local / bin / pcba_test to test the onboard DDR, eMMC, GPIO, power management, clock, and other basic hardware components one by one. After all tests pass, pcba_test returns exit code 0. The script then deletes the pcba_test file and related contents in the test_pcba partition, and executes the poweroff command to shut down the device. The testing station removes the tested boards and sends them to the assembly plant. If the test fails, the device enters an error indication state, awaiting processing by production line personnel.
[0048] The assembly line installs the PCBA board into the casing and connects peripherals such as the fuel gauge (I2C address 0x36), battery, display screen, touch screen, and camera to complete the assembly. Subsequently, workers use external tools to scan the barcode affixed to the casing of the device under test and write the obtained serial number (e.g., "ZM1XXXXXXXX") into the device's serial number storage area through the debugging interface.
[0049] After the device is powered on and the system boots up, the S00_stage_detect script runs again, accessing I2C address 0x36 via i2cget. At this point, the fuel gauge is successfully connected and powered on, and the bus returns the chip ID of the device. The script then reads the serial number from the serial number storage area and checks if it begins with the preset prefix "ZM1". If so, the serial number is considered valid, and the script determines that the device is now in the assembly completion stage. Before calling assembly_test, the script checks if pcba_test still exists; if so, it deletes it to ensure no remnants remain. The script then calls / usr / local / bin / assembly_test to comprehensively test the device's touch response, display effects, audio path, Wi-Fi communication, sensor data, and other functions. After all tests pass, the script deletes the assembly_test file and related contents in the test_assembly partition, and deletes itself ( / etc / init.d / S00_stage_detect). Finally, it executes the reboot command to restart the device.
[0050] After the device restarts, there are no test programs or stage judgment scripts left in the storage medium. The system directly boots into the official product firmware mode, becoming a factory-delivered device that can be used directly by the user.
[0051] In this application example, the handling process for abnormal scenarios is as follows: If the PCBA test fails, the device remains in an error indication loop. After the production line worker confirms the fault and completes the repair, they only need to power on the device again. Since the fuel gauge is still not connected at this time, the S00_stage_detect script will still fail to read address 0x36 via I2C, and pcba_test has not been deleted because the previous test failed. Therefore, the system will again determine that it is in the bare PCBA stage and automatically re-execute the PCBA test without re-flashing the firmware.
[0052] If the overall system test fails, the device will remain in an error indication loop. After repair and power-on, since all peripherals (including the fuel gauge) are still fully assembled, I2C read of address 0x36 is successful, and the original valid serial number is still retained in the serial number storage area, and assembly_test was not deleted because the previous test failed, the system will again determine that the overall system assembly is complete and automatically re-execute the overall system test.
[0053] If, due to operational error, the assembly plant re-flashes the complete firmware image containing `pcba_test` onto the already assembled device, the `S00_stage_detect` script can still successfully read the fuel gauge ID and the valid serial number in the serial number storage area via I2C after the device powers on. Based on this, the script correctly determines that the device is in the assembly completion stage. Before calling `assembly_test`, it will first delete the residual `pcba_test` and then directly execute the complete device test, ensuring that the PCBA test is not executed incorrectly. This design makes the system's judgment completely dependent on the physical hardware state, providing extremely high robustness.
[0054] Based on the same inventive concept, this embodiment also provides an automatic identification and testing system for the production testing stage of embedded devices, including: a device under test (DUT), the DUT including a non-volatile storage medium containing a predefined serial number storage area. A firmware image is burned into the non-volatile storage medium, the firmware image including a first test program, a second test program, and a stage discrimination module. The stage discrimination module is configured to start after the DUT is powered on, and initiate a read request to a preset I2C address via the I2C bus. If the read fails, the DUT is determined to be in the PCBA bare board stage, the first test program is invoked, and PCBA testing is performed; if the read succeeds, the serial number storage area is further read. If the serial number storage area contains a valid serial number, the DUT is determined to be in the complete assembly stage, the second test program is invoked, and complete assembly testing is performed. Wherein, when the first or second test program fails and is returned for repair, it is not necessary to re-burn the firmware image; simply powering on again will trigger the stage discrimination module to re-identify the current production testing stage and automatically execute the corresponding test program.
[0055] Specifically, the device under test (DUT) can be an embedded device based on a main control chip such as the RK3562. Non-volatile storage media, such as eMMC, can be internally divided into multiple partitions to store the first test program, the second test program, and the stage discrimination module, respectively. The preset I2C address is, for example, 0x36, corresponding to the fuel gauge or other peripherals connected only during the final stage of the device assembly.
[0056] The system provided in this embodiment only requires maintenance and burning of one firmware image, which can adapt to both PCBA bare board testing and whole machine testing scenarios; it achieves fully automatic stage identification by utilizing hardware physical differences, without the need for manual jumpers, DIP switches or command selection; the test program and stage discrimination module can be automatically cleared after completing their mission, ensuring the purity of the final product; during rework, simply powering on again will automatically return to the correct test process, significantly simplifying production and rework operations and improving overall efficiency and reliability.
Claims
1. An automatic identification and testing method for embedded devices during the production testing phase, characterized in that, include: A firmware image is burned to the non-volatile storage medium of the device under test, wherein the non-volatile storage medium contains a predefined serial number storage area; the firmware image includes a first test program, a second test program, and a stage discrimination module; The stage discrimination module is configured to start after the device under test is powered on; After the device under test is powered on, the stage discrimination module initiates a read request to the preset integrated circuit bus address through the integrated circuit bus; If the reading fails, the device under test is determined to be in the bare PCBA stage, and the first test program is called to perform PCBA testing. If the reading is successful, the serial number storage area is further read. If the serial number storage area contains a valid serial number, the device under test is determined to be in the stage of complete assembly. The second test program is then called to perform the complete machine test. When the first or second test program fails and is returned for repair, there is no need to re-burn the firmware image. Simply powering on will trigger the stage discrimination module to re-identify the current production test stage and automatically execute the corresponding test program.
2. The automatic identification and testing method for embedded devices in the production testing phase as described in claim 1, characterized in that, The reading failure includes: if the first reading fails, the reading is retried according to a preset number of times and time intervals; if the retried reading still fails, the reading is finally determined to be a failure. The successful reading includes: if the first reading is successful, then retry reading according to a preset number of times and time intervals; if the retry reading is still successful, then the reading is finally determined to be successful.
3. The automatic identification and testing method for embedded devices in the production testing phase as described in claim 1, characterized in that, The PCBA testing process also includes: If the device under test fails the PCBA test, an error indication is output and the device awaits repair. If the device under test passes the PCBA test, the first test program is automatically deleted, and the device is powered off or disconnected, awaiting the start of the assembly process.
4. The automatic identification and testing method for embedded devices in the production testing phase as described in claim 3, characterized in that, Also includes: After the assembly process is completed, the serial number of the device under test is written into the serial number storage area using an external tool.
5. The automatic identification and testing method for embedded devices in the production testing phase as described in claim 1, characterized in that, The process of performing the whole-machine test also includes: If the device under test passes the overall test, the second test program and the stage discrimination module are automatically deleted. If the device under test fails the overall test, an error message is output and the device is returned to the assembly stage for repair.
6. The automatic identification and testing method for embedded devices in the production testing phase as described in claim 1, characterized in that, A valid serial number refers to a serial number in the serial number storage area that begins with a preset prefix.
7. The automatic identification and testing method for embedded devices in the production testing phase as described in claim 5, characterized in that, The firmware image also includes official product firmware; after automatically deleting the second test program, it also includes: The device under test automatically restarted and entered the official product firmware mode.
8. The automatic identification and testing method for embedded devices during the production testing phase as described in claim 1 or 3, characterized in that, After determining that the device under test is in the complete assembly stage, and before calling the second test program, the method further includes: Check if the first test program exists; if it does, delete the first test program.
9. The automatic identification and testing method for embedded devices in the production testing phase as described in claim 1, characterized in that, The non-volatile storage medium includes an eMMC, which includes a first test partition and a second test partition. The first test partition is used to store the first test program, and the second test partition is used to store the second test program.
10. An automatic identification and testing system for the production testing phase of embedded devices, characterized in that, include: The device under test includes a non-volatile storage medium containing a predefined serial number storage area; a firmware image is burned into the non-volatile storage medium, the firmware image including a first test program, a second test program, and a stage discrimination module; The stage discrimination module is configured to start after the device under test is powered on, and initiate a read request to a preset integrated circuit bus address through the integrated circuit bus; If the reading fails, the device under test is determined to be in the bare PCBA stage, and the first test program is called to perform PCBA testing. If the read is successful, the serial number storage area is further read. If the serial number storage area contains a valid serial number, the device under test is determined to be in the complete assembly stage. The second test program is then called and the complete machine test is performed. When the first or second test program fails and is returned for repair, there is no need to re-burn the firmware image. Simply powering on will trigger the stage discrimination module to re-identify the current production test stage and automatically execute the corresponding test program.