Chip programming method, programming device, chip and system

The method uses communication detection commands to ensure proper connection and power status of soldered chips, addressing the limitations of existing OS detection circuits and enhancing the chip burn-in process.

CN112416376BActive Publication Date: 2025-07-15SHANGHAI EASTSOFT MICROELECTRONICS
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011310498.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-20
Publication Date
2025-07-15
Estimated Expiration
2040-11-20

AI Technical Summary

Technical Problem

Existing burning equipment cannot effectively detect chips soldered on the system board, especially chips that have been powered.

Method used

Through the communication detection command interaction between the recording device and the chip, it is possible to detect whether the chip soldered on the system board is in good contact with the recording device, including sending the first communication detection command and receiving the chip's response message, determining whether the chip is in a reset state and in good contact with the device, and performing program recording processing.

Benefits of technology

It realizes effective detection of chips soldered on the system board, ensures the success of program burning, and improves the accuracy and efficiency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112416376B_ABST
    Figure CN112416376B_ABST
Patent Text Reader

Abstract

The chip programming method, programming device, chip and system provided by the present invention send a first communication detection command to a chip soldered on a system board through the programming device, wherein the first communication detection command is used to instruct the chip to feedback an acknowledgement message; receive a first acknowledgement message returned by the chip in response to the first communication detection command, wherein the first acknowledgement message is used to indicate that the chip is in a reset state and the chip is in good contact with the programming device; perform a program programming process on the chip; that is, according to the interaction result of the communication detection command between the programming device and the chip in the embodiment of the present invention, effective detection of the chip soldered on the system board is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and particularly to a chip programming method, a programming device, a chip and a system. Background Art

[0002] With the popularization of Electronic Design Automation (EDA) tools and the increasing maturity of In System Programming (ISP) devices, ISP technology has been more and more widely applied.

[0003] In the existing programming process, an OS detection circuit is provided on the programming device. When the programming device detects a Micro Controller Unit (MCU) chip to be programmed through the OS detection circuit, the program programming is started, and then the program programming is completed.

[0004] However, the OS detection circuit can only detect independent chips, and cannot effectively detect the chips soldered on the system board, especially the chips soldered on the system board that have been powered on. Summary of the Invention

[0005] In view of the above problems, the present invention provides a chip programming method, a programming device, a chip and a system.

[0006] In a first aspect, the present invention provides a chip programming method, which is applied to a programming device, and the method includes: sending a first communication detection command to a chip soldered on a system board, where the first communication detection command is used to instruct the chip to feedback a response message; receiving a first response message returned by the chip for the first communication detection command, where the first response message is used to characterize that the chip is in a reset state and the chip is in good contact with the programming device; performing a program programming process on the chip.

[0007] In other optional embodiments, after performing the program programming process on the chip, the method further includes: sending a second communication detection command to the chip, where the second communication detection command is used to instruct the chip to feedback a response message; if the second response message returned by the chip for the second communication detection command is not received, it is determined that the chip has been removed from the programming device.

[0008] In other optional embodiments, for a chip whose reset pin is not multiplexed, before sending the first communication detection command to the chip soldered on the system board, the method further includes: outputting a low level to the reset pin of the chip to make the chip in a reset state.

[0009] In other alternative embodiments, for a chip whose reset pin is multiplexed, sending the first communication detection command to the chip soldered on the system board includes: during the power-on window time of the chip, sending the first communication detection command to the chip, where the power-on window time of the chip corresponds to the chip being in a reset state.

[0010] In other alternative embodiments, the method further includes: if the first response message returned by the chip for the first communication detection command is not received, then determining the power supply mode of the chip; if it is determined that the power supply mode of the chip is power supply by the programming device, then controlling the chip to perform power-off and power-on processing, and again executing the step of sending the first communication detection command to the chip soldered on the system board; if it is determined that the power supply mode of the chip is not power supply by the programming device, then again executing the step of sending the first communication detection command to the chip soldered on the system board.

[0011] In other alternative embodiments, if the number of times of repeatedly executing the step of sending the first communication detection command to the chip soldered on the system board and receiving the first response message returned by the chip for the first communication detection command reaches a first preset number of times, then it is determined that the chip is in a reset state and the chip is in good contact with the programming device.

[0012] In other alternative embodiments, if the number of times of repeatedly executing the step of sending the second communication detection command to the chip and not receiving the second response message returned by the chip for the second communication detection command reaches a second preset number of times, then it is determined that the chip has been removed from the programming device.

[0013] In other alternative embodiments, for a chip powered by a non-programming device, the program programming process for the chip includes: 1) controlling the chip to enter the ISP mode, and performing user program and configuration programming processing on the chip in the ISP mode, mainly including steps such as erasing, programming, verifying, and encrypting; 2) controlling the chip after programming is completed to exit the ISP programming mode.

[0014] The programming process generally includes:

[0015] First, perform an erase operation, that is, clear the memory content of the program space and user configuration space of the MCU through an erase instruction;

[0016] Then, perform a programming operation, that is, read out the user program and user configuration originally downloaded to the external memory, and write them into the memory of the program space and configuration space of the MCU through an instruction;

[0017] Next, confirm whether the burning is correct. The memory content can be read out one by one through each address and compared with the content of the external memory; or the CRC value can be read through the CRC check function inside the MCU and compared with the CRC value calculated by the interface software.

[0018] Finally, perform the encryption programming operation. After successful encryption, the content of the program space memory of the MCU cannot be read, thus protecting the user code.

[0019] During the program burning process, if the programming is unsuccessful, stop the burning process and prompt an error message.

