Universal programming system
Patent Information
- Application Number
- CN202411588062.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-25
AI Technical Summary
以往的烧写系统功能比较单一,往往只是在烧写时,对烧写内容做了一个简单的验证和比较;但是,没有考虑到系统运行长时间以后,对flash中的软件内容做必要的监控和验证手段
[0005]本发明的目的在于提供一种通用烧写系统,它不仅能够灵活的增加或者删减软件烧写项;还能够在烧写的同时,在flash中记录下被烧写软件的具体信息,包括被烧写软件的版本号,配置项号以及crc校验值等;同时,还能方便的做烧写内容的第二次验证,根据获取到的被烧写软件的烧写地址和文件大小等信息,进行第二轮的crc值计算,如果第二次计算的crc值和之前记录在flash中的crc值等同,则视为当前的软件内容是正确的。
Smart Images

Figure CN119512806A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to electronic applications of embedded systems, and in particular to a universal burning system suitable for being mounted on an aircraft or a vehicle. Background Art
[0002] In embedded systems, the software carrier in the hardware needs to be updated from time to time due to demand changes or hardware modifications, so the burning system is essential in every embedded system. In the past, the burning system was generally based on serial port prompt information, plus Ethernet transmission of the burning content. The advantage of this is that it is simple and convenient; the disadvantage is that the burning content and address are generally defined in advance. If you need to temporarily increase the burning content, you need to re-divide and define the flash space, recompile the underlying BSP software, and then solidify or download the BSP software to the module for operation, which is more tedious and cumbersome.
[0003] In addition, the previous burning system usually just burns the software to be updated into the flash and that's it; some important information, such as the software version number and configuration item number, will not be recorded in the hardware flash. When you need to query the version information of the currently running software, you need to add a version reporting function to the software to parse it. This is not as simple and direct as directly burning the version information into the flash and then interpreting it.
[0004] When the system fails, in order to troubleshoot the problem, it is sometimes necessary to verify whether the software carrier content in the flash is correct. The previous burning system function is relatively simple, and often only a simple verification and comparison of the burning content is performed during burning; however, it does not take into account the necessary monitoring and verification of the software content in the flash after the system has been running for a long time. Summary of the invention
[0005] The purpose of the present invention is to provide a universal burning system, which can not only flexibly add or delete software burning items; but also can record the specific information of the burned software in a flash during burning, including the version number, configuration item number and CRC check value of the burned software; at the same time, it can also conveniently perform a second verification of the burned content, and perform a second round of CRC value calculation according to the acquired information such as the burning address and file size of the burned software. If the CRC value calculated for the second time is equal to the CRC value previously recorded in the flash, it is considered that the current software content is correct.
[0006] The present invention is achieved through the following technical solutions:
[0007] The general programming system is divided into two parts, including the PC-side software running on the PC and the module-side software residing on the main control module. The technical points are as follows:
[0008] 1. When burning software, the PC-side software obtains the file name, configuration item number, burning address and other information of the software to be burned by reading and parsing the local burning configuration information file, and then packages the software to be burned and the above information according to the communication protocol and sends them to the module-side software; after receiving the data packet, the module-side software burns the software to be burned in the flash according to different burning requirements and burning information.
[0009] 2. The PC software presents the burning tool interface, which is convenient for users to perform burning and verification operations.
[0010] 3. The module software supports flash address segment programming and file system programming.
[0011] 4. The module-side software makes an additional info information file with the version number, configuration item number and CRC check value of the software to be burned, and burns the info information file in the flash; when necessary, the module-side software parses the info information file for display, or sends it to the PC-side software for display.
[0012] 5. The module-side software creates an index of the info information file in the local flash space; the data in the info information file can be obtained through the index.
[0013] 6. The module-side software can calculate the CRC check value of the burned software. If the calculated CRC check value is equal to the CRC value recorded in the info information file, it is considered that the burning is successful or the software content is correct.
[0014] 7. The PC side uses pyqt5 for interface development, and python3 is used for underlying interaction; the module side software is developed in C language.
[0015] 8. The PC-side software is equipped with a TCP client, which sends a connection request to the TCP server on the module-side software; after the connection is established, the PC-side software assembles the data packet according to the defined communication protocol and sends the data packet to the module-side software via Ethernet; the module-side software is equipped with a TCP server, which responds to the connection request initiated by the PC-side client. After receiving the data packet sent by the PC, the module-side software will unpack it according to the communication protocol and perform different operations according to different command headers. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a general programming system block diagram.
[0017] Figure 2 This is the interaction diagram of the sub-functions of the PC software.
[0018] Figure 3 This is a diagram of the interaction relationship between the module-side software sub-functions.
[0019] Figure 4 This is a schematic diagram of the file to be burned.
[0020] Figure 5 This is the interface diagram of the PC-side burning tool software.
[0021] Figure 6 Tool interface after parsing the configuration information file
[0022] Figure 7 The tool interface diagram shows the programming process.
[0023] Figure 8 The tool interface diagram illustrates the verification process.
[0024] Fig. 9 Prints a schematic diagram for the module-side index table.
[0025] Fig.10 Prints a schematic diagram of the module-side file information. DETAILED DESCRIPTION
[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.
[0027] like Figure 1 As shown, a universal programming system shown in this embodiment is divided into two parts according to the resident location: PC-side software and module-side software. The two softwares transmit and receive data via Ethernet, and a simple communication protocol is designed based on the TCP / IP protocol to parse and encapsulate the transmitted and received data.
[0028] The PC software runs on a PC, uses pyqt5 for interface development, and uses python3 for underlying interaction design; the advantage of this is that the tool software written in python can be seamlessly used in many popular PC desktop operating systems today, such as windows, linux and ios.
[0029] The module-side software resides on the main control module and is developed in C language. Considering the commonality among multiple embedded operating systems, the design and coding should be compatible with the API interface functions provided by various embedded operating systems.
[0030] The PC-side software is equipped with a TCP client, which sends a connection request to the TCP server on the module-side software; after the connection is established, the PC-side software assembles the data packet according to the defined communication protocol and sends the data packet to the module-side software via Ethernet.
[0031] The module software establishes a TCP server and responds to the connection request initiated by the PC client. After receiving the data packet sent by the PC, the module software will unpack it according to the communication protocol and perform different operations according to different command headers.
[0032] When burning software, the PC-side software obtains the file name, configuration item number, burning address and other information of the software to be burned by reading and parsing the local burning configuration information file, and then sends the software to be burned and the above information to the module-side software after packaging according to the communication protocol. The PC-side software provides an interface for editing the local burning configuration information file. By editing the file name, configuration item number, burning address and other information of the software to be burned, the update of the software to be burned can be flexibly realized. After receiving the data packet, the module-side software burns the software to be burned in the flash according to different burning requirements and burning information; the module-side software supports flash address segment burning and file system burning.
[0033] In order to record the specific information of the software to be burned, the module software makes an additional info file with the version number, configuration item number and CRC check value of the software to be burned, and burns the info file in the flash. Every time the software is updated, the info file is updated synchronously, so that the version number, configuration item number and CRC check value of the latest software update can be obtained while parsing the info file.
[0034] At the same time, in order to effectively observe the info information file without the PC software, the module software also establishes an index of the info information file in the local flash space; through this index, the data in the info information file can be effectively obtained.
[0035] If you need to verify whether the software is correctly burned into the flash (or whether the software content in the flash has changed), the module-side software can calculate the CRC check value of the burned software based on the burning address and file size of the burned software; if the CRC check value is the same as the CRC value recorded in the info information file, it is considered that the burning is successful or the software content is correct.
[0036] like Figure 2As shown in the figure, the main functions of the PC software include: 1) Support parsing local burning configuration information files; 2) Establish TCP / IP protocol client; 3) Support receiving protocol data packets sent from the module end, and perform data parsing and sending and receiving; 4) Support displaying the local burning configuration information file name, its directory path, and the connection status between the client and the server; 5) Support finding the file written in the local configuration information file, and extract the version number information of the file from the file name; 6) Support displaying the burning information in the form of a table; 7) Support online editing of the local burning configuration information file , and supports online refreshing of the modified local burning configuration information file; 8) Supports two burning modes: flash address segment burning and file system path burning; 9) Supports real-time echo of information interacting with module-side software, and records and appends this information in the format of a text file; 10) Supports testing the network speed connected to the server; 11) Supports burning the info information file of the burned software according to the burning requirements; 12) Supports reading back the info information file burned in the flash last time, and displays whether the second calculated crc check value matches the previous value.
[0037] like Figure 3 As shown in the figure, the main functions of the module-side software include: 1) establishing a TCP / IP protocol server and waiting for the PC-side client to establish a communication connection; 2) receiving data packets sent from the PC and parsing them according to the communication protocol; 3) for software burning requirements, it will automatically verify whether the burning address and burning range are legal; 4) supporting burning software and the info information file of the software; 5) supporting reading the info information file, and recalculating the CRC check value of the burned software according to the burning address and file size in the info information file; 6) supporting the opening of an additional space in the flash for the index of the info information file; through the index, the data of the info information file can be obtained.
[0038] The overall programming process is as follows:
[0039] 1. Enter the command netTaskStart() in the serial port of the main control module to start the module software; this command will initialize the TCP server on the module software and wait for the TCP client on the PC software to establish a connection. On the PC, use the pyinstaller command to convert the PC code file Ui_fileprogTool_using.py into the executable file fileprogTool.exe in the Windows system.
[0040] 2.Put the software to be burned, the local burning configuration information file, and fileprogTool.exe in the same folder; Figure 4 As shown, the software to be burned include msl.bin, mp_os.bin, mp_os2.bin, kyland.bin, and dx_iom_upgrade.bin, etc.; the local burning configuration information file is iom.xml; fileprogTool.exe is the burning tool software converted by code compilation.
[0041] 3. Double-click to open fileprogTool.exe, such as Figure 5 As shown, in the displayed interface, click the "Open Local Configuration File" button and select the local burning configuration information file iom.xml.
[0042] Make sure to burn the configuration information file iom.xml locally. <serverinfo>The IP address in the label matches the module's IP address; and the PC has an IP address in the same network segment. If you need to change the local burning configuration information file, you can click the "Refresh local configuration information" button after saving the changes. At this time, the information displayed on the tool interface will also be refreshed. If the IP addresses at both ends match, the tool interface will be as follows Figure 6 show.
[0043] 4. If you need to burn software, click the selection box on the left of the software to be burned. A small check mark will be displayed after the click is successful. Then, click the "Send File" button, and the selected software will be sent to the module and burned correctly. Figure 7 As shown, the text box in the lower right corner will display the programming progress and feedback information from the module.
[0044] 5. If you need to verify whether the software is burned correctly, click the selection box on the left of the burned software. A small check mark will be displayed after clicking successfully; then, click the "Verify File" button, and the text box in the lower right corner will display the verification information fed back by the module.
[0045] like Figure 8 As shown in the figure, the PC software verifies the information of the burned file dx_iom_upgrade.bin; the text box in the lower right corner prints out the file name, file size, burning address, and new and old CRC values. It can be seen that the new and old CRC values are not equal, so this information is highlighted in red in the table.
[0046] 6. At the same time, the module software also supports querying and verifying the burning information. In the module serial port, enter the following command bspFileInfoShow, and the following will be displayed: Fig. 9 , Fig.10 Similar information as shown.
[0047] It is understandable that those skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention, and all these changes or substitutions should fall within the protection scope of the claims attached to the present invention.< / serverinfo>
Claims
1. A universal programming system, comprising PC-side software running on a PC and module-side software resident on a main control module, characterized in that: When burning software, the PC-side software obtains the file name, version number, configuration item number and burning address of the software to be burned by reading and parsing the local burning configuration information file, and then packages the software to be burned and the above information according to the communication protocol and sends them to the module-side software; after receiving the data packet, the module-side software burns the software to be burned in the flash according to different burning requirements and burning information.
2. A universal programming system according to claim 1, characterized in that: The PC software also provides a burning tool interface for users to perform burning and verification operations.
3. A universal programming system according to claim 1, characterized in that: The module software supports flash address segment programming and file system programming.
4. A universal programming system according to claim 1, characterized in that: After the module receives the data packet sent by the PC software, it will make an additional info file with the version number, configuration item number and CRC check value of the software to be burned, and then burn the info file in the flash; when necessary, the module software will parse the info file for display, or send it to the PC software for display.
5. A universal programming system according to claim 4, characterized in that: The module-side software also creates an index of the info information file in the local flash space; the data in the info information file can be obtained through the index.
6. A universal programming system according to claim 4, characterized in that: The module-side software also calculates the CRC check value of the burned software and compares the CRC check value with the CRC value recorded in the info information file. If they are equal, it is considered that the burning is successful or the software content is correct.
7. A universal programming system according to claim 1, characterized in that: The PC side uses pyqt5 for interface development, and python3 is used for underlying interaction; the module side software is developed in C language.
8. A universal programming system according to claim 1, characterized in that: The pc-side software is equipped with a TCP client, which sends a connection request to the TCP server on the module-side software; After the connection is established, the PC-side software assembles the data packets according to the defined communication protocol and sends the data packets to the module-side software via Ethernet; The module-side software is equipped with a TCP server to respond to the connection request initiated by the PC-side client; after receiving the data packet sent by the PC, the module-side software will unpack it according to the communication protocol and perform different operations according to different command headers.