Programming method, device and system of on-chip flash memory

The method of using multiple threads to parallelize the programming of on-chip flash memories in multiple chips addresses the slow update speed and error issues, achieving efficient and rapid programming.

CN119088427APending Publication Date: 2024-12-06CCORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411173534.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The programming and update speed of on-chip flash memory in multiple chips is slow and prone to errors, especially when updating multiple chips simultaneously.

Method used

A method involving a host computer that connects to multiple chips through a debugger using a debug interface, employing multiple download threads to write programs into the on-chip flash memories of these chips in parallel until the process is complete.

Benefits of technology

Enables fast and error-free programming of multiple on-chip flash memories by utilizing parallel processing through multiple threads, enhancing the programming speed and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088427A_ABST
    Figure CN119088427A_ABST
Patent Text Reader

Abstract

The invention discloses a programming method, device and system for an on-chip flash memory, which are applied to the technical field of on-chip flash memories and applied to an upper computer, and comprises the following steps: determining a plurality of downloading threads to be used; the upper computer is connected with a plurality of to-be-debugged chips through a debugger, the to-be-debugged chips are provided with on-chip flash memories, and the debugger is connected with the to-be-debugged chips through a debugging interface; based on the debugging interface, writing the to-be-upgraded program into the on-chip flash memories in the plurality of to-be-debugged chips in parallel through the plurality of downloading threads until the to-be-upgraded program is written into the on-chip flash memories in all the to-be-debugged chips; and after the to-be-upgraded program is written into the on-chip flash memories in all the to-be-debugged chips, ending the on-chip flash memory programming process. The on-chip flash memory is programmed by using the debugging interface through the upper computer, and the interface is high in downloading speed and can realize an automatic downloading function; and a plurality of on-chip flash memories can be programmed in parallel by using a plurality of threads, so that the on-chip flash memories of a plurality of chips can be quickly programmed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of on-chip flash memory, and in particular to an on-chip flash memory programming method, an on-chip flash memory programming device and an on-chip flash memory programming system. Background Art

[0002] Chips are commonly used as control devices for electronic devices. When working, they need to cooperate with the use of flash memory to store and call data. Compared with external memory, the programming and program update speed of built-in flash memory, i.e. on-chip flash memory, is slow, especially when updating the on-chip flash memory of multiple chips, the speed is even slower and prone to errors. Therefore, how to provide a fast-reading solution for programming the on-chip flash memory of multiple chips is an urgent problem that technicians in this field need to solve. Summary of the invention

[0003] An object of the present invention is to provide a method for programming an on-chip flash memory, which can quickly program the on-chip flash memories of multiple chips; another object of the present invention is to provide an on-chip flash memory programming device and an on-chip flash memory programming system, which can quickly program the on-chip flash memories of multiple chips.

[0004] In order to solve the above technical problems, the present invention provides a method for programming an on-chip flash memory, which is applied to a host computer and comprises:

[0005] Determine multiple download threads to be used; the host computer is connected to multiple chips to be debugged through a debugger, the chips to be debugged have on-chip flash memory, and the debugger is connected to the chips to be debugged through a debug interface;

[0006] Based on the debugging interface, writing the program to be upgraded into the on-chip flash memories of the multiple chips to be debugged in parallel through the multiple download threads until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged;

[0007] After the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged, the on-chip flash memory programming process is terminated.

[0008] Optionally, the number of the download threads is equal to the number of the chips to be debugged, and the download threads correspond to the chips to be debugged one by one.

[0009] Optionally, determining multiple download threads to be used includes:

[0010] Determine the number of chips to be debugged;

[0011] A plurality of download threads are established according to the number of the chips to be debugged; and the download threads correspond one to one with the chips to be debugged.

[0012] Optionally, the host computer is connected to a plurality of the debuggers, and each of the debuggers is connected to a plurality of the chips to be debugged.

[0013] Optionally, before writing the to-be-upgraded program into the on-chip flash memories of the multiple to-be-debugged chips in parallel through the multiple download threads based on the debug interface, the method further includes:

[0014] Download the burning code corresponding to the program to be upgraded based on the debugging service program.

[0015] Optionally, ending the on-chip flash memory programming process includes:

[0016] Detect whether the on-chip flash memory in each of the chips to be debugged has been written with the program to be upgraded.

[0017] Optionally, after detecting whether the on-chip flash memory in each of the chips to be debugged has been written with the program to be upgraded, the method further includes:

[0018] When the test passes, a completion message pops up.

[0019] Optionally, the debug interface is a swd debug interface or a jtag debug interface.