[0020] In a second aspect, the present invention provides a chip burning method applied to a chip soldered on a system board. The method includes: receiving a first communication detection command sent by a burning device, where the first communication detection command is used to instruct the chip to feedback a response message; returning a first response message to the burning device for the first communication detection command, where the first response message is used to indicate that the chip is in a reset state and the chip is in good contact with the burning device; receiving the program burning process of the chip by the burning device.

[0021] In other alternative embodiments, for a chip whose reset pin is multiplexed, the receiving the first communication detection command sent by the burning device includes: if the chip is in the power-on window time, receiving the first communication detection command sent by the burning device, where the power-on window time of the chip corresponds to the chip being in a reset state.

[0022] In other alternative embodiments, after receiving the first communication detection command sent by the burning device, it further includes: restarting the timing, where the timing is used to time the power-on window time of the chip.

[0023] In a third aspect, the present invention provides a burning device, including: a first sending module for sending a first communication detection command to a chip soldered on a system board, where the first communication detection command is used to instruct the chip to feedback a response message; a first receiving module for receiving the first response message returned by the chip for the first communication detection command, where the first response message is used to indicate that the chip is in a reset state and the chip is in good contact with the burning device; a program burning module for performing a program burning process on the chip.

[0024] Fourth aspect, the present invention provides a chip, comprising: a second receiving module, configured to receive a first communication detection command sent by a programming device, wherein the first communication detection command is used to instruct the chip to feedback a response message; a second sending module, configured to return a first response message to the programming device for the first communication detection command, wherein the first response message is used to indicate that the chip is in a reset state and the chip is in good contact with the programming device; a program receiving module, configured to receive the program programming process of the programming device.

[0025] Fifth aspect, the present invention provides a chip programming system, comprising a programming device and a chip soldered on a system board; wherein, the programming device is configured to execute the method according to any one of the first aspect; the chip is configured to execute the method according to any one of the second aspect.

[0026] The chip programming method, programming device, chip and system provided by the present invention send a first communication detection command from the programming device to the chip soldered on the system board, wherein the first communication detection command is used to instruct the chip to feedback a response message; receive the first response message returned by the chip for the first communication detection command, wherein the first response message is used to indicate that the chip is in a reset state and the chip is in good contact with the programming device; perform a program programming process on the chip; that is, the embodiment of the present invention realizes the effective detection of the chip soldered on the system board according to the interaction result of the communication detection command between the programming device and the chip. Description of the Drawings

[0027] Figure 1 It is a schematic diagram of a chip programming system provided by the present invention;

[0028] Figure 2 It is a schematic diagram of a programming hardware device provided by the present invention;

[0029] Figure 3 It is a schematic flow chart of a chip programming method provided by the present invention;

[0030] Figure 4 It is a schematic flow chart of another chip programming method provided by the present invention;

[0031] Figure 5 It is a schematic flow chart of the first communication detection command provided by the present invention;

[0032] Figure 6 It is a schematic flow chart of the second communication detection command provided by the present invention;

[0033] Figure 7 It is a schematic flow chart of still another chip programming method provided by the present invention;

[0034] Figure 8Schematic diagram of a programming device provided by the present invention;

[0035] Figure 9 Schematic diagram of a chip provided by the present invention;

[0036] Figure 10 Schematic diagram of the hardware structure of a control device provided by the present invention. Detailed implementation manners

[0037] To make the objectives, technical solutions, and advantages of the examples of the present invention clearer, the technical solutions in the examples of the present invention will be clearly and completely described below with reference to the accompanying drawings in the examples of the present invention.

[0038] First, the terms related to the present invention are explained:

[0039] In-System Programming (ISP) refers to programming or reprogramming a device on a user-designed target system or printed circuit board to reconfigure logic or implement new functions.

[0040] Offline programming mode: It means that after the user program and configuration are downloaded to the programmer (or programming device), it is not necessary to send commands through a PC for programming. Instead, after the programmer automatically detects the chip or receives the start signal provided by the robotic device, the programming is automatically started. This method greatly improves the mass production efficiency.

[0041] With the popularization of EDA tools and the increasing maturity of ISP devices, ISP technology has also been more and more widely applied. To simplify the production process, more and more users choose the process of first soldering the chip and then programming it, or, in order to enable the chip to achieve new functions, online upgrade the chips on the system board that have been programmed.

[0042] In the existing program programming process, an OS detection circuit is provided on the programming device. When the programming device detects the MCU chip through the OS detection circuit, it detects whether the chip is in good contact with the programming device through the internal diodes from the chip IO to VDD, from GND to IO, and from GND to VDD. Only after good contact will the program programming be started, and then the program programming will be completed.

[0043] However, since the OS detection circuit needs to be connected to each pin of the chip to detect the chip, that is to say, the OS detection circuit can detect an independent chip, but for the chip soldered on the system board, due to the influence of the customer circuit on the system board, it cannot effectively detect the chip.

[0044] Therefore, in view of the above technical problems, the technical concept of the present invention is to automatically detect whether the chip is in good contact with the programming device or has been removed through the interaction of communication detection commands between the programming device and the chip, thereby achieving effective detection of the chip soldered on the system board.

[0045] Figure 1 The following is a schematic diagram of a chip programming system provided by the present invention, as Figure 1 shown, one of the chip programming systems based on the present invention includes a programming device and a chip 3 to be programmed. Among them, the programming device includes a PC interface software 1 and a programming hardware device 2.

[0046] Figure 2 The following is a schematic diagram of a programming hardware device provided by the present invention, as Figure 2 shown, the programming hardware device includes a monitoring chip 21, a power supply module 22 (such as an external power supply), a storage module 23, a key module 24, an LED indicator module 25, an OLED display module 26, a fast power-down circuit 27, etc. Among them, the storage module 23 includes an Electrically Erasable Programmable Read Only Memory (EEPROM) and a serial flash chip. Among them, the monitoring chip 21 is selected to include a USB module, and communication between the PC and the programming hardware device 2 is realized through a USB interface.

