Method and apparatus for testing embedded chips

By deploying independent firmware packages in the embedded chip testing method and utilizing loop control logic and cold reset mechanism, full address space coverage testing of LPDDR, UFS, and eMMC chips was achieved, solving the problems of incomplete testing and low efficiency in the existing technology, and improving test automation and coverage.

CN123182737APending Publication Date: 2026-11-27HUBEI CHANGJIANG WANRUN SEMICON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611708904.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-11-02
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, the testing of LPDDR, UFS, and eMMC chips suffers from incomplete address coverage, low testing efficiency, and insufficient test types. This is especially true when testing on Android or Linux platforms, which results in incomplete address space coverage, system partitions being locked to read-only mode, making it impossible to achieve full address traversal. Furthermore, switching projects requires re-flashing the image, affecting mass production efficiency.

Method used

A testing method for embedded chips is provided. By deploying the firmware package in an independent storage medium, which includes a first-level boot code segment, a second-level boot code segment, and an operating system kernel code segment, full physical address space testing, address stress testing, and logical address space read/write testing are performed respectively. The three-stage test is automated by using monitor shell loop control logic and cold reset mechanism. In the operating system kernel stage, a second type of storage chip is mounted as a data disk for protocol testing.

Benefits of technology

It enables comprehensive testing of all physical addresses of Type I memory chips and all logical addresses of Type II memory chips, simplifying the mass production process, improving testing efficiency and automation, and enabling read/write stress testing and protocol layer testing to be completed in the same test scheme, with more comprehensive coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182737A_ABST
    Figure CN123182737A_ABST
Patent Text Reader

Abstract

The application provides a test method and device for embedded chips, and the method is applied to a test system including first type storage chips and second type storage chips; the method comprises the following steps: deploying a firmware package in a local storage medium of the test system; the firmware package is integrated with a first level boot code section, a second level boot code section and an operating system kernel code section; in response to a power-on instruction, the first level boot code section is loaded and executed to perform a full physical address space test on the first type storage chips; after the full physical address space test is completed, the second level boot code section is loaded and executed to perform an address stress test on the first type storage chips; after the address stress test is completed, the operating system kernel code section is executed to start an operating system kernel to perform a full logical address space read-write test and / or a protocol test on the second type storage chips. The application reduces test cost, improves production test efficiency and test coverage type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of storage testing technology, and more specifically to a testing method and apparatus for embedded chips. Background Technology

[0002] LPDDR, UFS, and eMMC chips are commonly used in embedded mobile terminal devices, and their stability directly affects the device's operational status. Even after LPDDR, UFS, and eMMC chips are manufactured and packaged from wafers, rigorous testing is still required at the manufacturing stage to ensure the stability of the chips. Therefore, efficient, comprehensive, and low-cost testing solutions are key requirements in the chip mass production process.

[0003] Currently, the industry typically conducts testing of these chips on Android or Linux platforms. LPDDR testing performs algorithm stress testing during the second-level boot stage, but the boot code needs to occupy part of the LPDDR address space and refuses access to the test program, resulting in incomplete address coverage; UFS / eMMC testing performs read and write tests after system startup, but the system partition is also locked as read-only or occupied, making it impossible to achieve full address traversal; algorithm stress testing and system-level testing require the use of different images, and switching projects requires re-flashing, affecting mass production efficiency; and protocol testing cannot be carried out outside the system stage, resulting in insufficient test coverage.

[0004] Therefore, there is an urgent need to provide a testing method and device for embedded chips that can achieve full coverage of the chip's address space and complete all testing requirements with only a single firmware package, so as to reduce testing costs, improve mass production testing efficiency, and expand the types of tests covered. Summary of the Invention

[0005] In view of this, it is necessary to provide a testing method and apparatus for embedded chips to solve the technical problems of incomplete address coverage, low testing efficiency and insufficient test types in the prior art.

[0006] To address the aforementioned technical problems, in a first aspect, the present invention provides a testing method for embedded chips, applicable to a testing system comprising a first type of memory chip and a second type of memory chip, wherein the first type of memory chip is a volatile storage medium and the second type of memory chip is a non-volatile storage medium. The testing method includes: The firmware package is deployed in the test system on a local storage medium independent of the first type of memory chip and the second type of memory chip; the firmware package integrates a first-level boot code segment, a second-level boot code segment, and an operating system kernel code segment. In response to the power-on command, the first-level boot code segment is loaded and executed. When the first type of memory chip has completed initialization and the storage space of the first type of memory chip is not occupied, a full physical address space test is performed on the first type of memory chip. After the full physical address space test is completed, the second-level boot code segment is loaded and executed to perform an address stress test on the first type of memory chip; After the address stress test is completed, the operating system kernel code segment is executed to start the operating system kernel. The operating system kernel then mounts the second type of storage chip as a data disk and performs full logical address space read / write tests and / or protocol tests on the second type of storage chip.

