A method for testing an MCU

By connecting to ATE testing equipment and downloading the executable file of the MCU configuration program, the MCU is tested item by item using communication protocol instructions. This solves the problem of insufficient self-test coverage for complex MCUs, achieves full-coverage MCU self-testing, reduces testing difficulty, and improves fault coverage.

CN117130837BActive Publication Date: 2026-11-24BEIJING ZHENXING METROLOGY & TEST INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210550157.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2026-11-24
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

Existing MCU self-tests cannot cover many test items, especially for complex MCUs, and cannot achieve comprehensive fault mode coverage without obtaining positive test vectors.

Method used

By connecting the MCU chip under test to the ATE test equipment, an executable file of the MCU configuration program is generated and downloaded. The communication protocol instructions are used to test each item, and the MCU self-test is realized by combining the initialization configuration program and priority order.

Benefits of technology

It achieves full coverage testing of complex MCUs, reduces the difficulty of writing test patterns, makes full use of the MCU's computing and control capabilities, performs self-testing within the MCU, and improves fault coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117130837B_ABST
    Figure CN117130837B_ABST
Patent Text Reader

Abstract

The application relates to an MCU self-test method, and belongs to the technical field of electronic component detection, which solves the problem that the existing MCU self-test cannot cover more test items. The MCU self-test method comprises the following steps: connecting a test interface board carrying a to-be-tested MCU chip and a minimum system required for normal work of the MCU chip to an ATE test device; generating an executable file of an MCU configuration program, and downloading the executable file into the to-be-tested MCU chip; the MCU configuration program stores a test program of each test item; the ATE test device sequentially sends a communication protocol instruction pointing to each test item to the to-be-tested MCU chip; and the to-be-tested MCU chip executes the test program of the test item pointed to by the communication protocol instruction according to the communication protocol instruction, so as to realize the test of the to-be-tested MCU chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic component testing technology, and in particular to a self-testing method for MCUs. Background Technology

[0002] MCU, or microcontroller, is an indispensable core component of embedded systems, boasting abundant logic resources, rich peripheral interfaces, and strong programmability. Testing MCUs has always been a challenge in the component testing industry because, unlike ordinary components, an unprogrammed MCU has no functional output. Furthermore, normal operation of an MCU requires a minimum system including a power supply, crystal oscillator, and reset circuit, making it impossible to directly test its functional performance like other circuits.

[0003] During the MCU design process, manufacturers generate forward test vectors, which can perform comprehensive full-fault mode coverage testing of the chip. However, due to intellectual property protection, users and third-party testing organizations cannot obtain these forward test vectors. They can only perform application-based reverse testing. Due to the complexity, flexibility, and various programmability features of MCUs, reverse testing can never achieve the same fault coverage as forward testing.

[0004] Currently, for some simple MCUs, testing agencies perform simple programming, compilation, and configuration program downloads, followed by basic DC parameter testing. Passing these tests indicates the device is functioning correctly, but this approach fails to cover the numerous internal resources and logic. Another testing method simulates the executable file download process, converting it to high and low levels, and then downloads the executable file via ATE (Automatic Test Equipment). This method allows for one-click testing, but it still doesn't improve test coverage. For complex MCUs, there is still no satisfactory solution. MCU testing requires further research and refinement. Summary of the Invention

[0005] Based on the above analysis, the embodiments of the present invention aim to provide an MCU self-test method to solve the problem that existing MCU self-tests cannot cover a large number of test items.

[0006] This invention discloses a self-testing method for an MCU, comprising:

[0007] Connect the test interface board, which carries the MCU chip under test and the minimum system required for its normal operation, to the ATE test equipment.

[0008] An executable file for the MCU configuration program is generated and downloaded to the MCU chip under test; the MCU configuration program stores the test program for each test item;

[0009] The ATE test equipment sends communication protocol instructions pointing to each test item to the MCU chip under test in sequence. The MCU chip under test executes the test program of the test item pointed to by the communication protocol instructions in sequence, thereby realizing the test of the MCU chip under test.