[0047] During programming, the user can select the chip model to be programmed through the PC interface software 1, and the PC interface software 1 upgrades the underlying firmware timing accordingly. The PC interface software 1 provides hex or bin file downloads, and also provides project file downloads. For example, information such as user programs, user configuration words, serial number settings, operation steps, burn count limits, and power settings are downloaded in sequence through the PC interface software 1, or the above information can be saved as a project and loaded with one key.

[0048] The programming device provides an online programming method and also provides an offline programming method. Among them, the online programming method prompts the programming feedback information on the PC interface software 1. One project is downloaded for each online programming, that is, the project displayed on the current interface is programmed. The offline programming method prompts the programming information on the OLED display module 26. For offline programming, first, several projects can be downloaded at one time in the online state. Press and hold the offline programming key module 24 to enter the offline programming mode, then press the key module 24 briefly to select a project, and press and hold to confirm the current project, and then automatic detection and mass production programming can be performed.

[0049] Before implementing the present invention, first complete the preparation work of the programming device according to the following steps, including the following steps:

[0050] (1) Connect the PC to the programming device via the USB cable. The USB powers the programming device, and the device initializes, such as clock initialization, port initialization, USB initialization, and hardware self - test. The OLED screen displays the device name and version number.

[0051] (2) Open the PC interface software 1. It automatically enumerates and identifies the device, sends a communication link command frame, and if the firmware replies correctly, it is considered that the communication is successful.

[0052] (3) Load the offline project to be programmed on the offline download page. The software sends command and data frames, and the underlying firmware receives and stores the information and data in the serial flash. The information and data sent include timing HEX, user HEX, user configuration word, serial number setting, power supply setting (whether powered by the host), burn - in times limit, etc.

[0053] (4) After the download is completed, the device can be disconnected from the PC. At this time, the PC is not required, and only a power supply is needed, such as a 5V DC power supply.

[0054] (5) Long - press the offline programming button module 24 to enter the offline programming mode; then short - press the offline programming button module 24, and the OLED display module 26 switches to display the names of each offline project. When switching to the project to be burned, long - press the offline programming button module 24 again to select the project to be burned offline.

[0055] (6) The firmware automatically reads the timing of the selected offline project from the serial flash and writes it into the monitoring chip 21. Information such as the timing of the offline project, user program, and configuration is stored in the serial flash chip. For each project, after being downloaded to the serial flash, it generally does not change, or rarely changes. Generally, it is deleted and redownloaded, and is not frequently modified. Its erase - write life is generally 100,000 times. This kind of serial flash has a large capacity and a favorable price. For example, the MX25L6405D chip is 64M - Bit (i.e., 8M - Byte), while EEPROM or ferro - electric EEPROM is relatively much more expensive, and there are few large - capacity models. It is generally used for storing data that needs to be burned frequently, such as saving the number of successfully burned chips currently and user serial numbers, etc., which are data that need to be changed every time of burning. For example, the FM24C04B has a life of 100 trillion (10 14 ) read - write times.

[0056] (7) The firmware automatically reads the user HEX, user configuration word, serial number setting, voltage setting, burn - in times limit, etc. of the selected offline project from the serial flash and writes them into the common area of the serial flash.

[0057] (8) Refresh the OLED display module 26 to display the project name, chip name, code checksum, and the number of successfully burned chips.

[0058] (9) Start offline programming, that is, automatically detect the chip and perform programming according to the set operation steps, that is, execute the steps corresponding to the following embodiments.

[0059] Figure 3 It is a schematic flow chart of a chip programming method provided by the present invention. As Figure 3 shown, the chip programming method includes:

[0060] Step 101: Send a first communication detection command to the chip soldered on the system board.

[0061] Among them, the first communication detection command is used to instruct the chip to feedback an acknowledgment message.

[0062] Specifically, before this step, place the chip to be programmed on the programming device, and then the programming device sends a first communication detection command to the chip.

[0063] Correspondingly, the chip receives the first communication detection command sent by the programming device, and among them, the first communication detection command is used to instruct the chip to feedback an acknowledgment message.

[0064] Step 102: The chip returns a first acknowledgment message to the programming device for the first communication detection command.

[0065] Among them, the first acknowledgment message is used to represent that the chip is in a reset state and the chip is in good contact with the programming device.

[0066] Specifically, when the chip is in a reset state, the chip will receive the first communication detection command sent by the programming device and return a first acknowledgment message to the programming device; in addition, the programming device can receive the first acknowledgment message fed back by the chip, which also shows that the chip is in good contact with the programming device.

[0067] Correspondingly, on the programming device side, receive the first acknowledgment message returned by the chip for the first communication detection command, and among them, the first acknowledgment message is used to represent that the chip is in a reset state and the chip is in good contact with the programming device.

[0068] As an optional embodiment, for a chip whose reset pin is not multiplexed, before step 101, it further includes: outputting a low level to the reset pin of the chip to make the chip in a reset state.

[0069] Specifically, for a chip whose reset pin RST_PIN is not multiplexed, the programming device outputs a low level to the RST_PIN pin to put the chip in the reset state. Then, the programming device sends a first communication detection command to the chip. If the chip gives a correct response message, it is determined that the chip is in good contact with the programming device, or in other words, the chip has been detected in the programming device. Optionally, the chip can also be put into the reset state through a reset instruction.

[0070] As an alternative embodiment, for a chip whose reset pin is multiplexed, step 101 includes: sending a first communication detection command to the chip during the power-on window time of the chip, where the power-on window time of the chip corresponds to the chip being in the reset state.