[0007] In one possible implementation, the first-level boot code segment includes a pre-boot code segment and a main boot code segment; The step of performing a full physical address space test on the first type of memory chip includes: Load and execute the pre-boot code segment, and perform a full physical address space test on the first type of memory chip within the test window corresponding to the pre-boot code segment; After the pre-boot code segment is executed, the main boot code segment is loaded and executed. The main boot code segment is used to initialize subsequent hardware.

[0008] In one possible implementation, the first-level bootstrap code segment is configured with first-stage loop control logic; The first-stage loop control logic is used for: After entering the first-level test phase corresponding to the first-level bootstrap code segment, the first-level bootstrap code segment is restricted to loop execution within the first-level test phase; In response to the exit command of the first-level test phase, the loop of the first-level test phase is terminated to enter the second-level test phase corresponding to the second-level bootstrap code segment.

[0009] In one possible implementation, the first-stage loop control logic is specifically used for: After entering the pre-test phase corresponding to the pre-boot code segment, the pre-boot code segment is restricted to loop execution within the pre-test phase; In response to the exit command of the pre-test phase, the loop of the pre-test phase is released to enter the main boot test phase corresponding to the main boot code segment; After entering the main boot test phase, the main boot code segment is restricted to execution in a loop within the main boot test phase; In response to the exit command of the master boot test phase, the loop of the master boot test phase is terminated to enter the second-level test phase.

[0010] In one possible implementation, the second-level bootstrap code segment is configured with second-stage loop control logic; The second-stage loop control logic is used for: After entering the second-level test phase corresponding to the second-level bootstrap code segment, the second-level bootstrap code segment is restricted to loop execution within the second-level test phase; In response to the exit instruction of the second-level test phase, the loop of the second-level test phase is terminated to enter the third-level test phase corresponding to the operating system kernel code segment.

[0011] One possible implementation also includes: During the testing phase corresponding to the main boot code segment, the second-level boot code segment, or the operating system kernel code segment, the pre-boot code segment is reloaded and executed in response to the reset trigger signal of the test system.

[0012] In one possible implementation, performing a full physical address space test on the first type of memory chip includes: Determine whether an input command has been received within the preset time period; If not, then perform a full physical address space test on the first type of memory chip; If so, then the operation corresponding to the input instruction is executed.

[0013] In one possible implementation, the first type of memory chip is LPDDR, and the second type of memory chip is UFS and / or eMMC.

[0014] In one possible implementation, when the second type of storage chip is UFS or eMMC, the step of mounting the second type of storage chip as a data disk by the operating system kernel includes: In response to the strobe signal of UFS or eMMC, the operating system kernel mounts UFS or eMMC as a data disk.

[0015] Secondly, the present invention also provides a testing apparatus for embedded chips, comprising: The data processing board is used to receive test commands issued by the host computer. The core test board is connected to the data processing board. The core test board integrates a system-on-a-chip, a first test position for installing a first type of memory chip, at least two second test positions for installing at least two types of second type memory chips, and a high-speed switch. The first type of memory chip is a volatile memory medium, and the second type of memory chip is a non-volatile memory medium. The high-speed switch is used to selectively activate the test path corresponding to one of the at least two second test bits in response to the test command; The system-on-a-chip is configured to perform the embedded chip testing method described in any of the possible implementations above.

[0016] The beneficial effects of this invention are as follows: The embedded chip testing method provided by this invention performs a full physical address space test when the first type of memory chip has completed initialization and its storage space is not occupied. At this time, the storage space of the first type of memory chip has not been occupied by any code, and the first-level boot code segment can access its entire physical address space. There is no problem of address locking or access denial due to system code residing there, achieving 100% full traversal testing of the physical address of the first type of memory chip. Simultaneously, after the operating system kernel starts, the operating system kernel mounts the second type of memory chip as an independent data disk rather than a system boot disk, and then performs a full logical address space read / write test and / or protocol test. Since the second type of memory chip no longer undertakes the function of storing system code, the system partition no longer constitutes an address access restriction. Compared with the existing technology where the system partition is locked and read-only, thus preventing full coverage, this invention achieves comprehensive testing of the logical address of the second type of memory chip. In other words, through the above two testing stages, full space coverage testing of the first and second types of memory chips is achieved.

[0017] Furthermore, this invention integrates the first-level boot code segment, the second-level boot code segment, and the operating system kernel code segment into the same firmware package and deploys it on a local storage medium independent of the two types of storage chips under test. During testing, the full physical address space test of the first-level boot stage, the address stress test of the second-level boot stage, and the storage chip read / write test and protocol test of the operating system kernel stage are executed sequentially. The three stages share the same firmware package, eliminating the need to re-flash or change the image when switching test items, simplifying the mass production operation process and improving testing efficiency and automation.