[0010] Based on the above solution, the present invention also makes the following improvements:

[0011] Furthermore, the ATE device sends communication protocol instructions to each test item in descending order of test item priority. After a test item with higher priority passes the test, the test item with lower priority is executed until all test items are completed. If all test items pass the test, the MCU chip under test passes the self-test; otherwise, the MCU chip under test fails the self-test.

[0012] If the ATE test equipment observes the agreed observation signal of the test item output by the MCU chip under test within the specified time, then the test item passes the test.

[0013] Furthermore, the test program for the test item is used to respond to the communication protocol instruction pointing to the test program for the test item, execute the test operation of the test item, and control the MCU chip under test to output the corresponding observation signal after the test operation is completed;

[0014] All test programs are placed in a while loop.

[0015] Furthermore, the MCU configuration program also includes an initialization configuration program, which is located before the while loop;

[0016] The initialization configuration program is used to perform kernel initialization, clock initialization and IO initialization of the MCU chip under test; the IO initialization is used to configure the port receiving the communication protocol instructions into input mode.

[0017] Furthermore, before performing all test items, the ATE test equipment first sends an initialization command pointing to the initialization configuration program to the MCU chip under test;

[0018] The MCU chip under test executes the initialization configuration program based on the initialization instructions.

[0019] Furthermore, the port configured as input mode is a non-multiplexed I / O port or a UART port.

[0020] Furthermore, the test items include: I / O port high / low level testing; UART testing; internal instruction set and register testing; IIC testing; wherein,

[0021] When the port configured as input mode is a non-multiplexed I / O port, the test priority of the high and low level test of the I / O port is the highest, and the test priority of the other test items is equal and lower than the test priority of the high and low level test of the I / O port.

[0022] When the port configured as input mode is a UART port, the UART test has the highest test priority, and the test priorities of the other test items are equal and lower than the test priority of the UART test.

[0023] Furthermore, the ATE test equipment performs high and low level tests on the I / O ports in the following manner:

[0024] The ATE test equipment sends communication protocol commands to the MCU chip under test to perform test programs for high and low level tests on the I / O ports.

[0025] The MCU chip under test executes the test program for testing the high and low levels of the I / O ports according to the communication protocol instructions of the test program pointing to the I / O port high and low level test:

[0026] The MCU chip under test is configured with all I / O ports as output ports. Then, all I / O ports are controlled to output a high level, and after a fixed time, all I / O ports are controlled to output a low level.

[0027] Subsequently, the IO initialization is performed;

[0028] If the ATE test equipment observes that the output of all IO ports of the MCU chip under test switches from high level to low level within the specified time, then the IO port high and low level test is passed.

[0029] Furthermore, the ATE test equipment performs UART testing in the following manner:

[0030] The ATE test equipment sends communication protocol commands to the MCU chip under test, pointing to the test program for UART testing;

[0031] The MCU chip under test executes the UART test program according to the communication protocol instructions pointed to in the UART test program:

[0032] The MCU chip under test is configured to operate in the following mode: data received at the UART input port is retransmitted through the UART output port.

[0033] The ATE test equipment writes UART protocol instructions to the UART input port of the MCU chip under test. The MCU chip under test repackages the data in the UART protocol instructions and sends it out through the UART output port.

[0034] Subsequently, the IO initialization is performed;

[0035] If the ATE test equipment observes that the UART output port outputs data from the UART protocol command within the specified time, then the UART test is passed.

[0036] Furthermore, the test interface board is equipped with:

[0037] The test socket is where all testable ports of the MCU chip under test are led out and connected to the digital channel of the ATE test equipment.

[0038] A reset circuit, a crystal oscillator circuit, and a download interface are respectively connected to the corresponding ports of the MCU chip under test; the executable file is downloaded to the MCU chip under test through the download interface.

[0039] Optocoupler control circuit is used to switch the hardware connection state of the same port at different times.

[0040] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0041] The MCU self-test method provided in this embodiment has the following advantages:

[0042] First, this method breaks through the barriers to MCU testing. Through communication protocol instructions, it integrates complex configuration programs, enabling the MCU to load complex multi-module integrated configuration programs at once and achieve MCU self-testing.

[0043] Secondly, during the MCU self-test process, a minimum operating system for the MCU was also built, enabling the MCU chip under test to operate in a real application environment. This fully utilizes the MCU's powerful computing, control, and judgment capabilities, allowing for self-testing within the MCU itself, which better stimulates the chip's failure modes. Compared to previous MCU testing methods, for complex controllers, the MCU self-test method described in this embodiment significantly reduces the difficulty of writing test patterns. Most judgments are executed internally within the MCU; the ATE only needs to schedule internal MCU resources and perform simple judgments on the responses.

[0044] Third, this MCU self-test method is an open testing method. As long as the communication protocol capacity is large enough, test items can be added at will according to test requirements until the fault coverage requirement is met.

[0045] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0046] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0047] Figure 1 This is a flowchart of the MCU self-test method provided in an embodiment of the present invention;

[0048] Figure 2 This is a schematic diagram of the test interface board and its connection with the ATE test equipment. Detailed Implementation

[0049] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0050] This invention discloses a self-testing method for an MCU, the flowchart of which is shown below. Figure 1 As shown, it includes the following steps:

[0051] S1: Connect the test interface board that carries the MCU chip under test and the minimum system required for its normal operation to the ATE test equipment;

[0052] S2: Generate an executable file for the MCU configuration program and download the executable file to the MCU chip under test; the MCU configuration program stores the test program for each test item;

[0053] S3: The ATE test equipment sends communication protocol instructions pointing to each test item to the MCU chip under test in sequence. The MCU chip under test executes the test program of the test item pointed to by the communication protocol instructions in sequence according to the communication protocol instructions, thereby realizing the test of the MCU chip under test.

[0054] like Figure 2 As shown, in step S1, the test interface board is equipped with: a test socket, an optocoupler control circuit, a reset circuit, a power supply, a crystal oscillator circuit, and a download interface; wherein,

[0055] All testable ports of the MCU chip under test are led out from the test socket and connected to the digital channel of the test bench, which facilitates the application of commands and the observation of responses;

[0056] The reset circuit, crystal oscillator circuit, and power supply constitute the minimum system required for the normal operation of the MCU chip under test. The reset circuit, crystal oscillator circuit, and download interface are respectively connected to the corresponding ports of the MCU chip under test; the reserved download interface is connected to the debugging and download port of the MCU chip under test, which facilitates the integrated control computer to download and configure the chip under test, for example, to download the executable file of the MCU configuration program to the MCU chip under test;

[0057] An optocoupler control circuit is used to switch the hardware connection state of the same port at different times. For example, in order to test bus interfaces such as UART, SPI, and SMBUS, the IO port configured as the above bus interface needs to be pulled up (connected to a pull-up circuit). The same IO port is required to have different hardware connection states at different times. The optocoupler control circuit switches the state. The optocoupler control port is connected to the relay control bit of the test bench.

[0058] EEPROM memory is used in some test items (such as IIC) testing.

[0059] In addition, all power supplies on the test interface board are connected to ATE's digital programmable power supply.

[0060] In step S2, the test program for each test item stored in the MCU configuration program is used to respond to the communication protocol instruction pointing to the test program of the test item, execute the test operation of the test item, and control the MCU chip under test to output the corresponding observation signal after the test operation is completed; the test programs for all test items are placed in a while loop.