[0071] Specifically, for a chip whose reset pin RST_PIN has been multiplexed as a digital IO, the power-on window time of the chip corresponds to the reset state of the chip. That is to say, within the power-on window time of the chip, the chip can receive the first communication detection command sent by the programming device and return a first response message to the programming device.

[0072] As an alternative embodiment, the method further includes: if the first response message returned by the chip for the first communication detection command is not received, then determine the power supply mode of the chip; if it is determined that the power supply mode of the chip is the programming device power supply, then control the chip to perform power-off and power-on processing, and execute the step of sending the first communication detection command to the chip soldered on the system board again; if it is determined that the power supply mode of the chip is non-programming device power supply, then execute the step of sending the first communication detection command to the chip soldered on the system board again.

[0073] Specifically, for a chip whose reset pin RST_PIN has been multiplexed as a digital IO, if the power-on window time of the chip is missed, the chip will not feedback the first response message to the programming device. At this time, the programming device will determine the power supply mode of the chip. If it is determined that the programming device supplies power to it, then control the chip to perform power-off and power-on processing so that the chip is again in the power-on window time. The programming device sends the first communication detection command again to determine whether the first response message is received. If the first response message is still not received, it means that the chip is not in good contact with the programming device. At this time, the position of the chip can be adjusted; if it is determined that the non-programming device supplies power to it, the programming device directly sends the first communication detection command again and continues to determine whether the first response message feedback by the chip is received.

[0074] In addition, for situations where large capacitors may be connected to the VDD pin on the customer system board, a fast power-off control circuit can be added externally to achieve fast power-off and power-on unlocking and enter the programming mode, which can improve the programming efficiency.

[0075] During the above process, the red LED flashes to indicate that the chip is being detected for good contact. The OLED displays the chip name, user code checksum, and the number of chips that have been successfully programmed.

[0076] Step 103: The programming device performs a program programming process on the chip.

[0077] Specifically, after receiving the first response message from the chip, it indicates that the programming device has detected the chip. At this time, the programming device can unlock the chip, enter the programming mode, and execute step by step according to the offline programming process. The programming of the MCU generally includes: erasing, programming, verifying, and encrypting.

[0078] Correspondingly, the chip receives the program programming process from the programming device.

[0079] During the above programming process, the yellow LED indicator of the programming device is constantly on to indicate that the chip programming is in progress. The OLED displays "Programming".

[0080] As an optional embodiment, for a chip not powered by the programming device, step 103 includes: controlling the chip to enter the programming mode, performing a program programming process on the chip in the programming mode; and controlling the chip after the program programming process to exit the programming mode.

[0081] Specifically, when the programming device receives the first response message from the chip, it can control the chip to unlock and enter the ISP programming mode to perform ISP programming. After programming: for a chip not powered by the programming device, it is also necessary to control the chip to exit the ISP programming mode because for a system board not powered by the programming device, the system board remains powered on, and the chip is in the ISP programming mode during chip programming; if the ISP programming mode is not exited after program programming, the program cannot run. For example, for a chip not powered by the programming device and whose reset pin is not multiplexed, it is necessary to exit the ISP programming mode, and after removing the control of the chip's reset pin, the chip will automatically start running the program; for another example, considering the Electro Magnetic Compatibility (EMC) performance, for a chip whose reset pin is multiplexed, non-programming device power supply programming is not supported. That is to say, to prevent the program from being disturbed and entering the reset state during operation, a chip with a multiplexed reset pin only supports programming device power supply programming. After programming, it can exit the ISP programming mode and then enter the cyclic ISP mode state, that is, periodically send communication detection commands to confirm the response signal; it can also not exit the ISP programming mode and use the cyclic ISP mode state detection to confirm whether the chip has been removed from the programming device. When the chip is removed from the programming device, it powers off and exits the ISP programming mode.

[0082] As an optional embodiment, after step 103, it further includes: sending a second communication detection command to the chip, where the second communication detection command is used to instruct the chip to feedback an acknowledgment message; if the second acknowledgment message returned by the chip for the second communication detection command is not received, it is determined that the chip has been removed from the programming device.

[0083] Specifically, after the program is programmed, the programming device can send a second communication detection command to the chip. If the second acknowledgment message feedback by the chip is received, it indicates that the chip has not been removed from the programming device; if the second acknowledgment message is not received, it indicates that the chip has been removed from the programming device. That is to say, at this time, the entire programming process of the chip is completed. Optionally, steps 101-103 can be executed cyclically to program the next chip.

[0084] When the user program is programmed successfully, the green LED indicator light stays on constantly, indicating that the entire programming process of the chip is completed and successful.

[0085] The chip programming method provided by the embodiments of the present invention includes: sending a first communication detection command to the chip welded on the system board through a programming device, where the first communication detection command is used to instruct the chip to feedback an acknowledgment message; receiving the first acknowledgment message returned by the chip for the first communication detection command, where the first acknowledgment message is used to characterize that the chip is in a reset state and the chip is in good contact with the programming device; performing a program programming process on the chip; that is, according to the interaction result of the communication detection command between the programming device and the chip, the embodiments of the present invention realize the effective detection of the chip welded on the system board.

[0086] Combined with the foregoing implementation manners, Figure 4 is a schematic flowchart of another chip programming method provided by the present invention. As Figure 4 shown, applied to a programming device, the chip programming method includes:

[0087] Step 201: Send a first communication detection command to the chip welded on the system board.

[0088] Wherein, the first communication detection command is used to instruct the chip to feedback an acknowledgment message.

[0089] Step 202: Receive the first acknowledgment message returned by the chip for the first communication detection command.

[0090] Wherein, the first acknowledgment message is used to characterize that the chip is in a reset state and the chip is in good contact with the programming device.

[0091] Step 203: If the number of times of repeatedly executing step 201 and step 202 reaches a first preset number of times, it is determined that the chip is in a reset state and the chip is in good contact with the programming device.