[0018] Furthermore, at the operating system kernel stage, after the operating system kernel mounts the second type of storage chip as a data disk, it performs full logical address space read / write tests and protocol tests. Since the tests are conducted with the full support of the operating system driver stack, read / write stress tests and protocol layer tests can be completed simultaneously within the same test scheme. Compared to existing technologies that cannot perform protocol tests at non-system stages, the test types of this invention are more comprehensive and can more fully verify the functionality and reliability of the storage chip. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A schematic flowchart of an embodiment of the embedded chip testing method provided by the present invention; Figure 2 This is a schematic flowchart of an embodiment of the present invention for performing a full physical address space test on a first type of memory chip; Figure 3 This is a schematic flowchart of another embodiment of the present invention for performing a full physical address space test on a first type of memory chip; Figure 4 This is a schematic diagram of the overall testing process for embedded chips provided by the present invention; Figure 5 A schematic diagram of an embodiment of the testing apparatus for embedded chips provided by the present invention; Figure 6 A schematic diagram of an embodiment of the core test board provided by this invention; Figure 7 A complete test flowchart for voltage biasing of the test device for the embedded chip provided by this invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0022] It should be understood that the illustrative drawings are not drawn to scale. The flowcharts used in this invention illustrate operations implemented according to some embodiments of the invention. It should be understood that the operations in the flowcharts may be implemented out of order, and steps without logical contextual relationships may be reversed or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this invention, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.

[0023] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0024] This invention provides a testing method and apparatus for embedded chips, which will be described below.

[0025] Figure 1 This is a schematic flowchart of an embodiment of the embedded chip testing method provided by the present invention. It is applied to a testing system including a first type of memory chip and a second type of memory chip, wherein the first type of memory chip is a volatile storage medium and the second type of memory chip is a non-volatile storage medium; as shown below. Figure 1 As shown, the testing methods for embedded chips include: S101. Deploy the firmware package in a local storage medium independent of the first-class and second-class storage chips in the test system; the firmware package integrates the first-level boot code segment, the second-level boot code segment, and the operating system kernel code segment.

[0026] It should be understood that since both the first and second type of memory chips are objects under test, read and write operations need to be performed on them during the test. If the firmware package is stored in the chip under test, the system code may be corrupted during the test, causing the test to be interrupted. Therefore, deploying the firmware package on a local storage medium independent of the first and second type of memory chips ensures that the integrity and executability of the firmware package itself are not affected by the full address traversal test at any stage, thereby guaranteeing the continuous operation of the test process.

[0027] The names of the first-level boot code segment, the second-level boot code segment, and the operating system kernel code segment differ across different embedded platforms. Taking the MediaTek MTK platform as an example, the first-level boot code segment, the second-level boot code segment, and the operating system kernel code segment correspond to the Preloader, LK (Little Kernel), and Linux / Android OS on the MTK platform, respectively.

[0028] The three-stage testing framework described above is also applicable to other embedded platforms. Simply map the tests according to the startup level of each platform, as shown in Table 1. Table 1. Three-stage test framework for different embedded platforms

[0029] As shown in Table 1, regardless of the embedded platform used, the test logic for each level of code segment is consistent with the MTK platform. The first-level boot stage performs a full physical address space test of the first type of memory chip, the second-level boot stage performs an address stress test of the first type of memory chip, and the operating system kernel stage performs a full logical address space read / write test and protocol test of the second type of memory chip. The firmware package remains the same and does not require re-flashing. The only difference is that the code segments at each stage have different names on different platforms.

[0030] In a specific embodiment of the present invention, the first type of memory chip is LPDDR, and the second type of memory chip is UFS and / or eMMC.

[0031] S102. In response to the power-on command, load and execute the first-level boot code segment. When the first type of memory chip has completed initialization and the memory space (DRAM buffer) of the first type of memory chip is not occupied, perform a full physical address space test on the first type of memory chip.

[0032] The full physical address space test refers to performing a traversal read and write verification test on the entire physical address range of the first-class memory chip. For a 32-bit addressing system, the full physical address space test covers the entire 4GB physical address space from 0x00000000 to 0xFFFFFFFF.

[0033] S103. After the full physical address space test is completed, load and execute the second-level boot code segment to perform an address stress test on the first type of memory chip.

[0034] Address stress testing refers to the verification test of the read and write stability of the first type of memory chip under specific stress conditions. The address stress test is performed during the second-level boot stage, when the operating system has not yet fully started. Under the virtual address mapping after the Memory Management Unit (MMU) is enabled, the test program applies high-intensity read and write access to the address space of the first type of memory chip that is not occupied by the boot code, so as to simulate the chip's performance under extreme usage scenarios.

[0035] It should be noted that the test address range for address stress testing should avoid the DRAM buffer area occupied by the secondary boot code itself, and all other address spaces should be included in the test range.

[0036] S104. After the address stress test is completed, the operating system kernel code segment is executed to start the operating system kernel. The operating system kernel then mounts the second type of storage chip as a data disk and performs full logical address space read / write test and / or protocol test on the second type of storage chip.

[0037] The full logical address space read / write test refers to performing a traversal read / write verification test on the entire user-accessible logical address range of the Type II memory chip. The test program writes test data to the logical block addresses (LBAs) of the memory chip one by one and reads back for comparison to verify whether each logical address of the storage medium can be correctly written to and read from.