[0020] The present invention also provides a programming device for an on-chip flash memory, which is applied to a host computer and comprises:

[0021] A download thread module is used to determine multiple download threads to be used; the host computer is connected to multiple chips to be debugged through a debugger, the chips to be debugged have on-chip flash memory, and the debugger is connected to the chips to be debugged through a debug interface;

[0022] An update module, used for writing the program to be upgraded into the on-chip flash memory of the plurality of chips to be debugged in parallel through the plurality of download threads based on the debug interface, until the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged;

[0023] The ending module is used to end the on-chip flash memory programming process after the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged.

[0024] The present invention also provides a device including a host computer, a debugger and a plurality of chips to be debugged, wherein the host computer is connected to the plurality of chips to be debugged via the debugger, the chips to be debugged have an on-chip flash memory, and the debugger is connected to the chips to be debugged via a debugging interface;

[0025] The host computer is used for:

[0026] determining a plurality of download threads to be used;

[0027] Based on the debugging interface, writing the program to be upgraded into the on-chip flash memories of the multiple chips to be debugged in parallel through the multiple download threads until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged;

[0028] After the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged, the on-chip flash memory programming process is terminated.

[0029] The invention provides an on-chip flash memory programming method, which is applied to a host computer and comprises: determining a plurality of download threads to be used; the host computer is connected to a plurality of chips to be debugged through a debugger, the chips to be debugged have on-chip flash memories, and the debugger is connected to the chips to be debugged through a debug interface; based on the debug interface, writing a program to be upgraded in parallel through a plurality of download threads into the on-chip flash memories of the plurality of chips to be debugged, until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged; after the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged, ending the on-chip flash memory programming process.

[0030] The on-chip flash memory is programmed through the debugging interface of the host computer. The interface has a fast download speed and can realize the automatic download function; and multiple threads can be used to program multiple on-chip flash memories in parallel, which can realize fast programming of the on-chip flash memories of multiple chips.

[0031] The present invention also provides an on-chip flash memory programming device and an on-chip flash memory programming system, which also have the above-mentioned beneficial effects and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] FIG1 is a flow chart of a method for programming an on-chip flash memory provided by an embodiment of the present invention;

[0034] FIG2 is a flowchart of a specific on-chip flash memory programming method provided by an embodiment of the present invention;

[0035] FIG3 is a structural block diagram of a device for programming an on-chip flash memory provided by an embodiment of the present invention;

[0036] Figure 4 The present invention provides a structural block diagram of an on-chip flash memory programming system. DETAILED DESCRIPTION

[0037] The core of the present invention is to provide a method for programming on-chip flash memory. In the prior art, the on-chip flash memory of most chips is currently programmed mainly through the bootloader, which needs to open the Uart and other communication interfaces first, and update the code to be downloaded to the on-chip flash memory through the Uart and other serial communication interfaces. However, this method has a slow update speed, especially when updating the on-chip flash memory of multiple chips, the speed is even slower and prone to errors.

[0038] The present invention provides an on-chip flash memory programming method, which is applied to a host computer and includes: determining multiple download threads to be used; the host computer is connected to multiple chips to be debugged through a debugger, the chips to be debugged have on-chip flash memories, and the debugger is connected to the chips to be debugged through a debug interface; based on the debug interface, the program to be upgraded is written into the on-chip flash memories of the multiple chips to be debugged in parallel through multiple download threads until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged; after the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged, the on-chip flash memory programming process is terminated.

[0039] The on-chip flash memory is programmed through the debugging interface of the host computer. The interface has a fast download speed and can realize the automatic download function; and multiple threads can be used to program multiple on-chip flash memories in parallel, which can realize fast programming of the on-chip flash memories of multiple chips.

[0040] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0041] Embodiment 1

[0042] Please refer to FIG. 1 , which is a flow chart of a method for programming an on-chip flash memory provided by an embodiment of the present invention.

[0043] Referring to FIG. 1 , in an embodiment of the present invention, a method for programming an on-chip flash memory includes:

[0044] S101: Determine a plurality of download threads to be used.

[0045] In this embodiment, the host computer is connected to a plurality of chips to be debugged via a debugger, the chips to be debugged have on-chip flash memory, and the debugger is connected to the chips to be debugged via a debugging interface.