[0061] In addition, the MCU configuration program also includes an initialization configuration program, which is located before the while loop. This initialization configuration program is used to perform kernel initialization, clock initialization, and I / O initialization of the MCU chip under test. The I / O initialization is used to configure the port receiving the communication protocol instructions into input mode. The port configured into input mode is a non-multiplexed I / O port or a UART port. Typically, if the MCU chip under test has enough non-multiplexed I / O ports, combinations of different I / O port states are generally selected for test resource scheduling. If N I / O ports are selected as the communication protocol carrier, 2... N The number of subroutines and the protocol capacity is 2. NIf the available I / O of the chip is not particularly abundant, the UART port can be selected as the protocol bearer port, and the serial port commands received by the UART port can be used as the entry point for the communication protocol commands. A one-byte UART command protocol has a capacity of 64, which can basically meet the testing requirements. If this is still insufficient, a two-byte UART command can be selected as the protocol entry point, achieving a capacity of 4096, which can meet the testing requirements of all MCUs. Accordingly, before executing all test items, the ATE test equipment first sends an initialization command pointing to the initialization configuration program to the MCU chip under test; the MCU chip under test then executes the initialization configuration program based on the initialization command.

[0062] Therefore, the workflow for writing the MCU configuration source code can be described as follows: First, perform kernel initialization, configure the system clock source, set the I / O port carrying the scheduling protocol to input mode, and then enter a while loop to wait for communication protocol instructions. Set the communication protocol instruction entry point, pointing to different test items, and write test programs for each test item, coordinating the testing process with the ATE (Automatic Test Equipment). During the testing of some test items, the MCU chip under test internally determines whether the function is qualified, outputs an observation signal after the determination, and maintains the observation signal for a fixed time to wait for ATE observation. Afterwards, the MCU chip under test enters a waiting state, the bus becomes idle, and it waits for the next communication protocol instruction to arrive.

[0063] In step S3, the ATE device sends communication protocol instructions to each test item sequentially according to their priority from high to low. After a higher-priority test item passes, the test of a lower-priority test item is executed until all test items are completed. If all test items pass, the MCU chip under test passes the self-test; otherwise, the MCU chip under test fails the self-test. If the ATE testing device observes the MCU chip under test outputting the agreed-upon observation signal for the test item within a specified time, then the test item passes. Specifically, the ATE testing device executes each test item in the following manner:

[0064] First, send communication protocol instructions to the MCU chip under test, which are directed to the test program of the test item. The communication protocol instructions are the bridge for ATE to schedule the internal resources of the MCU chip under test. A communication protocol is defined in the top-level design: the capacity of the communication protocol should be greater than the number of test items to ensure that the communication protocol can schedule a sufficient number of test items.

[0065] Second, the MCU chip under test executes the test program of the test item according to the communication protocol instructions pointing to the test program of the test item;

[0066] Third, if the ATE test equipment observes the agreed observation signal of the test item output by the MCU chip under test within a specified time (for example, it can be preset by means of an observation protocol), then the test item passes the test.

[0067] Common MCU test items include: I / O port high / low level test; UART test; internal instruction set and register test; IIC test. Among these, when the port configured as input mode is a non-multiplexed I / O port, the I / O port high / low level test has the highest test priority, and the test priorities of the other test items are equal and lower than the test priority of the I / O port high / low level test. When the port configured as input mode is a UART port, the UART test has the highest test priority, and the test priorities of the other test items are equal and lower than the test priority of the UART test.

[0068] Based on the above constraints, it is clear that there is a correspondence between test items with higher test priority and ports configured as input modes. The purpose of this approach is to test the test items related to ports configured as input modes first. If the test passes, it ensures that the port configured as input mode can normally receive communication protocol commands, thus guaranteeing that subsequent test items can also receive communication protocol commands normally, avoiding the impact of failure to receive communication protocol commands on the test results. It is also important to emphasize that after a higher-priority test item passes, the lower-priority test items are executed. For multiple test items with the same test priority, the testing order is not limited; the success or failure of one test item does not affect the execution of other test items. In practical applications, based on the interrelationships between test items, test items that may affect the test results of other test items can be set to a higher test priority and tested first to minimize their impact on lower-priority test items, ensuring the accuracy of the test results for all test items of the MCU chip under test.