[0092] Step 204: Perform program burning processing on the chip.

[0093] The implementation manners of step 201, step 202, and step 204 in this embodiment are similar to those of step 101, step 102, and step 103 in the foregoing embodiment respectively, and will not be elaborated here.

[0094] Different from the foregoing embodiment, in order to prevent communication detection errors caused by contact jitter or the like, in this embodiment, if the number of times of repeatedly executing the step of sending a first communication detection command to the chip welded on the system board and receiving a first response message returned by the chip for the first communication detection command reaches a first preset number of times, it is determined that the chip is in a reset state and the chip is in good contact with the burning device.

[0095] Specifically, the burning device sends the first communication detection command to the chip multiple times. If the first response message is received continuously for multiple times, it can be determined that the burning device is in good contact with the chip. Figure 5 It is a schematic flow diagram of the first communication detection command provided by the present invention. As Figure 5 shown, set the first preset number of times to n, and record one communication failure where the first communication detection command is sent once and the corresponding first response message is not received as FailCnt. First, initialize FailCnt and n to 0; then perform the first communication detection of the chip; if the communication detection fails, then FailCnt is incremented by 1 and n is incremented by 1; if the communication detection is not failed, then FailCnt remains unchanged and n is incremented by 1; then determine whether n is greater than or equal to the first preset number of times (take n = 3 as an example). If not, after a first preset interval (take a delay of 20 ms as an example), perform the first communication detection again; when n is greater than or equal to 3, determine whether FailCnt is 0. If so, it means that each communication is successful within the first preset number of times. At this time, the first response message detecting the chip can be returned to the burning device; when n is greater than or equal to 3, but FailCnt is not 0, it means that there are FailCnt times of communication failures within the first preset number of times. At this time, the message that the chip is not detected can be returned.

[0096] As an optional embodiment, after step 204, it further includes: if the number of times of repeatedly executing the step that the burning device sends a second communication detection command to the chip and no second response message returned by the chip for the second communication detection command is received reaches a second preset number of times, it is determined that the chip is removed from the burning device.

[0097] Specifically, after the program burning is completed, the burning device sends the second communication detection command to the chip multiple times. If the second response message is not received continuously for multiple times, it can be determined that the chip is removed from the burning device.Figure 6 The flow diagram of the second communication detection command provided by the present invention is shown as Figure 6 follows. Similarly, the second preset number is set to n, and the communication count of receiving the corresponding second response message each time the second communication detection command is sent is recorded as OKCnt. First, both OKCnt and n are initialized to 0; then the second communication detection of the chip is performed; if the communication detection is successful, OKCnt is incremented by 1 and n is incremented by 1; if the communication detection fails, OKCnt remains unchanged and n is incremented by 1; then it is judged whether n is greater than the second preset number (taking n = 3 as an example), if it is less than 3, after a second preset interval (taking a delay of 20 ms as an example), the second communication detection is performed again; when n is greater than or equal to 3, it is judged whether OKCnt is 0, if so, it means that each communication fails within the second preset number, that is to say, the chip has not returned the second response message to the programming device for the second consecutive preset number, indicating that the chip has been removed at this time, and the information that the chip has been taken away can be returned; when n is greater than or equal to 3 but OKCnt is not 0, it means that there are OKCnt successful communications within the second preset number, and at this time, the information that the chip has not been taken away can be returned.

[0098] It should be noted that the first preset number and the second preset number can be the same or different. In addition, the first communication detection command and the second communication detection command can be in various combinations of ISP communication detection command values and response values.

[0099] Optionally, the step of sending the first communication detection command to the chip is repeatedly executed according to a first preset time interval; or, the step of sending the second communication detection command to the chip is repeatedly executed according to a second preset time interval, where the first preset time interval and the second preset time interval can be the same or different.

[0100] Specifically, the communication detection is very fast, while the mechanical adjustment time for chip jitter and clamping is relatively long. Therefore, an appropriate delay (such as a delay of 20 ms) can be added between each detection to adjust the distribution time of the communication detection.

[0101] Optionally, a level converter is provided between the programming device and the system board. Specifically, when programming the system board with a battery, the programming power is provided by the battery, and the programming device provides reset, data, clock signals and ground signals. The ground of the programming device needs to be connected in common with the ground of the system board. When the level requirements of the programming device and the system board are different, the signals provided by the programming device need to be level-converted. Optionally, the level converter can adopt a single-unit bidirectional controllable level conversion chip, that is, the signals provided by the programming device are converted into level signals that can be received by the system board through the single-unit bidirectional controllable level conversion chip, and at the same time, the signals output by the chip are converted into level signals that can be received by the programming device.

[0102] On the basis of the foregoing embodiments, if the number of times of repeatedly executing the step of sending a first communication detection command to the chip welded to the system board and receiving the first response message returned by the chip for the first communication detection command reaches a first preset number of times, it is determined that the chip is in a reset state and the chip is in good contact with the programming device; or, if the number of times of repeatedly executing the step of sending a second communication detection command to the chip and not receiving the second response message returned by the chip for the second communication detection command reaches a second preset number of times, it is determined that the chip has been removed from the programming device, reducing the probability of misdetecting the chip caused by contact jitter, etc., and improving the accuracy of chip detection.

[0103] Combined with the foregoing implementation manners, Figure 7 The flowchart of still another chip programming method provided by the present invention is shown as Figure 7 shown, which is applied to a chip. The chip programming method includes:

[0104] Step 301: Receive a first communication detection command sent by a programming device;

[0105] Wherein, the first communication detection command is used to instruct the chip to feedback a response message.

[0106] Step 302: Restart timing.

[0107] Wherein, the timing is used to time the power-on window time of the chip.