[0046] The method provided in this embodiment is specifically applied to a host computer, and the host computer is connected to a debugger, and the debugger is connected to multiple chips to be debugged. Usually, in this embodiment, a burning board is set for each chip to be debugged, and the above-mentioned debugger is connected to each chip to be debugged through each burning board. The debugger is specifically connected to the chip to be debugged through a debugging interface, and the debugging interface is usually a swd debugging interface or a jtag debugging interface. The corresponding debugger needs to be a corresponding debugger, such as a swd debugger or a jtag debugger. In this embodiment, the host computer and the debugger are usually connected through a common interface such as a USB interface.

[0047] Specifically, in this embodiment, the host computer may be connected to a plurality of the debuggers, and each of the debuggers may be connected to a plurality of the chips to be debugged, so that the host computer may be connected to a greater number of chips to be debugged.

[0048] In this step, the host computer needs to first determine multiple threads as download threads, and the program in the on-chip flash memory will be burned based on the download threads in the subsequent steps. The thread can be a pre-established thread or a temporarily established thread, which is not specifically limited here.

[0049] S102: Based on the debugging interface, the program to be upgraded is written into the on-chip flash memories of the multiple chips to be debugged in parallel through multiple download threads, until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged.

[0050] In this step, the program to be upgraded will be written into the on-chip flash memory of the chip to be debugged based on the debugging interface used to communicate with the chip to be debugged. Specifically, this process will be executed in parallel through the above-mentioned multiple download threads, thereby realizing simultaneous programming of the on-chip flash memory programs in multiple chips to be debugged.

[0051] The above-mentioned program to be upgraded is usually the code downloaded in advance in the host computer. The host computer is usually provided with a debugging service program in the flash.bin format. The host computer can specifically download the required program to be upgraded as the burning code based on the debugging service program. The host computer usually also needs to be able to drive the debugger, and finally burn the program to be upgraded into the on-chip flash memory of the chip to be debugged through the burning board.

[0052] Preferably, in this embodiment, the number of the download threads can be equal to the number of the chips to be debugged, and the download threads correspond to the chips to be debugged one by one. At this time, in this step, each download thread only needs to execute one round of on-chip flash memory programming process for the corresponding chip to be debugged, and the program to be upgraded can be written into the on-chip flash memory of all the chips to be debugged, completing the burning of the on-chip flash memory program in all the chips to be debugged.

[0053] S103: After the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged, the on-chip flash memory programming process is terminated.

[0054] In this step, the above-mentioned process of programming the on-chip flash memory is required to complete the burning of the on-chip flash memory program in the chip to be debugged.

[0055] A method for programming an on-chip flash memory provided in this embodiment uses a debugging interface to program the on-chip flash memory through a host computer. The interface has a fast download speed and can realize an automated download function. Multiple on-chip flash memories can be programmed in parallel using multiple threads, which can realize fast programming of the on-chip flash memories of multiple chips.

[0056] The specific contents of the programming method of the on-chip flash memory provided by the present invention will be described in detail in the following embodiments of the invention.

[0057] Embodiment 2

[0058] Please refer to FIG. 2 , which is a flowchart of a specific on-chip flash memory programming method provided by an embodiment of the present invention.

[0059] Referring to FIG. 2 , in an embodiment of the present invention, a method for programming an on-chip flash memory includes:

[0060] S201: Determine the number of chips to be debugged.

[0061] In this step, the host computer needs to determine the number of all chips to be debugged so that a download thread can be established according to the number in subsequent steps.

[0062] S202: Establish multiple download threads according to the number of chips to be debugged.

[0063] In this embodiment, the download threads correspond to the chips to be debugged one by one. In this step, the same number of download threads will be established according to the number of the chips to be debugged, so that the download threads correspond to the chips to be debugged one by one, so that the subsequent download threads only need to program the on-chip flash memory of the corresponding chips to be debugged.

[0064] S203: Download the burning code corresponding to the program to be upgraded based on the debugging service program.

[0065] In this step, the host computer needs to download the burning code corresponding to the program to be upgraded based on the debugging service program flash.bin, so as to subsequently burn the program to be upgraded to the on-chip flash memory of the chip to be debugged.

[0066] S204: Based on the debugging interface, the program to be upgraded is written into the on-chip flash memories of the multiple chips to be debugged in parallel through multiple download threads, until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged.

[0067] This step is basically the same as S102 in the above embodiment. Please refer to the above invention embodiment for details, which will not be described again here.

[0068] S205: Detect whether the on-chip flash memory in each chip to be debugged has been written with the program to be upgraded.

[0069] In this step, the host computer can detect through the debugging interface whether the on-chip flash memory in each chip to be debugged has completed writing the above-mentioned program to be upgraded, so as to determine whether the on-chip flash memory programming process has been completed.