[0069] MCUs come in many varieties, possessing abundant internal resources and peripheral interfaces. Using the method described in this embodiment, based on reasonable top-level planning, it is possible to perform comprehensive testing of all internal resources. The following section introduces the development of several commonly used functional test programs. Due to space limitations, it is impossible to exhaustively cover all internal resources of an MCU. The following lists the tests for several important internal components of the MCU.

[0070] (1) High and low level test of IO port

[0071] ATE test equipment performs high and low level tests on I / O ports in the following manner:

[0072] The ATE test equipment sends communication protocol commands to the MCU chip under test to perform test programs for high and low level tests on the I / O ports.

[0073] The MCU chip under test executes the test program for testing the high and low levels of the I / O ports according to the communication protocol instructions of the test program pointing to the I / O port high and low level test:

[0074] The MCU chip under test is configured with all I / O ports as output ports. Then, all I / O ports are controlled to output a high level, and after a fixed time, all I / O ports are controlled to output a low level.

[0075] Subsequently, the IO initialization is performed;

[0076] If the ATE test equipment observes that the output of all IO ports of the MCU chip under test switches from high level to low level within the specified time, the IO port high and low level test passes; otherwise, the IO port high and low level test fails.

[0077] (2) UART test

[0078] The ATE test equipment performs UART testing in the following ways:

[0079] The ATE test equipment sends communication protocol commands to the MCU chip under test, pointing to the test program for UART testing;

[0080] The MCU chip under test executes the UART test program according to the communication protocol instructions pointed to in the UART test program:

[0081] The MCU chip under test is configured to operate in the following mode: data received at the UART input port is retransmitted through the UART output port.

[0082] The ATE test equipment writes UART protocol instructions to the UART input port of the MCU chip under test. The MCU chip under test repackages the data in the UART protocol instructions and sends it out through the UART output port.

[0083] Subsequently, the IO initialization is performed;

[0084] If the ATE test equipment observes that the UART output port outputs data from the UART protocol command within the specified time, the UART test passes; otherwise, the UART test fails.

[0085] The tests for SPI interface and CAN bus interface are similar, and will not be described in detail in this embodiment.

[0086] (3) Internal instruction set and register testing

[0087] The ATE test equipment sends communication protocol commands to the MCU chip under test, which are directed to the test program for testing the internal instruction set and registers.

[0088] The MCU chip under test executes the test program for internal instruction set and register testing according to the communication protocol instructions pointing to the test program for internal instruction set and register testing:

[0089] The MCU chip under test traverses its internal instruction set and writes to all writable registers. After writing, it reads the data and restores the reset state. After reading, the MCU chip under test checks whether the register values ​​are consistent with the datasheet specifications. If all register values ​​are consistent with the datasheet specifications, the MCU chip under test determines that the internal instruction set and register tests have passed. Then, it sends out the agreed observation signals for the internal instruction set and register tests (such as fixed high and low level changes) through a fixed I / O port.

[0090] Subsequently, the IO initialization is performed;

[0091] If the ATE test equipment observes the agreed-upon observation signals for the internal instruction set and register tests within the specified time, the internal instruction set and register tests pass; otherwise, the internal instruction set and register tests fail.

[0092] (4) IIC test

[0093] To verify the integrity of the IIC interface, an external EEPROM was connected to the MCU chip under test for auxiliary testing.

[0094] The ATE test equipment sends communication protocol commands to the MCU chip under test, pointing to the test program for IIC testing;

[0095] The MCU chip under test executes the IIC test program according to the communication protocol instructions pointing to the IIC test program:

[0096] The MCU chip under test enters the IIC initialization configuration and performs full-chip write and read operations on the external EEPROM through the SCL and SDA pins. The controller of the MCU chip under test makes a judgment. If the read result is consistent with the write result, the MCU chip under test judges that the IIC test has passed. Then, it sends the agreed observation signal of the IIC test (such as fixed high and low level changes) through the fixed IO port.

[0097] Subsequently, the IO initialization is performed;

[0098] If the ATE test equipment observes the agreed observation signal for the IIC test within the specified time, the IIC test passes; otherwise, the IIC test fails.