[0038] Protocol testing refers to verifying the protocol layer functionality of Type II memory chips based on their underlying communication protocol stack. The purpose of protocol testing is to verify whether the memory chip's protocol layer can correctly respond to various standard commands and whether there are any functional defects in the protocol stack implementation. Because protocol testing requires complete operating system driver stack support, it can only be performed at the operating system kernel stage and cannot be implemented in the bare metal or boot stages.

[0039] It should be noted that full logical address space read / write tests and protocol tests can be implemented using testing tools such as fio, memstresstest, ufs_utils, mmc_utils, and sg3_utils. These testing tools are all integrated into the file system of the operating system kernel code segment and are automatically invoked by the test script after the operating system kernel starts, requiring no additional deployment.

[0040] Compared with existing technologies, the embedded chip testing method provided in this invention performs a full physical address space test when the first type of storage chip has completed initialization and its storage space is not occupied. At this time, the storage space of the first type of storage chip has not been occupied by any code, and the first-level boot code segment can access its entire physical address space. There is no problem of address locking or access denial due to system code residing there, achieving 100% full traversal testing of the physical address of the first type of storage chip. Simultaneously, after the operating system kernel starts, the operating system kernel mounts the second type of storage chip as an independent data disk instead of a system boot disk, and then performs a full logical address space read / write test and / or protocol test. Since the second type of storage chip no longer undertakes the function of storing system code, the system partition no longer constitutes an address access restriction. Compared with existing technologies where the system partition is locked and read-only, preventing full coverage, this invention achieves comprehensive testing of the logical address of the second type of storage chip. In other words, through the above two testing stages, full space coverage testing of the first and second types of storage chips is achieved.

[0041] Furthermore, in this embodiment of the invention, the first-level boot code segment, the second-level boot code segment, and the operating system kernel code segment are integrated into the same firmware package and deployed on a local storage medium independent of the two types of storage chips under test. During the test, the full physical address space test of the first-level boot stage, the address stress test of the second-level boot stage, and the storage chip read / write test and protocol test of the operating system kernel stage are executed sequentially. The three stages share the same firmware package, eliminating the need to re-flash or change the image due to switching test items, simplifying the mass production operation process, and improving testing efficiency and automation.

[0042] Furthermore, at the operating system kernel stage, after the operating system kernel mounts the second type of storage chip as a data disk, it performs full logical address space read / write tests and protocol tests. Since the tests are conducted with the full support of the operating system driver stack, read / write stress tests and protocol layer tests can be completed simultaneously within the same test plan. Compared to existing technologies that cannot perform protocol tests outside the system stage, the test types in this embodiment are more comprehensive, enabling a more thorough verification of the storage chip's functionality and reliability.

[0043] In some embodiments of the present invention, the first-level boot code segment includes a pre-boot code segment and a main boot code segment.

[0044] Then as Figure 2 As shown, step S102, which involves performing a full physical address space test on the first type of memory chip, includes: S201. Load and execute the pre-boot code segment. In the test window corresponding to the pre-boot code segment, perform a full physical address space test on the first type of memory chip. S202. After the pre-boot code segment is executed, the main boot code segment is loaded and executed. The main boot code segment is used to initialize subsequent hardware.

[0045] In one specific implementation, taking the MTK platform as an example, the Preloader is divided into two sub-stages: ex-pl and pl. The ex-pl stage serves as an independent test window, without executing any hardware initialization code, and only performs full physical address space testing of the first type of memory chip directly after DRAM initialization; the pl stage takes over the original Preloader's initialization function, and performs subsequent hardware initialization after the ex-pl test is completed.

[0046] Specifically, in response to the power-on command, the system enters the ex-pl stage. At this time, the DRAM controller has completed initialization, and the first type of memory chip has basic read and write access capabilities. However, the DRAM buffer has not yet been occupied by any code, meaning that the subsequent hardware initialization code of the pl sub-stage has not been executed, and the second-level boot code segment (LK) and the operating system kernel code segment have not been loaded. In this state, a 32-bit full physical address space traversal test is performed on the first type of memory chip. For a 32-bit operating system, this test covers the entire 4GB physical address space from 0x00000000 to 0xFFFFFFFF. Unlike existing technologies that can only cover 3GB of user space (the 3G / 1G division of the Linux / Android standard) during the second-level boot stage test, this embodiment does not have system code residing in the ex-pl stage and is not limited by the above address division, thus being able to access all physical addresses and achieving 100% address coverage.

[0047] After the full physical address space test in the ex-pl phase is completed, the pl sub-phase begins. The pl sub-phase initializes subsequent hardware (such as the memory controller and display controller). This process uses part of the DRAM buffer to store code and data, and DRAM space begins to be occupied. At this point, the full address test window closes, and the pl sub-phase no longer performs full address traversal; it only performs necessary hardware initialization and auxiliary tests. After the pl sub-phase completes, the second-level boot phase (LK) begins.