[0070] S206: When the detection is passed, a completion message pops up.

[0071] In this step, when it is detected that the on-chip flash memory in each chip to be debugged has been written with the program to be upgraded, a completion message will pop up in the host computer to remind the operator that the on-chip flash memory programming process has been completed. The above completion message can be specifically reminded in the form of a pop-up window, bubble, etc., and its specific form is not specifically limited in this embodiment.

[0072] The present embodiment provides a method for programming an on-chip flash memory, which first checks the number of chips to be debugged and then establishes one-to-one corresponding download threads, so that each download thread only needs to execute one round of on-chip flash memory programming process for the corresponding chip to be debugged to complete the burning without occupying too much resources of the host computer.

[0073] Embodiment 3

[0074] A programming device for an on-chip flash memory provided by an embodiment of the present invention is introduced below. The programming device for the on-chip flash memory described below and the programming method for the on-chip flash memory described above can be referred to each other.

[0075] FIG3 is a structural block diagram of a programming device for an on-chip flash memory provided by an embodiment of the present invention. Referring to FIG3 , the programming device for the on-chip flash memory is specifically installed in a host computer, and may include:

[0076] The download thread module 100 is used to determine multiple download threads to be used; the host computer is connected to multiple chips to be debugged through a debugger, the chips to be debugged have on-chip flash memory, and the debugger is connected to the chips to be debugged through a debug interface;

[0077] The update module 200 is used to write the program to be upgraded into the on-chip flash memory of the plurality of chips to be debugged in parallel through the plurality of download threads based on the debug interface until the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged;

[0078] The ending module 300 is used to end the on-chip flash memory programming process after the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged.

[0079] Preferably, in an embodiment of the present invention, the number of the download threads is equal to the number of the chips to be debugged, and the download threads correspond one-to-one to the chips to be debugged.

[0080] Preferably, in an embodiment of the present invention, the download thread module 100 includes:

[0081] A quantity determination unit, used to determine the quantity of chips to be debugged;

[0082] The thread establishment unit is used to establish multiple download threads according to the number of the chips to be debugged; the download threads correspond to the chips to be debugged one by one.

[0083] Preferably, in an embodiment of the present invention, the host computer is connected to a plurality of the debuggers, and each of the debuggers is connected to a plurality of the chips to be debugged.

[0084] Preferably, in the embodiment of the present invention, it also includes:

[0085] The code download module is used to download the burning code corresponding to the program to be upgraded based on the debugging service program.

[0086] Preferably, in the embodiment of the present invention, the ending module 300 is specifically used for:

[0087] Detect whether the on-chip flash memory in each of the chips to be debugged has been written with the program to be upgraded.

[0088] Preferably, in the embodiment of the present invention, the ending module 300 further includes:

[0089] The completion information unit is used to pop up the completion information when the detection passes.

[0090] Preferably, in an embodiment of the present invention, the debugging interface is a swd debugging interface or a jtag debugging interface.

[0091] The on-chip flash memory programming device of this embodiment is used to implement the aforementioned on-chip flash memory programming method. Therefore, the specific implementation method of the on-chip flash memory programming device can be seen in the embodiment part of the on-chip flash memory programming method in the previous text. For example, the download thread module 100, the update module 200, and the end module 300 are respectively used to implement steps S101 to S103 in the above-mentioned on-chip flash memory programming method. Therefore, its specific implementation method can refer to the description of the corresponding various partial embodiments and will not be repeated here.

[0092] Embodiment 4

[0093] A system for programming an on-chip flash memory provided by an embodiment of the present invention is introduced below. The system for programming the on-chip flash memory described below and the method for programming the on-chip flash memory described above can refer to each other.

[0094] Figure 4 A structural block diagram of a programming system for an on-chip flash memory provided by an embodiment of the present invention, referring to Figure 4 The on-chip flash memory programming system may include a host computer, a debugger, and a plurality of chips to be debugged, wherein the host computer is connected to the plurality of chips to be debugged via the debugger, the chips to be debugged have on-chip flash memory, and the debugger is connected to the chips to be debugged via a debug interface;

[0095] The host computer is used for:

[0096] determining a plurality of download threads to be used;

[0097] Based on the debugging interface, writing the program to be upgraded into the on-chip flash memories of the multiple chips to be debugged in parallel through the multiple download threads until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged;

[0098] After the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged, the on-chip flash memory programming process is terminated.

[0099] Preferably, in an embodiment of the present invention, the number of the download threads is equal to the number of the chips to be debugged, and the download threads correspond one-to-one to the chips to be debugged.