[0099] (5) AD test

[0100] The ATE test equipment sends communication protocol commands to the MCU chip under test, pointing to the test program for AD testing;

[0101] The MCU chip under test executes the AD test program according to the communication protocol instructions pointing to the AD test program:

[0102] Configure the analog input ports and digital output ports of the MCU chip under test;

[0103] The ATE test equipment inputs a fixed analog signal to the analog input port of the MCU chip under test, and the MCU chip under test outputs the corresponding digital signal through the digital output port.

[0104] Subsequently, the IO initialization is performed;

[0105] If the ATE test equipment observes within a specified time that the deviation between the digital signal output from the digital output port and the expected digital code is within the allowable error range, then the AD test passes; otherwise, the AD test fails.

[0106] (6) DA test

[0107] The ATE test equipment sends communication protocol commands to the MCU chip under test, pointing to the test program for DA testing;

[0108] The MCU chip under test executes the AD test program according to the communication protocol instructions pointing to the test program for DA testing:

[0109] Configure the digital input ports and analog output ports of the MCU chip under test;

[0110] The ATE test equipment inputs a fixed digital signal to the digital input port of the MCU chip under test, and the MCU chip under test outputs the corresponding analog signal through the digital output port; here, the analog signal is represented in the form of voltage or current.

[0111] Subsequently, the IO initialization is performed;

[0112] If the ATE test equipment observes within a specified time that the deviation between the analog signal output from the analog output port and the expected analog signal is within the allowable error range, then the DA test passes; otherwise, the DA test fails.

[0113] In addition, following the aforementioned testing methods, other test items for the MCU chip under test, such as VOH and VOL tests, can also be performed, which will not be elaborated here. It should be noted that the MCU chip tested in this embodiment differs from ordinary logic devices. During the test, it continuously responds to external events, performs internal polling or interrupt handling, and finally sends a response signal to the test equipment. Throughout the process, the response time for the same test item will vary for a single chip, and the response time for the same test item will also vary for different devices. In other words, some test items do not have a clearly defined expected time. Some test items require the use of the matching function of the test equipment. The test vector stops at a certain line and waits until the expected high or low level is matched before continuing the test. This ensures test consistency. The matching function of the test equipment is particularly necessary for the testing of buses such as IIC and UART.

[0114] In summary, this embodiment provides an MCU self-test method that breaks through the barriers of MCU testing. Through communication protocol instructions, it integrates complex configuration programs, allowing the MCU to load complex multi-module integrated configuration programs at once for self-testing. Simultaneously, during the MCU self-testing process, a minimum working system for the MCU is built, enabling the MCU chip under test to operate in a real application environment. Furthermore, it fully utilizes the MCU's powerful computing, control, and judgment capabilities to perform self-testing internally, better stimulating the chip's failure modes. Compared to previous MCU testing methods, for complex controllers, the MCU self-testing method described in this embodiment significantly reduces the difficulty of writing test patterns. Most judgments are executed internally within the MCU; the ATE (Automatic Test Equipment) only needs to schedule internal MCU resources and perform simple judgments on the responses. This MCU self-testing method is an open testing method; as long as the communication protocol capacity is large enough, test items can be added arbitrarily according to testing needs until the required fault coverage is achieved.

[0115] 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, and the 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.

[0116] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A self-test method for an MCU, characterized in that, include: Connect the test interface board, which carries the MCU chip under test and the minimum system required for its normal operation, to the ATE test equipment. Generate an executable file for the MCU configuration program and download the executable file to the MCU chip under test; The MCU configuration program stores the test program for each test item; The ATE test equipment sends communication protocol instructions pointing to each test item to the MCU chip under test in sequence. The MCU chip under test executes the test program of the test item pointed to by the communication protocol instructions in sequence according to the communication protocol instructions, thereby realizing the test of the MCU chip under test. The ATE test equipment performs each test item in the following manner: Send communication protocol instructions to the MCU chip under test, specifying the test program for the test item; The MCU chip under test executes the test program of the test item according to the communication protocol instructions pointing to the test program of the test item; If the ATE test equipment observes the agreed observation signal of the test item output by the MCU chip under test within the specified time, then the test item passes the test.

