Offline burning method and device, storage medium and program product
By dividing the target equipment into two parts and converting it into auxiliary burning equipment, using existing equipment to form a burning equipment group, the collaborative burning of multiple devices is achieved, and the problem of high cost and low efficiency in traditional offline burning methods is solved, which reduces the equipment production cost and improves the burning efficiency.
Patent Information
- Application Number
- CN202510567958.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-07-18
AI Technical Summary
In the traditional offline burning method, although using multiple offline burners can shorten the burning time, it increases the production cost of equipment and fails to effectively improve the burning efficiency.
The target equipment is divided into the first part and the second part. The first part of the equipment is converted into auxiliary burning equipment, and the original burning equipment and auxiliary burning equipment are used to form a burning equipment group. Through control logic, multiple devices are synergistic burning is realized to reduce the demand for additional burning equipment.
Without increasing the number of burners, the burning efficiency is improved, the equipment production cost is reduced, and the efficient operation of collaborative burning of multiple equipment is achieved.
Smart Images

Figure CN120335826A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data transmission, and particularly to an offline programming method, device, storage medium, and program product. Background Art
[0002] There are mainly two programming methods during mass production of devices: online programming and offline programming. Online programming requires connecting to a computer and manual operation in programming software, while offline programming only needs to connect an offline programmer to the device to complete automatically, and its stability is higher than that of online programming. Therefore, devices in large-scale mass production usually choose the offline programming method.
[0003] However, if only one offline programmer is used, the total programming time is relatively long; if multiple offline programmers are used for parallel programming, although the total programming time can be reduced, the number of offline programmers needed increases. Since the cost of offline programmers is relatively high, using multiple offline programmers will increase the production cost of the device. Summary of the Invention
[0004] The object of the present invention is to provide an offline programming method, device, storage medium, and program product. By using existing target devices for auxiliary programming, the need for additional programming devices can be reduced, the cost can be lowered, and the programming efficiency can be improved, solving the cost problem of increasing a large number of programmers to shorten the programming time in traditional offline programming methods.
[0005] To solve the above technical problems, the present invention provides an offline programming method, including: programming a first file of an original programming device to a first part of target devices among multiple target devices to convert the first part of target devices into auxiliary programming devices; the multiple target devices include the first part of target devices and a second part of target devices; the first file includes a target program to be programmed and control logic for programming the target program; using a programming device group to program the target program to the second part of target devices according to the control logic, the programming device group includes the original programming device and the auxiliary programming devices; using the original programming device and / or at least one auxiliary programming device to program the target program to all the auxiliary programming devices according to the control logic.
[0006] To solve the above technical problems, the present invention provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of the offline programming method as described above when executing the computer program.
[0007] To solve the above technical problems, the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the offline programming method as described above.
[0008] To solve the above technical problems, the present invention provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-mentioned offline programming method.
[0009] The present invention provides an offline programming method, device, storage medium and program product, relating to the field of data transmission. The offline programming method divides the target device into a first part and a second part, and converts the first part of the target device into an auxiliary programming device, thereby realizing collaborative programming of multiple devices; during the programming process, the first part of the target device is first programmed and converted into an auxiliary programming device, and then the original programming device and the auxiliary programming device jointly complete the programming of the second part of the target device. After the programming of the second part of the target device is completed, the original programming device and / or at least one auxiliary programming device continue to complete the programming of the auxiliary programming device. In this application, by using the existing target device for auxiliary programming, the need for additional programming devices can be reduced, the cost can be lowered, and the programming efficiency can be improved, solving the cost problem of the traditional offline programming method that requires adding a large number of programmers to shorten the programming time. Description of the Drawings
[0010] To more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0011] Figure 1 A schematic diagram of an offline programming device in the current technology;
[0012] Figure 2 A flowchart of an offline programming method provided by the present invention;
[0013] Figure 3 A schematic diagram of an offline programming device provided by the present invention;
[0014] Figure 4 A schematic diagram of the Flash space of a target device provided by the present invention;
[0015] Figure 5 A schematic diagram of the principle of converting a target program into a data table and an index table provided by the present invention;
[0016] Figure 6 A schematic diagram of the composition of a target program data table provided by the present invention;
[0017] Figure 7Schematic diagram of the composition of a target program data index table provided by the present invention;
[0018] Figure 8 Flowchart of the offline programming of a programmed target device provided by the present invention;
[0019] Figure 9 Flowchart of the offline programming of a programming device provided by the present invention;
[0020] Figure 10 Schematic diagram of a bootstrap program file provided by the present invention;
[0021] Figure 11 Schematic diagram of a bootstrap program data table provided by the present invention;
[0022] Figure 12 Schematic diagram of a target program provided by the present invention;
[0023] Figure 13 Schematic diagram of a target program data index table provided by the present invention;
[0024] Figure 14 Schematic diagram of a target program data table provided by the present invention;
[0025] Figure 15 Schematic diagram of the Flash space after offline programming provided by the present invention. Detailed implementation manners
[0026] The core of the present invention is to provide an offline programming method, device, storage medium and program product. By using an existing target device for auxiliary programming, the need for additional programming devices can be reduced, the cost can be lowered, and the programming efficiency can be improved, solving the cost problem of adding a large number of programmers to shorten the programming time in the traditional offline programming method.
[0027] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0028] As Figure 1 shown, if there are 4n target devices and an offline programmer 1 is used for offline programming (the offline programming time required for one target device is t), the total time required is 4nt; if the number of offline programmers is increased to 4, the total time required is nt. However, the cost of the offline programmers increases.
[0029] To solve the above technical problems, as Figure 2 shown, the present invention provides an offline programming method, including:
[0030] S11: Program the first file of the original programming device into the first part of the target devices among a plurality of target devices to convert the first part of the target devices into auxiliary programming devices; the plurality of target devices include the first part of the target devices and the second part of the target devices; the first file includes the target program to be programmed and the control logic for programming the target program.
[0031] Specifically, with the help of the original programming device, the first file integrating the target program to be programmed and the programming control logic is programmed into the first part of the target devices pre-divided among the plurality of target devices. Through this programming process, the first part of the target devices, which were originally only programming objects, acquire the programming control logic in the first file and thus have the auxiliary programming function, realizing the role conversion from simple target devices to auxiliary programming devices that can participate in the programming work, providing conditions for subsequently forming a programming device group with the original programming device and jointly executing the programming task for the second part of the target devices. The essence of this step is to build a programming system in which the original programming device and the target devices work together by activating the functions of the first part of the target devices, so as to reduce the dependence on additional dedicated programming devices.
[0032] Among them, it should be understood that the first file can be a file originally carried by the original programming device, so in the offline programming method of the present application, the original programming device can directly program the first file to the first part of the target devices. The first file can also be generated subsequently and stored in the original programming device after generation. Specifically, by integrating the target program to be programmed and the programming control logic into a single first file, the core functional code to be programmed into the target device (i.e., the target program) and the instruction set for implementing the programming operation (i.e., the programming control logic) are integrated to form a complete data carrier that can be recognized and executed by the programming device. Among them, the target program carries the final functional data required by the target device, and the control logic contains the operation rules for guiding the programming device to parse, transmit, and write the target program, such as key logics like data verification, address mapping, and timing control. The essence of generating the first file is to provide a composite data unit with both functionality and process guidance for the subsequent programming process, enabling the programming device to accurately program the target program into the target device according to the control logic in the first file in the subsequent steps, so as to ensure that the target device not only has the expected function after programming but also can realize extended capabilities such as auxiliary programming through the control logic, laying a data foundation for the construction of a multi-device collaborative programming system.
[0033] S12: Use a set of programming devices to program the target program into the second part of the target devices according to the control logic. The multiple target devices include the first part of the target devices and the second part of the target devices. The set of programming devices includes the original programming device and the auxiliary programming device.
[0034] After the conversion of the first part of the target devices to the auxiliary programming device is completed, the original programming device and the auxiliary programming device jointly serve as the set of programming devices. Based on the target program integrated in the first file and the programming control logic, through the collaborative work of multiple devices, the target program is batch-programmed into the second part of the target devices in a distributed manner.
[0035] This embodiment uses the auxiliary programming device to expand the programming function of the original programming device, forming a distributed programming execution system, enabling the set of programming devices to parallel-process the programming tasks of multiple second parts of the target devices, coordinating the working timings and data interactions of each device through the control logic, ensuring the accurate transmission and writing of the target program from the set of programming devices to the corresponding target devices, so as to improve the programming efficiency and optimize the configuration of programming resources by exploring the potential functions of the target devices themselves without relying on additional dedicated programming devices, and constructing an efficient programming architecture with the original device as the core and the auxiliary devices participating collaboratively.
[0036] It should be understood that the principle of the quantity division of the first part of the target devices and the second part of the target devices lies in, based on the parallel processing logic of the programming process, reasonably matching the quantities of the first part of the target devices (subsequently converted into auxiliary programming devices) and the second part of the target devices through an algorithm. The core principle at least needs to ensure that the total number of devices in the set of programming devices (the sum of the original programming device and the auxiliary programming device) does not exceed the number of the second part of the target devices, so as to avoid the idle of programming device resources, ensure that each programming device can correspond to at least one target device to be programmed, and thus give full play to the parallel efficiency advantage of the collaborative programming of multiple devices. Under this basic constraint, the specific grouping quantity can be dynamically optimized and adjusted according to actual production requirements (such as production capacity targets, device characteristics, process duration, etc.), such as achieving the matching balance between the scale of the set of programming devices and the number of target devices to be programmed through an algorithm model, maximizing the parallel programming ability under the premise of limited hardware resources, forming an elastic grouping strategy suitable for different production scenarios, and finally realizing the collaborative optimization of programming efficiency and resource utilization rate.
[0037] S13: Use the original programming device and / or at least one auxiliary programming device to program the target program into all the auxiliary programming devices according to the control logic.
[0038] Specifically, after completing the burning of the second part of the target devices, based on the phased planning of the burning process and the dynamic reuse of device functions, it is also necessary to use the original burning device and some of the auxiliary burning devices that have completed the auxiliary burning tasks to perform the supplementary burning operation of the target program on the first part of the target devices that assumed the auxiliary burning function in the early stage, so as to achieve the burning of all the target devices.
[0039] Specifically, although the first file burned by the auxiliary burning device in the early stage contains control logic to implement the auxiliary burning function, the complete burning of the final target program has not been completed. When the burning of the second part of the devices is completed and the resources of the burning device group are released, by reasonably allocating the remaining burning resources (the original burning device and / or at least one auxiliary burning device), the target program can be written into the auxiliary burning device according to the established control logic, so that it finally has the same target function as the second part of the devices, thus ensuring that all the target devices have completed the complete program burning.
[0040] It should be understood that here, using the original burning device and / or at least one auxiliary burning device to burn the target program for all the auxiliary burning devices according to the control logic can be divided into 3 cases (assuming the original burning device is numbered Y1, and there are 5 auxiliary burning devices, numbered F1, F2, F3, F4, F5 respectively):
[0041] The first case is: a separate original burning device can be used to sequentially burn the target program into each auxiliary burning device according to the control logic until the last auxiliary burning device completes the burning (that is, Y1 burns the target program for F1, F2, F3, F4, F5 in sequence).
[0042] The second case is: at least one auxiliary burning device can be used first to burn the target program into the remaining auxiliary burning devices according to the control logic, and then the auxiliary burning device or the original burning device that has completed the burning of the target program can be used to burn the target program for this at least one auxiliary burning device that has not completed the burning (for example, F1 burns the target program for F2, F3, F4, F5 in sequence, and then any one of Y1, F2, F3, F4, F5 is used to burn the target program for F1).
[0043] The third case is: to improve the burning speed, the original burning device and at least one auxiliary burning device can be used first to perform parallel burning on the remaining auxiliary burning devices, and then the auxiliary burning device and / or the original burning device that has completed the burning of the target program can be used to burn the target program for this at least one auxiliary burning device that has not completed the burning (for example, first use Y1, F1, F2 to burn the target program for F3, F4, F5 in parallel, and then use any two of Y1, F3, F4, F5 to burn the target program for F1, F2).
[0044] It can be seen that in this embodiment, by time-sharing and multiplexing the capabilities of the programming device group, without adding additional hardware resources, the function of the first part of the devices is complemented, ensuring the integrity of the entire batch programming process and the functional consistency of the target devices, which reflects the optimized configuration of programming resources and the task scheduling strategy at different stages.
[0045] Specifically, refer to Figure 3 . Still taking 4n target devices as an example, first use an offline programmer 1 to program the first file to the target devices 4n - 2, 4n - 1, and 4n. Then use these 4 as the programming device group to program the remaining 4n - 3 target devices. Not only does it not increase the number of offline programmers, but it can also improve the offline programming speed.
[0046] In an exemplary embodiment, the generation process of the first file includes: obtaining the bootloader file of the target device and generating a bootloader data table; screening the data that meets the conditions according to the identification information of each section of data in the target program and generating a target program data table; generating a target program data index table according to the identification information of each section of data in the target program data table; and performing compilation processing according to the bootloader data table, the target program data table, and the target program data index table to generate the first file.
[0047] In this embodiment, when generating the first file, the principle is to convert the control logic and target program data required for the programming process into a structured data carrier through a data processing and integration mechanism. Specifically, by establishing and compiling a bootloader project for the target device, a bootloader file containing programming control logic is generated, and then the bootloader file is parsed to extract key information and converted into a bootloader data table, so that the control logic exists in a data structure form recognizable by the target device. For the target program, according to the identification information of each section of data (such as data length, storage location, etc.), the valid data is screened to generate a target program data table and a target program data index table respectively. The target program data table carries the specific data content of the target program, and the target program data index table provides the index rules for data location and call. Finally, the above three types of data tables are integrated and compiled to form the first file containing the complete programming control logic and target program data, providing a composite information carrier with both process guidance and functional data for the subsequent programming process, ensuring that the programming device can execute the programming operation orderly according to the structured data therein, and realizing the function solidification of the target device and the implantation of control logic.
[0048] As Figure 4 shown, Figure 4Shows the occupancy of the Flash space in the first part of the target device. The first file Offline.hex includes the A offline programming module, the B bootloader data table of the target device (TargetBootTable[]), the C target program data table of the target device TargetHexTable[], where (the target program is Target.hex), and the D target program data index table of the target device (TargetHexIndexTable[]). Usually, the first file is smaller than the Flash space of the target device. That is Figure 4 There is still a part of the unused space D in the Falsh space.
[0049] In an exemplary embodiment, obtaining the bootloader file of the target device and generating a bootloader data table includes: removing the text start symbol and text end symbol from the bootloader file; converting the bootloader file after removing the text start symbol and text end symbol into a bootloader data table in units of the minimum storage space of the target device.
[0050] Specifically, the specific process of obtaining and parsing the bootloader file of the target device to generate a bootloader data table is as follows: First, remove the text start symbol and text end symbol from the bootloader file. This is because these symbols are usually auxiliary information added to meet file transfer or text editing specifications and have no practical significance for the target device to execute the programming control logic. Removing them can reduce redundant data and make the bootloader file more concise. Then, convert the bootloader file after removing the redundant symbols into a bootloader data table in units of the minimum storage space of the target device. This is because when the target device reads and processes data, it operates based on its minimum storage space as the basic unit. For example, when the target device is a DSP, its minimum storage space is word (2 bytes). Converting the bootloader into a one-dimensional bootloader data table in units of word can ensure that the data matches the hardware characteristics of the target device during storage and transmission, facilitating the device to accurately read and parse the control logic in the bootloader, thus ensuring that the programming process is executed smoothly according to the predetermined rules.
[0051] In this embodiment, in this way, the original bootloader file is converted into a structured data form suitable for the target device to process, providing a reliable data basis for subsequent programming operations.
[0052] In an exemplary embodiment, the identification information includes the data length and the starting address; according to the identification information of each segment of data in the target program, the data that meets the conditions is screened to generate a target program data table, including: screening valid data with non-empty addresses according to the data length and the starting address of each segment of data in the target program; generating a target program data table according to all the valid data; generating a target program data index table according to the identification information of each segment of data in the target program data table, including: extracting the data length and the starting address of each segment of valid data in the target program data table to generate a target program data index table.
[0053] Specifically, the principle of processing the target program data to generate the target program data table and the target program data index table lies in achieving efficient storage and convenient invocation of the target program through data screening and structured processing.
[0054] Specifically, first, according to the identification information (such as data length, starting address) of each segment of data in the target program, the valid data with non-empty addresses is screened out, and the invalid data segments that are not programmed are excluded, so as to eliminate redundant information, compress the data scale, save the data storage space of the target program and improve the transmission efficiency; then all the valid data is integrated to generate a target program data table, making it carry the core content of the target program in an ordered one-dimensional data structure.
[0055] On this basis, the starting address and the data length of each segment of valid data are further extracted as index key information (such as the starting address as the first column data of the index table, and the data length as the second column data of the index table), and a two-dimensional target program data index table is constructed. The target program data index table locates the starting position of the data segment in the storage space through the starting address and defines the range of the valid data segment through the length value, providing a structured index guidance for quickly searching, parsing and invoking the target program data during the burning process, ensuring that the burning device can accurately read and write the valid data according to the index rules, establishing an efficient data access mechanism while optimizing the data storage form, and laying a foundation for the accuracy and efficiency of subsequent burning operations.
[0056] Such as Figure 5 , shows multiple segments of data (specifically including valid data and skipped data), where the valid data refers to the continuous data with non-empty addresses, and the skipped data refers to the data segments where no data is written in the addresses. Using the method in this embodiment, the segments of all the valid data in Figure 5 are identified and combined into the form in Figure 6 . What is shown in Figure 6 is only one form of the target program data table. According to the starting address and the corresponding length of each segment of valid data in Figure 6 , they are extracted to form the two-dimensional target program data index table in Figure 7 for subsequent writing or retrieval.
[0057] In an exemplary embodiment, a programming device group is used to program a target program into a second part of target devices according to control logic, including: for each programming device in the programming device group, controlling the programming device to respond to a flag bit sent by a corresponding target device to be programmed, where the flag bit indicates that the target device to be programmed has been initialized according to a boot program data table. The programming device group includes at least two programming devices, and the programming device can be either an original programming device or an auxiliary programming device. The second part of target devices includes at least two target devices to be programmed; sending a target program data index table to the target devices to be programmed; in response to the target devices to be programmed receiving the target program data index table, sending a target program data table to the target devices to be programmed; in response to the target devices to be programmed receiving the target program data table, parsing the target program data table according to the target program data index table to obtain target program data, and writing the target program data into the target devices to be programmed to complete the programming of the target program.
[0058] Specifically, when controlling the programming device group to execute the target program programming, through a status coordination, data staged transmission, and structured parsing mechanism, data interaction and programming operations between the programming device and the target devices to be programmed are realized.
[0059] Specifically, the programming device group triggers the programming process based on the flag bit (a status signal indicating that the device initialization is completed) sent by the target device to be programmed, ensuring that the target device receives data in a ready state and avoiding invalid transmission; following the staged transmission strategy of "index first, then data", first sending a target program data index table to the target devices to be programmed to provide a positioning guide for subsequent data parsing; then, after confirming that the index table has been received, sending a target program data table carrying specific data content; finally, the programming device parses and reorganizes the target program data table according to the identification information of the start address and data length of the valid data recorded in the target program data index table, extracts the target program data, and writes it into the target device according to a predetermined address (the address offset of the data in each valid data segment).
[0060] In this embodiment, through this data processing method, it is ensured that the target program is solidified into the target device in an efficient and accurate manner, realizing the collaborative work between multiple programming devices and multiple target devices, and improving the batch processing efficiency while ensuring the programming reliability.
[0061] In addition, before controlling each programming device to respond to the flag bit sent by the corresponding target device to be programmed, it further includes: The target device enters the initialization process using its built-in startup program. By continuously monitoring whether it receives a preset baud rate signal (such as the specific identification data 0x41), it dynamically matches the communication rate of the programming device to ensure that the two establish a communication connection through the serial port at the same baud rate, solving the problem of automatic negotiation of communication parameters between different devices. After the communication link is established, the programming device transmits the bootloader data table to the target device. After receiving it, the target device parses and temporarily programs it into the RAM (Random Access Memory), and quickly activates the bootloader by means of memory loading, completing the initialization configuration from the hardware bottom layer to the programming control logic. When the bootloader initialization is completed, the target device feeds back the flag bit to the programming device as a status signal indicating its readiness, providing a startup condition for the subsequent formal programming of the target program. This process realizes the automatic transition of the target device from hardware startup to programming function readiness through communication negotiation triggered by signals, construction of a temporary execution environment through data loading, and process control of status feedback, ensuring that the programming device and the target device achieve status synchronization before data transmission, laying a foundation for subsequent efficient and accurate program programming.
[0062] In an exemplary embodiment, the identification information includes the data length and the starting address of each segment of data. Parsing the target program data table according to the target program data index table to obtain the target program data, and writing the target program data into the target device to be programmed to complete the programming of the target program, including: determining the data length value and the starting address of each segment of valid data in the target program data table according to the length value and the starting address of each segment of valid data in the target program data index table; the target program data includes all valid data; and writing each segment of valid data into the target device to be programmed in sequence according to the length value and the starting address of each segment of valid data.
[0063] Specifically, the method of parsing the target program data and writing it into the target device to be programmed is: realizing the precise parsing and reliable solidification of the target program through an index-driven data positioning mechanism and an ordered writing strategy.
[0064] Specifically, using the identification information such as the data length value and the starting address of each segment of valid data recorded in the target program data index table, establish the position mapping relationship of the valid data in the target program data table, so as to accurately locate and extract the corresponding valid data segment in the data table, ensuring that only the non-empty data area containing actual function code is processed, excluding invalid or unprogrammed redundant data; then, according to the address order and data length provided by the target program data index table, write each valid data segment into the target device to be programmed in sequence according to the physical address order of the storage space, so that the target program data can be accurately filled into the specified area of the device according to the preset storage logic.
[0065] In this embodiment, the control logic for positioning navigation and sequential writing is implemented through the target program data index table, constructing an accurate mapping from the data carrier to the storage space of the target device, which not only ensures the efficiency of data parsing but also the accuracy of program burning, providing a reliable data writing mechanism for the target device to finally achieve the expected function.
[0066] In an exemplary embodiment, writing the target program data to the target device to be burned includes: writing the target program data to the flash memory space of the target device to be burned; after the target device to be burned finishes receiving the target program data index table and before sending the target program data table to the target device to be burned, it further includes: erasing the flash memory space of the target device to be burned.
[0067] Specifically, when writing the target program data to the target device to be burned, after the target device to be burned finishes receiving the target program data index table and before officially receiving the target program data table, an erasing operation is performed on its flash memory space. This is because the flash memory storage characteristics determine that the original stored content needs to be cleared before writing new data to avoid residual data interfering with the new program and ensure that the storage area is in an initial writable state; in the erased flash memory space, the valid data in the target program data table is sequentially written into the corresponding storage areas according to the address and length information defined in the target program data index table, so that the target program is written into the flash of the target device in a standard format.
[0068] In this embodiment, through the standardized process of "erasing first and then writing" and combined with the address guidance of the target program data index table, it not only follows the physical operation characteristics of the flash memory device but also ensures the uniqueness and integrity of the target program data in the storage medium, providing a reliable hardware storage basis for the target device to accurately call the program function during subsequent operation.
[0069] In a specific embodiment, the process of the offline burning method is as follows:
[0070] 1. Generate the first file.
[0071] 1.1 Generate the bootloader data table: Establish the bootloader project of the target device, compile to generate the bootloader file; parse the bootloader file and remove the text start symbol and text end symbol; convert the bootloader file after removing the text start symbol and text end symbol into a bootloader data table with the minimum storage space of the target device as the unit. For example, when the target device is a DSP, the minimum storage space is word (2 bytes).
[0072] 1.2 Generate the target program data table: Based on the data lengths and starting addresses (identification information) of each segment of data in the target program, filter out the valid data with non-empty addresses. An empty address indicates unprogrammed data. Removing this unprogrammed data can save the data occupancy space of the target program. Generate the target program data table according to all the valid data.
[0073] 1.3 Generate the target program data index table: Based on the data lengths and starting addresses of each segment of valid data in the target program data table, generate the target program data index table. The specific method can be to extract the starting address of each continuous segment of valid data to form the first column of the index table, and extract the length value to form the second column of the index table, obtaining a two-dimensional target program data index table.
[0074] 1.4 Integrate and generate the first file: Generate the first file according to the boot program data table, the target program data table, and the target program data index table. This first file includes the target program to be burned and the control logic for burning this target program.
[0075] 2. Use the original burning device to burn the target program to the first part of the devices according to the control logic (as Figure 8 and Figure 9 shown. Figure 8 Described from the perspective of the target device to be burned, Figure 9 described from the perspective of the burning device).
[0076] 2.1 Target device startup and communication establishment: The target device initializes with its built-in startup program, waits and determines whether it receives a preset baud rate signal (such as 0x41); if not received, it continues to wait; if received, it automatically detects the baud rate and initializes the serial port to establish a communication connection between the target device and the burning device.
[0077] 2.2 Boot program burning and initialization: The burning device sends the boot program data table to the target device. After receiving the boot program data table, the target device parses it and burns it to the RAM. After the boot program data table is burned, it jumps to the boot program for boot program initialization. After the target device boot program initialization is completed, it sends a flag bit to the burning device.
[0078] 2.3 First file burning: The original burning device responds to the flag bit sent by the corresponding first part of the target devices, burns the first file to the first part of the multiple target devices, and converts this first part of the devices into auxiliary burning devices.
[0079] 3. Control the group of burning devices to burn the target program to the second part of the devices according to the control logic.
[0080] 3.1 Data Transmission Preparation: Control each programming device (the programming device group includes at least 2 programming devices) to respond to the flag bit sent by the corresponding target device to be programmed (the second part of the target devices includes at least 2 target devices to be programmed), and this flag bit indicates that the target device to be programmed has been initialized according to the bootloader data table.
[0081] 3.2 Data Transmission: Send the target program data index table to the target device to be programmed; in response to the target device to be programmed receiving the target program data index table completely; erase the flash memory space of the target device to be programmed; send the target program data table to the target device to be programmed. 3.3 Data Parsing and Writing: Determine the data length value and start address of each segment of valid data in the target program data table according to the data length value and start address of each segment of valid data in the target program data index table, and the target program data includes all valid data; write the target program data into the flash memory space of the target device to be programmed according to the length value and start address of each segment of valid data.
[0082] 4. After the programming of the second part of the devices is completed, perform the target program programming of the first part of the devices (auxiliary programming devices).
[0083] 4.1 Program the target program to the auxiliary programming devices through the original programming device and / or some auxiliary programming devices according to the control logic (such as cross-programming until all auxiliary programming devices complete the programming of the target program).
[0084] In the embodiment of another specific actual product (such as a DSP chip), it is recommended to compile the bootloader project of the device to be programmed to generate a bootloader file, such as Figure 10 shown; remove the text start symbol and text end symbol, and convert it into a one-dimensional bootloader data table in units of word (2 bytes), such as Figure 11 shown; the target program of the actual product is as Figure 12 shown, according to the principle as Figure 5 shown, convert Figure 12 into a two-dimensional target program data index table, such as Figure 13 shown; and convert it into a target program data table; such as Figure 14 shown. After importing Figure 11 , Figure 13 , Figure 14 into the offline programming program project, compile it into the first file offline.hex. After this first file is programmed into a certain individual of this product, this individual can be used as an offline programming device to perform offline programming on other individuals of this product. After other individuals complete the programming, the Flash data of its DSP is exported as Figure 15 shown. Figure 15 The Flash data shown is consistent with the data after programming with a commercial offline programmer.
[0085] In summary, the offline programming method divides the target device into a first part and a second part, and converts the first part of the target device into an auxiliary programming device, thus realizing collaborative programming of multiple devices. During the programming process, the first part of the target device is first programmed and converted into an auxiliary programming device, and then the original programming device and the auxiliary programming device jointly complete the programming of the second part of the target device. After the programming of the second part of the target device is completed, the original programming device and / or at least one auxiliary programming device continue to complete the programming of the first part of the target device. In this application, by using the existing target device for auxiliary programming, the need for additional programming devices can be reduced, the cost can be lowered, and the programming efficiency can be improved, solving the cost problem of adding a large number of programmers to shorten the programming time in the traditional offline programming method.
[0086] To solve the above technical problems, the present invention provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of the offline programming method as described above when executing the computer program.
[0087] For the introduction of the electronic device, please refer to the above embodiments, and the present application will not elaborate herein.
[0088] To solve the above technical problems, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the offline programming method as described above are implemented. For the introduction of the computer-readable storage medium, please refer to the above embodiments, and the present application will not elaborate herein.
[0089] To solve the above technical problems, the present invention provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the above offline programming method are implemented. For the introduction of the computer program product, please refer to the above embodiments, and the present application will not elaborate herein.
[0090] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
[0091] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An offline programming method, characterized in that, Including: Burn the first file of the original burning device to the first part of the target devices among multiple target devices to convert the first part of the target devices into auxiliary burning devices; The multiple target devices include the first part of the target devices and the second part of the target devices; the first file includes the target program to be burned and the control logic for burning the target program; Use a group of burning devices to burn the target program to the second part of the target devices according to the control logic, and the group of burning devices includes the original burning device and the auxiliary burning device; Use the original burning device and / or at least one auxiliary burning device to burn the target program to all the auxiliary burning devices according to the control logic.
2. The offline programming method according to claim 1, wherein The generation process of the first file includes: Obtain the boot program file of the target device and generate a boot program data table; Filter the data that meets the conditions according to the identification information of each segment of data in the target program to generate a target program data table; Generate a target program data index table according to the identification information of each segment of data in the target program data table; Perform compilation processing according to the boot program data table, the target program data table, and the target program data index table to generate the first file.
3. The offline programming method according to claim 2, wherein The identification information includes the data length and the starting address; filtering the data that meets the conditions according to the identification information of each segment of data in the target program to generate a target program data table includes: Filter the valid data with non-empty addresses according to the data length and starting address of each segment of data in the target program; Generate the target program data table according to all the valid data; Generating a target program data index table according to the identification information of each segment of data in the target program data table includes: Extract the data length and starting address of each segment of the valid data in the target program data table to generate the target program data index table.
4. The offline programming method according to claim 2, wherein Using a group of burning devices to burn the target program to the second part of the target devices according to the control logic includes: For each burning device in the group of burning devices, control the burning device to respond to the flag bit sent by the corresponding target device to be burned, and the flag bit indicates that the target device to be burned has been initialized according to the boot program data table. The group of burning devices includes at least 2 burning devices, and the burning device is any one of the original burning device and the auxiliary burning device. The second part of the target devices includes at least 2 target devices to be burned; Send the target program data index table to the target device to be burned; In response to the target device to be burned receiving the target program data index table, send the target program data table to the target device to be burned; In response to the target device to be burned receiving the target program data table, parse the target program data table according to the target program data index table to obtain the target program data, and write the target program data into the target device to be burned to complete the burning of the target program.
5. The offline programming method according to claim 4, wherein The identification information includes the data length and the starting address of each segment of data. Parsing the target program data table according to the target program data index table to obtain the target program data, and writing the target program data into the target device to be burned, including: Determining the length value and the starting address of each segment of valid data in the target program data table according to the length value and the starting address of each segment of valid data in the target program data index table; the target program data includes all the valid data; Sequentially writing each segment of the valid data into the target device to be burned according to the length value and the starting address of each segment of the valid data.
6. The offline programming method according to claim 4, wherein Writing the target program data into the target device to be burned includes: Writing the target program data into the flash memory space of the target device to be burned; Before sending the target program data table to the target device to be burned in response to the target device to be burned receiving the target program data index table, further including: Erasing the flash memory space of the target device to be burned.
7. The offline programming method according to any one of claims 2-6, characterized in that, Obtaining the boot program file of the target device and generating a boot program data table, including: Removing the text start symbol and the text end symbol from the boot program file; Converting the boot program file after removing the text start symbol and the text end symbol into a boot program data table with the minimum storage space of the target device as the unit.
8. An electronic device, characterized in that, Including: A memory for storing a computer program; A processor for implementing the steps of the offline burning method according to any one of claims 1-7 when executing the computer program.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the offline burning method according to any one of claims 1-7 are implemented.
10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the steps of the offline burning method according to any one of claims 1-7 are implemented.