[0108] Step 303: Return a first response message for the first communication detection command to the programming device.

[0109] Wherein, the first response message is used to represent that the chip is in a reset state and the chip is in good contact with the programming device.

[0110] Step 304: Receive the program programming process of the programming device for the chip.

[0111] The implementation manners of Step 301, Step 303 and Step 304 in this embodiment are respectively similar to those of Step 101, Step 102 and Step 103 in the foregoing embodiments, and will not be elaborated here.

[0112] Different from the foregoing embodiments, in this embodiment, when the chip receives the first communication detection command, it will restart timing, wherein the timing is used to time the power-on window time of the chip. Among them, there is no sequence between Step 302 and Step 303, and they can also be executed simultaneously.

[0113] Specifically, for a chip whose reset pin is multiplexed, when the chip is powered on, a timer inside the chip will start timing to record the power-on window time. Only when the timing is within the power-on window time, the chip will receive the first communication detection command sent by the programming device and feedback the first response message. That is to say, as long as the timing does not exceed the specified power-on window time, the chip is still in the reset state and the customer program will not run; and in this embodiment, when the chip receives the first communication detection command within the power-on window time, it will restart the timing, which is equivalent to extending the power-on window time.

[0114] In addition, it should be noted that the programming device can send communication detection commands to the chip in a loop. Then, every time the chip receives a communication detection command, it will re-time. After obtaining the correct response message a preset number of times, the chip programming will be started.

[0115] Based on the foregoing embodiment, by restarting the timing when the chip receives the first communication detection command, where the timing is used to time the power-on window time of the chip, the power-on window time of the chip is extended, facilitating program burning.

[0116] The example of the present invention provides a programming device. Figure 8 As shown in the structural schematic diagram of a programming device provided by the present invention, Figure 8 as shown, the programming device includes:

[0117] A first sending module 10 for sending a first communication detection command to the chip welded on the system board, where the first communication detection command is used to instruct the chip to feedback a response message; a first receiving module 20 for receiving the first response message returned by the chip in response to the first communication detection command, where the first response message is used to indicate that the chip is in the reset state and the chip is in good contact with the programming device; a program burning module 30 for performing program burning processing on the chip.

[0118] In other alternative embodiments, the first sending module 10 is further configured to, after performing program burning processing on the chip, send a second communication detection command to the chip, where the second communication detection command is used to instruct the chip to feedback a response message; if the first receiving module 20 does not receive the second response message returned by the chip in response to the second communication detection command, it is determined that the chip has been removed from the programming device.

[0119] In other alternative embodiments, for a chip whose reset pin is not multiplexed, the first sending module 10 is further configured to output a low level to the reset pin of the chip before sending the first communication detection command to the chip welded on the system board, so that the chip is in the reset state.

[0120] In other alternative embodiments, for a chip whose reset pin is multiplexed, the first sending module 10 is further configured to send a first communication detection command to the chip during the power-on window time of the chip, where the power-on window time of the chip corresponds to the chip being in a reset state.

[0121] In other alternative embodiments, the first sending module 10 is further configured to: if the first response message returned by the chip in response to the first communication detection command is not received, determine the power supply mode of the chip; if it is determined that the power supply mode of the chip is power supply by the programming device, control the chip to perform power-off and power-on processing, and execute the step of sending the first communication detection command to the chip soldered on the system board again; if it is determined that the power supply mode of the chip is not power supply by the programming device, execute the step of sending the first communication detection command to the chip soldered on the system board again.

[0122] In other alternative embodiments, the first sending module 10 is further configured to, if the number of times of repeatedly executing the step of sending the first communication detection command to the chip soldered on the system board and receiving the first response message returned by the chip in response to the first communication detection command reaches a first preset number of times, determine that the chip is in a reset state and the chip is in good contact with the programming device.

[0123] In other alternative embodiments, the first sending module 10 is further configured to, if the number of times of repeatedly executing the step of sending the second communication detection command to the chip and not receiving the second response message returned by the chip in response to the second communication detection command reaches a second preset number of times, determine that the chip has been removed from the programming device.

[0124] In other alternative embodiments, the program programming module 30 is specifically configured to: control the chip to enter the programming mode, perform program programming processing on the chip in the programming mode; control the chip after the program programming processing to exit the programming mode.

[0125] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process and corresponding beneficial effects of the above-described programming device can refer to the corresponding process in the foregoing method example, and will not be elaborated herein.

[0126] An example of the present invention provides a chip. Figure 9 The following is a schematic structural diagram of a chip provided by the present invention, as Figure 9 shown, the chip includes:

[0127] A second receiving module 40, configured to receive a first communication detection command sent by a programming device, where the first communication detection command is used to instruct the chip to feedback an acknowledgement message; a second sending module 50, configured to return a first acknowledgement message for the first communication detection command to the programming device, where the first acknowledgement message is used to indicate that the chip is in a reset state and the chip is in good contact with the programming device; a program receiving module 60, configured to receive program programming processing of the programming device.

[0128] In other optional embodiments, for a chip whose reset pin is multiplexed, the second receiving module 40 is specifically configured to: if the chip is in a power-on window time, receive a first communication detection command sent by the programming device, where the power-on window time of the chip corresponds to the chip being in a reset state.

[0129] In other optional embodiments, the second receiving module 40 is further configured to restart timing after receiving the first communication detection command sent by the programming device, where the timing is used to time the power-on window time of the chip.

[0130] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the chip described above and the corresponding beneficial effects can refer to the corresponding process in the foregoing method examples, and will not be elaborated here.

[0131] An embodiment of the present invention provides a chip programming system, including a programming device and a chip welded on a system board: wherein, the programming device is configured to execute the method according to any one of the first aspect; the chip is configured to execute the method according to any one of the second aspect of the claims.