2. The MCU self-test method according to claim 1, characterized in that, The ATE test equipment sends communication protocol instructions to each test item in descending order of priority. After a test item with a higher priority passes the test, the test item with a lower priority is executed until all test items are completed. If all test items pass the test, the MCU chip under test passes the self-test; otherwise, the MCU chip under test fails the self-test.

3. The MCU self-test method according to claim 2, characterized in that, The test program for the test item is used to respond to the communication protocol instruction pointing to the test program for the test item, execute the test operation of the test item, and control the MCU chip under test to output the corresponding observation signal after the test operation is completed; All test programs are placed in a while loop.

4. The MCU self-test method according to claim 3, characterized in that, The MCU configuration program also includes an initialization configuration program, which is located before the while loop; The initialization configuration program is used to perform kernel initialization, clock initialization and IO initialization of the MCU chip under test; the IO initialization is used to configure the port receiving the communication protocol instructions into input mode.

5. The MCU self-test method according to claim 4, characterized in that, Before performing all test items, the ATE test equipment first sends an initialization command pointing to the initialization configuration program to the MCU chip under test; The MCU chip under test executes the initialization configuration program based on the initialization instructions.

6. The MCU self-test method according to claim 4, characterized in that, The port configured as input mode is a non-multiplexed I / O port or a UART port.

7. The MCU self-test method according to any one of claims 4-6, characterized in that, The test items include: I / O port high / low level test; UART test; internal instruction set and register test; IIC test; among which... When the port configured as input mode is a non-multiplexed I / O port, the test priority of the high and low level test of the I / O port is the highest, and the test priority of the other test items is equal and lower than the test priority of the high and low level test of the I / O port. When the port configured as input mode is a UART port, the UART test has the highest test priority, and the test priorities of the other test items are equal and lower than the test priority of the UART test.

8. The MCU self-test method according to claim 7, characterized in that, ATE test equipment performs high and low level tests on I / O ports in the following manner: The ATE test equipment sends communication protocol commands to the MCU chip under test to perform test programs for high and low level tests on the I / O ports. The MCU chip under test executes the test program for testing the high and low levels of the I / O ports according to the communication protocol instructions of the test program pointing to the I / O port high and low level test: The MCU chip under test is configured with all I / O ports as output ports. Then, all I / O ports are controlled to output a high level, and after a fixed time, all I / O ports are controlled to output a low level. Subsequently, the IO initialization is performed; If the ATE test equipment observes that the output of all IO ports of the MCU chip under test switches from high level to low level within the specified time, then the IO port high and low level test is passed.

9. The MCU self-test method according to claim 7, characterized in that, The ATE test equipment performs UART testing in the following ways: The ATE test equipment sends communication protocol commands to the MCU chip under test, pointing to the test program for UART testing; The MCU chip under test executes the UART test program according to the communication protocol instructions pointed to in the UART test program: The MCU chip under test is configured to operate in the following mode: data received at the UART input port is retransmitted through the UART output port. The ATE test equipment writes UART protocol instructions to the UART input port of the MCU chip under test. The MCU chip under test repackages the data in the UART protocol instructions and sends it out through the UART output port. Subsequently, the IO initialization is performed; If the ATE test equipment observes that the UART output port outputs data from the UART protocol command within the specified time, then the UART test is passed.

10. The MCU self-test method according to claim 1, characterized in that, The test interface board is equipped with: The test socket is where all testable ports of the MCU chip under test are led out and connected to the digital channel of the ATE test equipment. A reset circuit, a crystal oscillator circuit, and a download interface are respectively connected to the corresponding ports of the MCU chip under test; the executable file is downloaded to the MCU chip under test through the download interface. Optocoupler control circuit is used to switch the hardware connection state of the same port at different times.