[0048] It should be understood that the above method of dividing the first-level boot code segment into a pre-test sub-stage and a hardware initialization main boot sub-stage is also applicable to Qualcomm platforms, general embedded Linux platforms, or Samsung Exynos platforms. The only difference is the name of the first-level boot code segment.

[0049] In existing technologies, test programs execute linearly during the bootstrap phase, making it impossible to run repeatedly within the same test phase. This necessitates external control to re-trigger multiple rounds of stress testing. Furthermore, the inability to control the pauses and progression of test phases necessitates re-flashing different images when switching test items, resulting in low automation and efficiency in testing.

[0050] To solve the above-mentioned technical problems, in some embodiments of the present invention, the first-level boot code segment is configured with first-stage loop control logic; The first-stage loop control logic is used for: After entering the first-level test phase corresponding to the first-level bootstrap code segment, the first-level bootstrap code segment is restricted to loop execution within the first-level test phase; In response to the exit command of the first-level test phase, the loop of the first-level test phase is terminated to enter the second-level test phase corresponding to the second-level bootstrap code segment.

[0051] Specifically, the first-stage loop control logic treats the code domains before entering the loop and after exiting the loop as an independent loop space. When there is output, the first-level bootstrap code segment is controlled to loop within the current stage. Upon receiving an exit instruction, the loop can be broken to enter the next stage.

[0052] The exit command for the first-level test phase can be the "exitsh" command.

[0053] In this embodiment of the invention, a first-stage loop control logic is configured in the first-level boot code segment. By limiting the code to loop execution within the current stage until an exit instruction is received, the repeated execution of tests within the same stage and the autonomous control of stage advancement are realized. This provides a stage switching control basis for a single firmware package to complete the entire process of testing, thereby improving the test automation and testing efficiency of the first-level boot code segment.

[0054] Similarly, when the first-level boot code segment is divided into the pre-boot code segment and the main boot code segment, the first-stage loop control logic is specifically used for: After entering the pre-test phase corresponding to the pre-bootstrap code segment, the pre-bootstrap code segment is restricted to loop execution within the pre-test phase; In response to the exit command of the pre-test phase, the loop of the pre-test phase is released to enter the main boot test phase corresponding to the main boot code segment; After entering the master boot test phase, the master boot code segment is restricted to execution in a loop within the master boot test phase; Responding to the exit command of the master boot test phase, the loop of the master boot test phase is terminated to enter the second-level test phase.

[0055] Similarly, in order to achieve autonomous control of repeated execution of tests within the second-level bootstrap code segment and the advancement of the phase, in some embodiments of the present invention, the second-level bootstrap code segment is configured with second-stage loop control logic. The second-stage loop control logic is used for: After entering the second-level test phase corresponding to the second-level bootstrap code segment, the second-level bootstrap code segment is restricted to loop execution within the second-level test phase; In response to the exit command of the second-level test phase, the loop of the second-level test phase is terminated to enter the third-level test phase corresponding to the operating system kernel code segment.

[0056] It should be understood that the exit command for the pre-test phase, the master boot test phase, and the second-level test phase can all be the "exitsh" command.

[0057] In other words, the first-stage loop control logic and the second-stage loop control logic are the monitor shell's input and output monitoring mechanism. This mechanism treats the code domain before entering monitoring and after exiting monitoring as an independent loop space. When there is output, the code is controlled to loop within the current stage. After receiving the exit monitor shell command "exitsh", the loop can be broken and the next stage can be entered.

[0058] By introducing a monitor shell input / output monitoring mechanism, this invention enables automatic sequential progression and cyclic switching of three-stage testing within the same firmware package. This eliminates the need to re-flash the image due to stage switching, simplifying the mass production testing process and improving testing efficiency and automation.

[0059] The monitor shell monitoring input / output mechanism enables looping within stages and forward jumps between stages. After a complete three-stage test is completed, it remains in the operating system kernel stage. To execute the next round of testing, existing technologies usually require re-flashing the image or manually restarting the device, which is cumbersome and difficult to automate mass production.

[0060] To address the aforementioned technical problems, in some embodiments of the present invention, the embedded chip testing method further includes: During the testing phase corresponding to the main boot segment, secondary boot segment, or operating system kernel segment, the system responds to the reset trigger signal of the test system, reloads and executes the pre-boot segment.

[0061] It should be understood that reset trigger signals include power cold reset trigger signals and power hot reset trigger signals. The test phases corresponding to the main boot code segment and the secondary boot code segment trigger the power cold reset signal, while the test phases corresponding to the operating system kernel code segment trigger the power hot reset signal.

[0062] The power supply cold reset trigger signal can be achieved by controlling the PMIC chip and the watchdog WDT.

[0063] This invention reloads and executes the pre-boot code segment in response to a reset trigger signal during any test phase corresponding to the main boot code segment, the second-level boot code segment, or the operating system kernel code segment. This allows the test process to directly return to the pre-test window of the first-level boot stage after completing the current phase, thus achieving a closed-loop test process without the need for re-flashing or manual restart. This provides a process control basis for multi-round automated testing in mass production scenarios, thereby further improving test efficiency.