[0132] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the chip programming system described above and the corresponding beneficial effects can refer to the corresponding process in the foregoing method examples, and will not be elaborated here.

[0133] An example of the present invention provides a control device Figure 10 is a schematic hardware structure diagram of a control device provided by the present invention. It should be noted that the control device provided by the example of the present invention is provided in the programming device, such as Figure 10 shown, including:

[0134] At least one processor 1001 and a memory 1002.

[0135] In a specific implementation process, at least one processor 1001 executes computer execution instructions stored in the memory 1002, so that at least one processor 1001 executes the above chip programming method, where the processor 1001 and the memory 1002 are connected through a bus 1003.

[0136] For the specific implementation process of the processor 1001, reference may be made to the above method embodiments. Their implementation principles and technical effects are similar, and thus will not be elaborated herein.

[0137] Another control device is also provided in an example of the present invention. Its hardware structure is similar to Figure 10 the one described above, and it is set on a chip. Its implementation principle and technical effects are similar to those of the above method embodiments, and thus will not be elaborated herein.

[0138] In the above Figure 10 illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU for short), or other general-purpose processors, digital signal processors (DSP for short), application specific integrated circuits (ASIC for short), etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the present invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0139] The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory.

[0140] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of easy representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0141] Fourthly, the present invention also provides a readable storage medium, which is set on the side of the burning device. Computer-executable instructions are stored in the readable storage medium. When the processor executes the computer-executable instructions, the above chip burning method is implemented.

[0142] The present invention also provides another readable storage medium, which is set on the chip. Computer-executable instructions are stored in the readable storage medium. When the processor executes the computer-executable instructions, the above chip burning method is implemented.

[0143] The above-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.

[0144] An exemplary readable storage medium is coupled to the processor, enabling the processor to read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.

[0145] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps included in the above method embodiments; and the foregoing storage medium includes various media that can store program codes, such as ROM, RAM, magnetic disks, or optical disks.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A chip programming method, characterized in that, The method is applied to a programming device, and the method includes: Sending a first communication detection command to a chip soldered on a system board, where the first communication detection command is used to instruct the chip to return a response message; Receiving a first response message returned by the chip in response to the first communication detection command, where the first response message is used to indicate that the chip is in a reset state and the chip is in good contact with the programming device; Performing a program burning process on the chip; For a chip whose reset pin is multiplexed as a digital IO, the sending a first communication detection command to a chip soldered on a system board includes: During the power-on window time of the chip, circularly sending a first communication detection command to the chip soldered on the system board, and the timer in the chip restarts timing to extend the power-on window time, where the power-on window time of the chip corresponds to the chip being in a reset state; If the first response message returned by the chip in response to the first communication detection command is not received, then determine the power supply mode of the chip; If it is determined that the power supply mode of the chip is powered by the programming device, then control the chip to perform power-off and power-on processing based on an externally added fast power-off control circuit, so that the chip re-enters the power-on window time, and the step of sending a first communication detection command to the chip soldered on the system board is performed again within the power-on window time; If it is determined that the power supply mode of the chip is not powered by the programming device, then perform the step of sending a first communication detection command to the chip soldered on the system board again; After performing the program burning process on the chip, it further includes: For a chip that is not powered by the programming device and whose reset pin is not multiplexed, sending a signal to the chip to exit the programming mode and return to the reset state; For a chip that is powered by the programming device and whose reset pin is multiplexed, in the state of exiting the programming mode, periodically sending a second communication detection command to the chip to restart the reset window time of the chip, so that the chip is in a reset state, and receiving the second communication detection command and making a response, where the second communication detection command is used to instruct the chip to return a response message; in the state of not exiting the programming mode, when the second communication detection command is sent and the chip feedback response information is not received, perform a power-off process on the chip, power on again and send the second communication detection command to determine whether the chip has been removed; if the second response message returned by the chip in response to the second communication detection command is not received, then determine that the chip has been removed from the programming device.

2. The method according to claim 1, characterized in that, For a chip whose reset pin is not multiplexed, before sending a first communication detection command to the chip soldered on the system board, it further includes: Outputting a low level to the reset pin of the chip to make the chip in a reset state.

3. The method according to claim 1, wherein If the number of times of repeating the steps of sending a first communication detection command to the chip soldered on the system board and receiving the first response message returned by the chip in response to the first communication detection command reaches a first preset number of times, then determine that the chip is in a reset state and the chip is in good contact with the programming device.

4. The method according to claim 2, wherein if the step of repeatedly sending the second communication detection command to the chip and not receiving the second response message returned by the chip for the second communication detection command reaches a second preset number of times, it is determined that the chip has been removed from the programming device.

5. The method according to any one of claims 1 to 4, characterized in that For a chip not powered by the programming device, the program burning process for the chip includes: controlling the chip to unlock and enter the programming mode, and performing a program burning process on the chip in the programming mode; controlling the chip after the program burning process to exit the programming mode.