[0100] Preferably, in the embodiment of the present invention, the host computer is used for:

[0101] Determine the number of chips to be debugged;

[0102] A plurality of download threads are established according to the number of the chips to be debugged; and the download threads correspond one to one with the chips to be debugged.

[0103] Preferably, in an embodiment of the present invention, the host computer is connected to a plurality of the debuggers, and each of the debuggers is connected to a plurality of the chips to be debugged.

[0104] Preferably, in the embodiment of the present invention, the host computer is used for:

[0105] Download the burning code corresponding to the program to be upgraded based on the debugging service program.

[0106] Preferably, in the embodiment of the present invention, the host computer is used for:

[0107] Detect whether the on-chip flash memory in each of the chips to be debugged has been written with the program to be upgraded.

[0108] Preferably, in the embodiment of the present invention, the host computer is used for:

[0109] When the test passes, a completion message pops up.

[0110] Preferably, in an embodiment of the present invention, the debugging interface is a swd debugging interface or a jtag debugging interface.

[0111] The on-chip flash memory programming system of the present embodiment is used to implement the aforementioned on-chip flash memory programming method. Therefore, the specific implementation method of the on-chip flash memory programming system can be seen in the implementation method part of the on-chip flash memory programming method in the previous text. Therefore, its specific implementation method can refer to the description of the corresponding various parts of the implementation method and will not be repeated here.

[0112] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0113] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0114] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0115] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0116] The above is a detailed introduction to the programming method, device and system of an on-chip flash memory provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A method for programming an on-chip flash memory, characterized in that: Applied to the host computer, including: Determine multiple download threads to be used; the host computer is connected to multiple chips to be debugged through a debugger, the chips to be debugged have on-chip flash memory, and the debugger is connected to the chips to be debugged through a debug interface; Based on the debugging interface, writing the program to be upgraded into the on-chip flash memories of the multiple chips to be debugged in parallel through the multiple download threads until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged; After the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged, the on-chip flash memory programming process is terminated.

2. The method according to claim 1, characterized in that The number of the download threads is equal to the number of the chips to be debugged, and the download threads correspond to the chips to be debugged one by one.

3. The method according to claim 2, characterized in that Determining the multiple download threads to be used includes: Determine the number of chips to be debugged; A plurality of download threads are established according to the number of the chips to be debugged; and the download threads correspond one to one with the chips to be debugged.

4. The method according to claim 2, characterized in that: The host computer is connected to a plurality of the debuggers, and each of the debuggers is connected to a plurality of the chips to be debugged.

5. The method according to claim 1, characterized in that Before writing the to-be-upgraded program into the on-chip flash memory of the plurality of to-be-debugged chips in parallel through the plurality of download threads based on the debug interface, the method further includes: Download the burning code corresponding to the program to be upgraded based on the debugging service program.

6. The method according to claim 1, characterized in that The process of ending the on-chip flash programming includes: Detect whether the on-chip flash memory in each of the chips to be debugged has been written with the program to be upgraded.

7. The method according to claim 6, characterized in that After detecting whether the on-chip flash memory in each of the chips to be debugged has been written with the program to be upgraded, the method further includes: When the test passes, a completion message pops up.

8. The method according to claim 1, characterized in that The debugging interface is a swd debugging interface or a jtag debugging interface.

9. A device for programming an on-chip flash memory, characterized in that: Applied to the host computer, including: A download thread module is used to determine multiple download threads to be used; the host computer is connected to multiple chips to be debugged through a debugger, the chips to be debugged have on-chip flash memory, and the debugger is connected to the chips to be debugged through a debug interface; An update module, used for writing the program to be upgraded into the on-chip flash memory of the plurality of chips to be debugged in parallel through the plurality of download threads based on the debug interface, until the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged; The ending module is used to end the on-chip flash memory programming process after the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged.

10. A system for programming an on-chip flash memory, characterized in that: It includes a host computer, a debugger and a plurality of chips to be debugged, wherein the host computer is connected to the plurality of chips to be debugged via the debugger, the chips to be debugged have an on-chip flash memory, and the debugger is connected to the chips to be debugged via a debugging interface; The host computer is used for: determining a plurality of download threads to be used; Based on the debugging interface, writing the program to be upgraded into the on-chip flash memories of the multiple chips to be debugged in parallel through the multiple download threads until the program to be upgraded is written into the on-chip flash memories of all the chips to be debugged; After the program to be upgraded is written into the on-chip flash memory of all the chips to be debugged, the on-chip flash memory programming process is terminated.