[0064] To further improve the controllability of the testing process, in some embodiments of the present invention, such as Figure 3 As shown, step S102, which involves performing a full physical address space test on the first type of memory chip, includes: S301. Determine whether an input command has been received within a preset time. S302. If not, perform a full physical address space test on the first type of memory chip; S303. If so, then execute the operation corresponding to the input command.

[0065] In mass production testing scenarios, testers often need to intervene in the process before or during test execution, such as skipping a stage, repeating specific test items, or temporarily adjusting test parameters. Existing technologies lack a response mechanism for external inputs, and these needs can only be met by re-flashing different images or physically resetting, which is cumbersome and affects testing efficiency. This invention provides a flexible external intervention interface for the testing process by determining whether an input command is received within a preset time. When an input command is received, the corresponding operation is executed (such as skipping the current test, adjusting test parameters, or triggering debugging actions). Testers can control the test rhythm as needed without modifying firmware or re-flashing, which is particularly suitable for scenarios in mass production where rapid switching of test items or troubleshooting of specific problems is required, effectively improving the operability and flexibility of testing.

[0066] It should be understood that the preset time can be set or adjusted according to the actual application scenario. For example, the preset time can be 2 seconds.

[0067] It should also be understood that preset time judgments can be introduced in the process of performing address stress tests on the first type of memory chips and full logical address space read / write tests and / or protocol tests on the second type of memory chips, so as to improve the testing flexibility and operability of different test stages.

[0068] Taking the MTK platform as an example, such as Figure 4 The following describes the overall testing process for embedded chips: After the test system is powered on, it first enters the monitoring entry point of the first-level boot phase and opens a 2-second input listening window. If no external intervention command is received within 2 seconds, it automatically enters the ex-pl phase; if a command is received, the corresponding operation is executed.

[0069] Upon entering the ex-pl phase, the test system performs a full physical address space test of LPDDR. At this point, the DRAM buffer is not yet occupied by any code, allowing the test program to access the entire 4GB physical address space and complete a 32-bit full address traversal. After this phase is completed, the ex-pl phase is exited via the exitsh command, and the system re-enters a 2-second input listener. If there is no external intervention, the system enters the pl phase to perform subsequent hardware initialization. After the pl phase is completed, the system exits via the exitsh command, triggering a cold reset. This reloads and executes the pre-boot code segment, returning the process to the very beginning of the first-level boot phase. This reset mechanism is used to reset the process in multi-round loop tests or abnormal recovery scenarios.

[0070] After the above process is completed, the test system enters the second-level boot stage (lk). The lk stage also sets a 2-second input listener at the entry point; if there is no intervention, it proceeds to the LPDDR address stress test. After this stage is completed, the system exits the lk stage using the `exitsh` command, triggers a power-on hot reset, and jumps to the Linux kernel stage.

[0071] After the Linux kernel boots, it enters the Android system and mounts the UFS / eMMC storage chip as an independent data disk, performing full logical address space read / write tests and protocol tests. At this point, all three phases of testing within the single firmware package are complete. If a next round of testing is required, the test system returns to the first-level boot stage via a cold reset and repeats the above process; the entire process does not require re-flashing or replacing the firmware package.

[0072] It should be noted that the exitsh command and the 2-second input listening mechanism at each level of entry point together constitute the monitor shell's input and output monitoring system. This allows the test process to pause, loop, or jump at any stage according to actual needs, supporting both fully automated mass production testing and the need for process intervention in manual debugging scenarios.

[0073] As described in the foregoing embodiments, the second type of storage chip is UFS and / or eMMC. When the second type of storage chip is UFS and eMMC, the testing process requires switching between UFS and eMMC. Therefore, in some embodiments of the present invention, step S104, in which the operating system kernel mounts the second type of storage chip as a data disk, includes: In response to the strobe signal of UFS or eMMC, the operating system kernel mounts UFS or eMMC as a data disk.

[0074] This embodiment switches between UFS and eMMC test paths by setting up a response strobe signal. Without disassembling the chip or replacing the hardware, a single firmware package deployment can complete full logical address space read / write tests and protocol tests for both UFS and eMMC storage chips. This avoids the inefficiency caused by re-burning the image or replacing the hardware when testing different types of chips in the prior art, and simplifies the testing process. It is especially suitable for mass production scenarios that require batch testing of UFS and eMMC mixed chips, and significantly improves the automation and testing efficiency of mass production testing of multiple types of storage chips.