6. A chip programming method, characterized in that, The method is applied to a chip soldered on a system board. The method includes: receiving a first communication detection command sent by a programming device, where the first communication detection command is used to instruct the chip to return a response message; returning a first response message to the programming device for the first communication detection command, where the first response message is used to indicate that the chip is in a reset state and the chip is in good contact with the programming device; if the first response message for the first communication detection command is not returned to the programming device, so that the programming device determines the power supply mode of the chip; if it is determined that the power supply mode of the chip is powered by the programming device, controlling the chip to perform power-off and power-on processing based on an externally added fast power-down control circuit, the chip is restarted in the power-on window time, and the step of receiving the first communication detection command sent by the programming device is performed again within the power-on window time; if it is determined that the power supply mode of the chip is not powered by the programming device, the step of receiving the first communication detection command sent by the programming device is performed again; receiving the program burning process of the chip by the programming device; if it is a chip not powered by the programming device and the reset pin of the chip is not multiplexed, receiving a signal sent by the programming device and exiting the programming mode to return to the reset state; if it is a chip powered by the programming device and the reset pin of the chip is multiplexed, in the state of exiting the programming mode, timing the programming device to periodically send a second communication detection command to the chip, the chip restarts the reset window time, is in the reset state, and receives the second communication detection command and makes a response; in the state of not exiting the programming mode, when the chip does not send a feedback response message, so that the programming device performs a power-off process on the chip, powers on again and sends the second communication detection command to determine whether the chip has been removed; where the second communication detection command is used to instruct the chip to return a response message; if the second response message returned by the chip for the second communication detection command is not received, it is determined that the chip has been removed from the programming device; For a chip whose reset pin is multiplexed as a digital IO, the receiving the first communication detection command sent by the programming device includes: if the chip is in the power-on window time, receiving the first communication detection command sent by the programming device, where the power-on window time of the chip corresponds to the chip being in the reset state; After receiving the first communication detection command sent by the programming device, it further includes: waiting for the chip to be programmed to restart timing, where the timing is used to time the power-on window time of the chip.

7. A programming device, characterized in that, including: The first sending module is used to send a first communication detection command to the chip soldered on the system board, where the first communication detection command is used to instruct the chip to feedback an acknowledgement message; The first receiving module is used to receive the first acknowledgement message returned by the chip for the first communication detection command, where the first acknowledgement message is used to characterize that the chip is in a reset state and the chip is in good contact with the programming device; The program burning module is used to perform program burning processing on the chip; The first sending module is further used to, if the chip is not powered by the programming device and the reset pin of the chip is not multiplexed, send a signal to the chip to exit the programming mode and return to the reset state; If the chip is powered by the programming device and the reset pin of the chip is multiplexed, in the state of exiting the programming mode, the second communication detection command is periodically sent to the chip to enable the chip to restart the reset window time, so that the chip is in the reset state, and receive the second communication detection command and make an acknowledgement, where the second communication detection command is used to instruct the chip to feedback an acknowledgement message; in the state of not exiting the programming mode, when the chip does not feedback the acknowledgement information after sending the second communication detection command, power off the chip, power on again and send the second communication detection command to determine whether the chip has been removed; If the second acknowledgement message returned by the chip for the second communication detection command is not received, it is determined that the chip has been removed from the programming device; For the chip whose reset pin is multiplexed as a digital IO, the first sending module is specifically used to, during the power-on window time of the chip, circularly send the first communication detection command to the chip soldered on the system board, and the timer in the chip restarts timing to extend the power-on window time, where the power-on window time of the chip corresponds to the chip being in the reset state; If the first acknowledgement message returned by the chip for the first communication detection command is not received, the power supply mode of the chip is judged; If it is judged that the power supply mode of the chip is powered by the programming device, the chip is controlled to perform power-off and power-on processing based on an externally added fast power-off control circuit, so that the chip is again in the power-on window time, and the step of sending the first communication detection command to the chip soldered on the system board is performed again within the power-on window time; If it is judged that the power supply mode of the chip is not powered by the programming device, the step of sending the first communication detection command to the chip soldered on the system board is performed again.

8. A chip, characterized in that, The chip is soldered on the system board and includes: The second receiving module is used to receive the first communication detection command sent by the programming device, where the first communication detection command is used to instruct the chip to feedback an acknowledgement message; The second sending module is used to return the first acknowledgement message for the first communication detection command to the programming device, where the first acknowledgement message is used to characterize that the chip is in the reset state and the chip is in good contact with the programming device; A program receiving module, which is used to: if a first response message for the first communication detection command is not returned to the programming device, so that the programming device determines the power supply mode of the chip; if it is determined that the power supply mode of the chip is the programming device's power supply, based on an externally added fast power-off control circuit, control the chip to perform power-off and power-on processing, the chip restarts in the power-on window time, and in the power-on window time, execute the step of receiving the first communication detection command sent by the programming device again; if it is determined that the power supply mode of the chip is not the programming device's power supply, then execute the step of receiving the first communication detection command sent by the programming device again; Receive the program programming process of the programming device. If it is a chip powered by a non-programming device and the reset pin of the chip is not multiplexed, receive the signal sent by the programming device, exit the programming mode, and return to the reset state; if it is a chip powered by the programming device and the reset pin of the chip is multiplexed, in the state of exiting the programming mode, regularly make the programming device send a second communication detection command to the chip, the chip restarts the reset window time, is in the reset state, and receives the second communication detection command and makes a response; in the state of not exiting the programming mode, when the chip feedback response information is not sent, so that the programming device performs a power-off process on the chip, powers on again and sends the second communication detection command to determine whether the chip has been removed; wherein, the second communication detection command is used to instruct the chip to feedback a response message; if the second response message returned by the chip for the second communication detection command is not received, it is determined that the chip has been removed from the programming device; For a chip whose reset pin is multiplexed as a digital IO, the second receiving module is specifically used to: if the chip is in the power-on window time, receive the first communication detection command sent by the programming device, and wait for the programmed chip to restart timing, wherein, the power-on window time of the chip corresponds to the chip being in the reset state; the timing is used to time the power-on window time of the chip.

9. A chip programming system, characterized in that, It includes a programming device and a chip soldered on the system board; Wherein, the programming device is used to execute the method described in any one of claims 1-5; the chip is used to execute the method described in claim 6.

Citation Information

Patent Citations

  • Method and system for upgrading chip online

    CN103914308A

  • Program burning method, burning device and controller

    CN105045626A

  • Method for burning programs across STM32 single-chip microcomputers

    CN110045968A