[0075] In summary, the embedded chip testing method proposed in this invention has the following beneficial effects: First, by dividing the first-level boot code segment into a pre-boot code segment and a main boot code segment, and performing a full physical address space test after DRAM initialization and before the buffer is occupied, the address range that was originally inaccessible due to being covered by system code in the subsequent boot stage is fully verified, eliminating the address blind spot in LPDDR testing. Second, by integrating the first-level boot, second-level boot, and operating system kernel three-stage tests into the same firmware package, and with the monitor shell loop control logic and cold reset mechanism, the test system can automatically flow and loop between different test stages. During mass production, only one image flashing is needed to complete all test items, without the need for repeated flashing or device relocation due to switching test types. Third, by mounting UFS / eMMC as an independent data disk in the operating system kernel stage, and simultaneously performing full address read / write stress testing and protocol layer function verification with the support of a complete driver stack, the test coverage is extended from conventional stress testing to the protocol interaction layer, improving the comprehensiveness of test types. In other words, the embodiments of the present invention effectively simplify the operation process of mass production testing, improve testing efficiency and automation, and are suitable for large-scale mass production testing scenarios of embedded memory chips, while ensuring test coverage and reliability.

[0076] On the other hand, embodiments of the present invention also provide a testing device for embedded chips, such as... Figure 5 and Figure 6 As shown, the embedded chip testing apparatus 500 includes: Data processing board 510 is used to receive test commands issued by the host computer; The core test board 520 is connected to the data processing board 510. The core test board 520 integrates a system-on-a-chip 521, a first test bit 522 for installing a first type of memory chip, at least two second test bits 523 for installing at least two types of second type memory chips, and a high-speed switch 524. The first type of memory chip is a volatile memory medium, and the second type of memory chip is a non-volatile memory medium. The high-speed switch 524 is used to selectively turn on the test path corresponding to one of the two second test bits 523 in response to a test command; The system-on-chip 521 is configured to perform the embedded chip test method in any of the above embodiments.

[0077] In specific embodiments of the present invention, such as Figure 5 As shown, the embedded chip testing device 500 includes multiple core test boards 520, each of which exchanges data with a data processing board 510 via a BIB board. Specifically, the data processing board 510 is connected to a host computer to receive test commands from the host computer and generate corresponding strobe signals and control commands based on the test commands. The BIB board is connected to both the data processing board 510 and the multiple core test boards 520, and is used to transfer the strobe signals and control commands from the data processing board 510 to each core test board 520, and to provide power and communication links for each core test board 520. Each core test board 520 independently performs the test and transmits the test results back to the host computer via the BIB board and the data processing board 510. In this embodiment of the invention, the BIB board performs the functions of signal transfer and power distribution.

[0078] Furthermore, such as Figure 6 As shown, each core test board 520 integrates a first test bit for installing LPDDR and two second test bits for installing UFS and eMMC memory chips respectively. Both the first and second test bits use sockets or surface mounts.

[0079] In this embodiment of the invention, each core test board 520 is connected to the data processing board 510 via a BIB board. In actual mass production testing, different core test boards 520 can simultaneously install the same or different types of memory chips, enabling multi-station parallel testing and meeting the testing efficiency requirements of high-volume production scenarios. Furthermore, a test anomaly on any core test board will not affect the normal operation of other core test boards.

[0080] Taking the MTK platform as an example, such as Figure 7 As shown, the complete test procedure for voltage biasing of the embedded chip test device 500 is as follows: Before testing begins, the LPDDR chip is installed in the first test position of the core test board, and the UFS or eMMC chip under test is installed in the corresponding second test position. After the core test board is powered on, the system-on-a-chip (SOC) first loads and executes the first-level boot code segment.

[0081] In this embodiment of the invention, the first-level boot code segment is divided into a pre-boot code segment (ex-pl) and a main boot code segment (pl). During the ex-pl stage, the DRAM controller has completed initialization, but the DRAM buffer is not yet occupied by any code. The system-on-a-chip (SoC) performs pattern testing and refresh / retention testing on the LPDDR within this window, achieving full physical address space testing of the LPDDR chip. After the ex-pl stage testing is completed, the pl stage begins. The pl stage first performs signal eye diagram testing and frequency hopping testing on the LPDDR. The LPDDR power supply voltage is adjusted using the onboard PMIC voltage regulator chip to verify the signal integrity and clock stability of the chip under different voltage conditions. Simultaneously, the pl stage completes the initialization of subsequent hardware (such as the memory controller and display controller).

[0082] After the pl stage is completed, the second-level boot stage (lk) begins. In the lk stage, under the virtual address mapping after the MMU (Memory Management Unit) is enabled, the address space occupied by the boot code in LPDDR is skipped before the pattern test is executed.

[0083] After the second-level boot phase is completed, the operating system kernel code segment is executed to start the Linux / Android kernel and enter the operating system phase. In the operating system phase, the system calls the memtester and stressapptest tools to perform operating system-level memory stress tests on LPDDR. At the same time, the second type of storage chip (UFS / eMMC) is mounted as an independent data disk, the fio tool is called to perform performance stress tests on UFS or eMMC, and the mmc_utils, ufs_utils, or sg3_utils tools are called to perform protocol-level read and write tests on UFS or eMMC, including interactive verification of protocol-level commands such as CMD queue, reliable write, TRIM, and QueryRequest.

[0084] At this point, all three phases of testing integrated within the single firmware package are complete. The full physical address space test and address stress test of LPDDR, as well as the full logical address space read / write test and protocol test of UFS / eMMC, were all executed sequentially after the same firmware package was deployed, without the need to re-flash the image.

[0085] The embedded chip testing device proposed in this invention achieves testing of three different types of memory chips with a single hardware architecture. Therefore, it eliminates the need to design separate PCBs and test fixtures for different chips, significantly reducing the hardware cost of the testing equipment, minimizing the space required for testing, and shortening the equipment development cycle.

[0086] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0087] The above provides a detailed description of the embedded chip testing method and apparatus provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A testing method for embedded chips, characterized in that, A test system applicable to a first type of memory chip and a second type of memory chip, wherein the first type of memory chip is a volatile memory medium and the second type of memory chip is a non-volatile memory medium; The testing method includes: The firmware package is deployed in the test system on a local storage medium that is independent of the first type of memory chip and the second type of memory chip. The firmware package integrates a first-level boot code segment, a second-level boot code segment, and an operating system kernel code segment. In response to the power-on command, the first-level boot code segment is loaded and executed. When the first type of memory chip has completed initialization and the storage space of the first type of memory chip is not occupied, a full physical address space test is performed on the first type of memory chip. After the full physical address space test is completed, the second-level boot code segment is loaded and executed to perform an address stress test on the first type of memory chip; After the address stress test is completed, the operating system kernel code segment is executed to start the operating system kernel. The operating system kernel then mounts the second type of storage chip as a data disk and performs full logical address space read / write tests and / or protocol tests on the second type of storage chip.

2. The testing method for embedded chips according to claim 1, characterized in that, The first-level boot code segment includes the pre-boot code segment and the master boot code segment; The step of performing a full physical address space test on the first type of memory chip includes: Load and execute the pre-boot code segment, and perform a full physical address space test on the first type of memory chip within the test window corresponding to the pre-boot code segment; After the pre-boot code segment is executed, the main boot code segment is loaded and executed. The main boot code segment is used to initialize subsequent hardware.

3. The testing method for embedded chips according to claim 2, characterized in that, The first-level bootstrap code segment contains the first-stage loop control logic; The first-stage loop control logic is used for: After entering the first-level test phase corresponding to the first-level bootstrap code segment, the first-level bootstrap code segment is restricted to loop execution within the first-level test phase; In response to the exit command of the first-level test phase, the loop of the first-level test phase is terminated to enter the second-level test phase corresponding to the second-level bootstrap code segment.

4. The testing method for embedded chips according to claim 3, characterized in that, The first-stage loop control logic is specifically used for: After entering the pre-test phase corresponding to the pre-boot code segment, the pre-boot code segment is restricted to loop execution within the pre-test phase; In response to the exit command of the pre-test phase, the loop of the pre-test phase is released to enter the main boot test phase corresponding to the main boot code segment; After entering the main boot test phase, the main boot code segment is restricted to execution in a loop within the main boot test phase; In response to the exit command of the master boot test phase, the loop of the master boot test phase is terminated to enter the second-level test phase.

5. The testing method for embedded chips according to claim 3, characterized in that, The second-level bootstrap code segment contains the second-stage loop control logic; The second-stage loop control logic is used for: After entering the second-level test phase corresponding to the second-level bootstrap code segment, the second-level bootstrap code segment is restricted to loop execution within the second-level test phase; In response to the exit instruction of the second-level test phase, the loop of the second-level test phase is terminated to enter the third-level test phase corresponding to the operating system kernel code segment.

6. The testing method for embedded chips according to claim 2, characterized in that, Also includes: During the testing phase corresponding to the main boot code segment, the second-level boot code segment, or the operating system kernel code segment, the pre-boot code segment is reloaded and executed in response to the reset trigger signal of the test system.

7. The testing method for embedded chips according to claim 1, characterized in that, The step of performing a full physical address space test on the first type of memory chip includes: Determine whether an input command has been received within the preset time period; If not, then perform a full physical address space test on the first type of memory chip; If so, then the operation corresponding to the input instruction is executed.

8. The testing method for embedded chips according to claim 1, characterized in that, The first type of memory chip is LPDDR, and the second type of memory chip is UFS and / or eMMC.

9. The testing method for embedded chips according to claim 8, characterized in that, When the second type of storage chip is UFS or eMMC, the step of mounting the second type of storage chip as a data disk by the operating system kernel includes: In response to the strobe signal of UFS or eMMC, the operating system kernel mounts UFS or eMMC as a data disk.

10. A testing device for embedded chips, characterized in that, include: The data processing board is used to receive test commands issued by the host computer. The core test board is connected to the data processing board. The core test board integrates a system-on-a-chip, a first test position for installing a first type of memory chip, at least two second test positions for installing at least two types of second type memory chips, and a high-speed switch. The first type of memory chip is a volatile memory medium, and the second type of memory chip is a non-volatile memory medium. The high-speed switch is used to selectively activate the test path corresponding to one of the at least two second test bits in response to the test command; The system-on-a-chip is configured to perform the test method for the embedded chip according to any one of claims 1-9.