Firmware burning method, device and computer readable storage medium

By splitting the firmware into small pieces and compressing them for burning, the problem of low burning efficiency of existing firmware is solved and a faster burning process is achieved.

CN111722852BActive Publication Date: 2024-10-25MAXEYE SMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010523241.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-10
Publication Date
2024-10-25
Estimated Expiration
2040-06-10

AI Technical Summary

Technical Problem

The existing firmware burning method has low burning efficiency, mainly because the GUI firmware occupies a large amount of memory, resulting in a long burning time.

Method used

Split the flash firmware to be burned into sub-firmwares of preset sizes, compress and package them, transfer them to the lower computer, decompress and burn them to improve burning efficiency.

Benefits of technology

By quickly burning the firmware after splitting and compressing it, the efficiency of firmware burning is significantly improved and the memory usage and burning time are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111722852B_ABST
    Figure CN111722852B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for burning firmware, a device and a computer-readable storage medium, the steps of which include: splitting the flash firmware corresponding to the firmware to be burned according to a preset firmware size to obtain the flash sub-firmware corresponding to the flash firmware; compressing the flash sub-firmware to obtain the compressed files corresponding to each flash sub-firmware, packaging the compressed files to obtain the burning files, and transmitting the burning files to a lower computer, so that the lower computer can decompress the burning files, and burn the decompressed burning files into the flash. The present invention realizes the improvement of the burning efficiency of the firmware by splitting the flash firmware corresponding to the firmware to be burned according to the preset firmware size, compressing the split flash sub-firmware, and then packaging the compressed files to obtain the burning files, and then transmitting the burning files to the lower computer, so that the lower computer can decompress the burning files, and burn the decompressed burning files into the flash.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip burning technology, and in particular to a firmware burning method, device, equipment and computer-readable storage medium. Background Art

[0002] At present, the firmware burning method is mainly developed based on TouchGFX (GUI framework). Since the GUI (Graphical User Interface) firmware occupies a large amount of memory, it takes a long time to burn the firmware, thereby reducing the efficiency of firmware burning. Therefore, it can be seen that the burning efficiency of the existing firmware burning method is low. Summary of the invention

[0003] The main purpose of the present invention is to provide a firmware burning method, device and computer-readable storage medium, aiming to solve the technical problem of low burning efficiency of the existing firmware burning method.

[0004] To achieve the above object, the present invention provides a method for burning firmware, which is applied to a host computer and comprises the following steps:

[0005] Splitting the flash firmware corresponding to the firmware to be burned according to the preset firmware size to obtain the flash sub-firmware corresponding to the flash firmware;

[0006] The flash sub-firmware is compressed to obtain compressed files corresponding to each of the flash sub-firmwares, the compressed files are packaged to obtain burning files, and the burning files are transmitted to the lower computer so that the lower computer can decompress the burning files and burn the decompressed burning files into the flash.

[0007] Optionally, the step of compressing the flash sub-firmware to obtain compressed files corresponding to each of the flash sub-firmware, and packaging the compressed files to obtain the burning files includes:

[0008] Compressing each of the flash sub-firmware according to the firmware redundancy, and obtaining a corresponding compressed file of each of the flash sub-firmware;

[0009] The file header identifier is obtained, and the file header identifier and the compressed file are packaged to obtain the burning file.

[0010] To achieve the above object, the present invention provides a method for burning firmware, which is applied to a lower computer and comprises the following steps:

[0011] After detecting a receiving instruction for receiving a burning file, receiving the burning file sent by the host computer according to the receiving instruction, wherein the burning file is obtained by splitting, compressing and packaging the burning file by the host computer;

[0012] Decompress the burning files in sequence to obtain decompressed files corresponding to each flash sub-firmware, and burn the decompressed files to the flash in sequence.

[0013] Optionally, the step of decompressing the burning files in sequence to obtain decompressed files corresponding to each flash sub-firmware, and burning the decompressed files to the flash in sequence includes:

[0014] Detecting whether the burning file is in a complete state;

[0015] If it is detected that the burning file is in a complete state, the burning file is decompressed in sequence to obtain a decompressed file of the burning file, and the decompressed file is burned to the flash in sequence.

[0016] Optionally, the step of detecting whether the burning file is in a complete state comprises:

[0017] Obtaining a first verification code before the burning file is transmitted and a second verification code after the burning file is transmitted, and detecting whether the first verification code and the second verification code are the same;

[0018] If it is detected that the first verification code and the second verification code are different, determining that the burning file is in a defective state;

[0019] If it is detected that the first verification code is the same as the second verification code, it is determined that the burning file is in a complete state.

[0020] Optionally, if it is detected that the burning file is in a complete state, the burning file is sequentially decompressed to obtain a decompressed file of the burning file, and the decompressed file is sequentially burned to the flash, the step includes:

[0021] If it is detected that the burning file is in a complete state, obtaining the file index value corresponding to each compressed file in the burning file;

[0022] The compressed files are decompressed in sequence according to the file index values ​​from small to large, to obtain decompressed files corresponding to the compressed files, and the decompressed files are burned to the flash in sequence.

[0023] Optionally, after the receiving instruction for receiving the burning file is detected, before the step of receiving the burning file sent by the host computer according to the receiving instruction, the method further includes:

[0024] Detecting whether a static random access memory SRAM program sent by the host computer is received;

[0025] If it is detected that the SRAM program has been received, the lower computer is started through the SRAM program, and the starting of the lower computer includes initializing the lower computer hardware, receiving the burning file, decompressing the burning file, detecting the integrity of the burning file, and / or burning the decompressed file.

[0026] In addition, to achieve the above-mentioned purpose, the present invention also provides a firmware burning device, which includes a memory, a processor, and a firmware burning program stored in the memory and running on the processor, and when the firmware burning program is completed by the processor, the steps of the firmware burning method as described above are implemented.

[0027] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a firmware burning program is stored, and when the firmware burning program is completed by a processor, the steps of the firmware burning method as described above are implemented.

[0028] The present invention realizes by splitting the flash firmware corresponding to the firmware to be burned into a preset firmware size, compressing the split flash sub-firmware, and then packing the compressed file to obtain a burning file, and then transmitting the burning file to a lower computer, so that the lower computer can decompress the burning file, and burn the decompressed burning file into flash. It can be seen that before the firmware is burned into flash, the flash firmware corresponding to the firmware to be burned is split into flash sub-firmware of the preset firmware size, so that a flash firmware that occupies a large memory is split into multiple flash sub-firmwares that occupy a small memory, and then the multiple flash sub-firmwares that occupy a small memory are compressed, corresponding to the compressed file that occupies a smaller memory, the compressed file is packed to obtain the burning file, and the burning file is sent to the lower computer, so that after the lower computer obtains the burning file, the burning file is decompressed, and then each decompressed file is burned into flash in sequence, so that the flash firmware corresponding to the firmware to be burned is quickly burned into flash, thereby improving the burning efficiency of the firmware. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flowchart of a first embodiment of a firmware burning method of the present invention;

[0030] Figure 2 It is a schematic diagram of a preferred structure of the firmware burning device of the present invention;

[0031] Figure 3 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.

[0032] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0033] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0034] The present invention provides a method for burning firmware, referring to Figure 1 , Figure 1 FIG. 1 is a flow chart of a first embodiment of a firmware burning method of the present invention.

[0035] The embodiment of the present invention provides an embodiment of a firmware burning method. It should be noted that, although a logical sequence is shown in the flow chart, under certain data, the steps shown or described may be completed in an order different from that shown here.

[0036] The firmware burning method is applied to the host computer, and the firmware burning method includes:

[0037] Step S10, splitting the flash firmware corresponding to the firmware to be burned according to a preset firmware size to obtain flash sub-firmware corresponding to the flash firmware.

[0038] Before the host computer splits the flash (flash memory) firmware corresponding to the firmware to be burned, the user needs to write the firmware code in the host computer and compile the firmware code into the firmware to be burned corresponding to the firmware code in the IDE (Integrated Development Environment) tool, and then split the firmware to be burned into internal flash firmware and external flash firmware according to the firmware type of the firmware to be burned and through objcopy (GNU tool). After the host computer detects that the user splits the firmware to be burned into the corresponding internal flash firmware and external flash firmware, the splitting tool in the host computer splits the external flash firmware according to the preset firmware size to obtain the corresponding number of external flash sub-firmware of the external flash firmware.

[0039] Among them, the host computer refers to a computer that can issue commands to control the lower computer, including but not limited to PC (Personal Computer) and other terminal devices. Firmware code includes GUI (Graphical User Interface) firmware code and LEDE (Linux Embedded Development Environment) firmware code, etc. IDE tools include but are not limited to KEIL (single-chip microcomputer C language software development system), IAR (embedded system development tools) and GCC (GNU Compiler Collection, GNU compiler suite). Firmware types include internal firmware and external firmware. Splitting tools include but are not limited to Godox (Godox splitting tool) and Hjspilt (file splitting tool), etc. The preset firmware size is set according to demand and is not limited in this embodiment.

[0040] It should be noted that after the user splits the firmware to be burned into the internal flash firmware and the external flash firmware, the internal flash firmware does not need to be split because the internal flash firmware occupies very little memory.

[0041] In this embodiment, for example, the preset firmware size is 2MB (megabytes), the external flash firmware obtained by the host computer is external_nor_flash.bin, and the memory occupied by external_nor_flash.bin is 21MB. The host computer splits the external_nor_flash.bin according to the preset firmware size, and obtains 11 external flash sub-firmware corresponding to the external flash firmware, namely external_nor_flash_1.bin, external_nor_flash_2.bin to external_nor_flash_11.bin, wherein the firmware size of external_nor_flash_1.bin to external_nor_flash_10.bin is 2MB, and the firmware size of external_nor_flash_11.bin is 1MB.

[0042] Step S20, compress the flash sub-firmware to obtain compressed files corresponding to each flash sub-firmware, package the compressed files to obtain burning files, and transmit the burning files to the lower computer so that the lower computer can decompress the burning files and burn the decompressed burning files into the flash.

[0043] After the upper computer obtains the external flash sub-firmware, it compresses each external flash sub-firmware through a preset compression tool to obtain a compressed file corresponding to each external flash sub-firmware, and then packages each compressed file through a preset file packaging method to obtain a burning file. After obtaining the burning file, the upper computer transmits the burning file to the lower computer. After receiving the burning file, the lower computer decompresses each compressed external flash sub-firmware in the burning file one by one, and burns each decompressed external flash sub-firmware into the external flash.

[0044] The preset compression tool includes but is not limited to miniLZO (lossless compression) tool and File Optimizer (file optimization) tool. The preset file packaging method includes file header method and price index method, etc., which are not limited in this embodiment. The lower computer includes but is not limited to PLC (Programmable Logic Controller) and single-chip microcomputer.

[0045] It should be noted that the compressed file does not change the format of the external flash sub-firmware, but only adds a compression suffix corresponding to the preset compression tool to the original format of the external flash sub-firmware. When the host computer splits the external flash sub-firmware, it generates a file index table corresponding to the firmware to be burned. In the file index table, the external flsah sub-firmware is sorted in order from small to large or from large to small according to the file index. In addition, the file index table contains the storage location of the external flash sub-firmware before and after compression, the file size of the external flash sub-firmware before and after compression, and the integrity check code of the compressed file before and after transmission, etc.

[0046] In this embodiment, for example, the preset compression tool is the miniLZO tool, and the external flash sub-firmware is external_nor_flash_1.bin and external_nor_flash_2.bin. The host computer compresses the obtained external flash sub-firmware external_nor_flash_1.bin and external_nor_flash_2.bin, and obtains the compressed files corresponding to the external flash sub-firmware external_nor_flash_1.bin and external_nor_flash_2.bin as external_nor_flash_1.bin.lzo and external_nor_flash_2.bin.lzo.

[0047] Furthermore, the step S20 includes:

[0048] Step a, compressing each of the flash sub-firmware according to the firmware redundancy, and obtaining a corresponding compressed file of each of the flash sub-firmware;

[0049] Step b, obtaining the file header identifier, packaging the file header identifier and the compressed file to obtain the burning file.

[0050] Specifically, after the host computer obtains the external flash sub-firmware, it compresses each external flash sub-firmware into a compressed file of different firmware size according to the size of the firmware redundancy corresponding to each external flash sub-firmware, sorts the compressed file according to the position order of the external flash sub-firmware before compression in the file index table, obtains the compressed file index table, and then obtains the file header identifier in the host computer, packages the file header identifier and the compressed file index table, and obtains the burning file. Among them, the file header identifier is the starting identifier of the burning file. The firmware redundancy is determined according to the performance of each external flash sub-firmware, and the firmware redundancy of different external flash sub-firmware can be the same or different.

[0051] It should be noted that the greater the firmware redundancy of the external flash sub-firmware, the smaller the compressed file after compression. The lower computer decompresses the compressed file only after detecting the file header identifier. If the file header identifier is not detected, the compressed file is not decompressed.

[0052] In this embodiment, for example, the file header identifier is Header, and the three external flash sub-firmwares with a firmware size of 2MB are external_nor_flash_1.bin, external_nor_flash_2.bin, and external_nor_flash_3.bin, and the corresponding firmware redundancies are 100, 90, and 80. The host computer compresses the external flash sub-files according to the size of the firmware redundancy, and obtains the firmware size of the compressed files external_nor_flash_1.bin.lzo is 400K (bytes, storage unit), the firmware size of external_nor_flash_2.bin.lzo is 500KB, and the firmware size of external_nor_flash_3.bin.lzo is 600KB. Then, the compressed files are sorted according to the position order of the external flash sub-files before compression, and the sorted compressed files are external_nor_flash_1.bin.lzo, external_nor_flash_2.bin.lzo, and external_nor_flash_3.bin.lzo. The file header identifier Header and the sorted compressed files are packaged, and the obtained burning file is Header+external_nor_flash_1.bin.lzo+external_nor_flash_2.bin.lzo+external_nor_flash_3.bin.lzo.

[0053] This embodiment splits the flash firmware corresponding to the firmware to be burned into a preset firmware size, compresses the split flash sub-firmware, and then packs the compressed file to obtain a burning file, and then transmits the burning file to the lower computer, so that the lower computer can decompress the burning file, and burn the decompressed burning file into the flash. It can be seen that before the firmware is burned into the flash, the flash firmware corresponding to the firmware to be burned is split into flash sub-firmware of the preset firmware size, so that a flash firmware that occupies a large memory is split into multiple flash sub-firmwares that occupy a smaller memory, and then the multiple flash sub-firmwares that occupy a smaller memory are compressed, corresponding to the compressed files that occupy a smaller memory, the compressed files are packed to obtain the burning file, and the burning file is sent to the lower computer, so that after the lower computer obtains the burning file, the burning file is decompressed, and then each decompressed file is burned into the flash in sequence, so that the flash firmware corresponding to the firmware to be burned is quickly burned into the flash, thereby improving the burning efficiency of the firmware.

[0054] Furthermore, a second embodiment of a firmware burning method of the present invention is provided.

[0055] The difference between the second embodiment of the firmware burning method and the first embodiment of the firmware burning method is that the firmware burning method is applied to the lower computer, and the firmware burning method includes:

[0056] Step S30, after detecting a receiving instruction for receiving a burning file, receiving the burning file sent by the host computer according to the receiving instruction, wherein the burning file is obtained by splitting, compressing and packaging the burning file by the host computer.

[0057] Step S40, decompressing the burning files in sequence to obtain decompressed files corresponding to each flash sub-firmware, and burning the decompressed files to the flash in sequence.

[0058] After the lower computer, i.e. the single-chip microcomputer (Static Random-Access Memory, SRAM), detects the receiving instruction of the receiving burning file sent by the upper computer, it receives the burning file obtained by the upper computer through splitting, compression and packaging according to the receiving instruction. After receiving the burning file, the single-chip microcomputer decompresses the compressed files corresponding to each external flash sub-firmware in the burning file in sequence through the preset decompression tool, obtains the decompressed files corresponding to each external flash sub-firmware, and burns the decompressed files one by one into the external flash. Among them, the preset decompression tool and the preset compression tool are corresponding.

[0059] Furthermore, the step S40 includes:

[0060] Step c, detecting whether the burning file is in a complete state;

[0061] Step d: if it is detected that the burning file is in a complete state, the burning file is decompressed in sequence to obtain a decompressed file of the burning file, and the decompressed file is burned to the flash in sequence.

[0062] Specifically, after receiving the burning file transmitted by the host computer, the single-chip microcomputer detects whether the burning file is in a complete state through a preset verification method. If the burning file is detected to be in a complete state, the single-chip microcomputer decompresses the compressed files in the burning file in sequence, obtains the decompressed files corresponding to each compressed file, and burns each decompressed file into the external flash in sequence. If the burning file is detected to be in an incomplete state, that is, a defective state, the single-chip microcomputer deletes the burning file. Among them, the preset verification method includes but is not limited to a check code method and a file length verification method.

[0063] Furthermore, the step c comprises:

[0064] Step e, obtaining a first verification code before the burning file is transmitted and a second verification code after the burning file is transmitted, and detecting whether the first verification code and the second verification code are the same;

[0065] Step f, if it is detected that the first verification code and the second verification code are different, determining that the burning file is in a defective state;

[0066] Step g: If it is detected that the first verification code is the same as the second verification code, it is determined that the burning file is in a complete state.

[0067] Specifically, the single-chip microcomputer obtains the first check code of the burning file before transmission and the second check code after transmission, compares the first check code with the second check code numerically, returns the corresponding result character according to the comparison result, and detects whether the first check code and the second check code are the same according to the result character. If it is detected that the first check code and the second check code are not the same, the single-chip microcomputer determines that the burning file is in an incomplete state, that is, a defective state. If it is detected that the first check code and the second check code are the same, the single-chip microcomputer determines that the burning file is in a complete state.

[0068] The check code is a numerical value, which is calculated by the single chip microcomputer through a preset algorithm, and the preset algorithm includes but is not limited to a code distance algorithm, a parity check algorithm, a Hamming check algorithm, and a cyclic redundancy check algorithm. The result character can be represented in Chinese and English, etc. This embodiment does not limit the representation of the result character. Chinese can be represented as success and failure, and English can be represented as false and true.

[0069] It should be noted that success and true indicate that the comparison results are numerically identical, while failure and false indicate that the comparison results are numerically different.

[0070] In this embodiment, for example, the result character representation is in English, the value of the first check code is 8, the value of the second check code is 7, and after the single-chip microcomputer compares the first check code with the second check code, the result character returned is false. If the single-chip microcomputer detects that the first check code and the second check code are different according to the result character, it is determined that the burning file is in a defective state. The first check code is 8, the value of the second check code is 8, and after the single-chip microcomputer compares the first check code with the second check code, the result character returned is true. If the single-chip microcomputer detects that the first check code and the second check code are the same according to the result character, it is determined that the burning file is in a complete state.

[0071] Further, the step d comprises:

[0072] Step h, if it is detected that the burning file is in a complete state, obtaining the file index value corresponding to each compressed file in the burning file;

[0073] Step i, decompressing the compressed files in sequence according to the file index values ​​from small to large, obtaining decompressed files corresponding to the compressed files, and burning the decompressed files to the flash in sequence.

[0074] Specifically, if the single-chip microcomputer detects that the burned file is in a complete state, it obtains the file index value corresponding to each compressed file in the burned file, and compares the file index values ​​one by one. According to the comparison result, the compressed files in the burned file are decompressed in order from small to large in the order of the file index values, and the compressed file corresponding to the smallest file index value is decompressed to obtain the corresponding decompressed file, and the decompressed file is burned to the external flash, and then the compressed file corresponding to the smallest file index value in the remaining compressed files is decompressed to obtain the corresponding decompressed file, and then the decompressed file is burned to the external flash, and the cycle is repeated to decompress and burn the compressed files in the burned file one by one.

[0075] It should be noted that after the external flash firmware is burned to the external flash, the host computer detects whether the internal flash firmware has been burned to the internal flash. If it is detected that the internal flash firmware has been burned to the internal flash, the host computer determines that the entire firmware burning process has been completed. If it is detected that the internal flash firmware has not been burned to the internal flash, the host computer determines that the entire firmware burning process has not been completed, and continues to burn the internal flash firmware to the internal flash.

[0076] In this embodiment, for example, the file to be burned received by the single chip microcomputer from the host computer is Header+external_nor_flash_1.bin.lzo+external_nor_flash_2.bin.lzo, the single chip microcomputer decompresses the compressed file external_nor_flash_1.bin.lzo, and burns the decompressed file corresponding to external_nor_flash_1.bin.lzo into the external flash. After the compressed file external_nor_flash_1.bin.lzo is burned into the external flash, the single chip microcomputer decompresses external_nor_flash_2.bin.lzo, and burns the decompressed file corresponding to external_nor_flash_2.bin.lzo into the external flash.

[0077] Furthermore, the firmware burning method also includes:

[0078] Step j, detecting whether a static random access memory SRAM program sent by the host computer is received;

[0079] Step k, if it is detected that the SRAM program has been received, the lower computer is started through the SRAM program, and the starting of the lower computer includes initializing the lower computer hardware, receiving the burning file, decompressing the burning file, detecting the integrity of the burning file and / or burning the decompressed file.

[0080] Before the MCU receives the burning file transmitted by the host computer, the user needs to write the SRAM program of the MCU in the host computer, that is, the MCU startup program, and then send the SRAM program to the MCU. The MCU detects whether the SRAM program is received at the SWD (emulation mode) interface. If it detects that the SRAM program has been received at the SWD interface, the MCU will start the various hardware of the lower computer, that is, the MCU, through the SRAM program, such as SDRAM (Synchronous Dynamic Random-Access Memory) and external flash, receive the burning file, decompress the burning file, detect the integrity of the burning file, or / and burn the decompressed file. If it detects that the SRAM program is not received at the SWD interface, the MCU will continue to wait for the command of the host computer until the SRAM program is received.

[0081] This embodiment realizes that after detecting the receiving instruction of receiving the burning file, the burning file sent by the host computer is received according to the receiving instruction, and then the burning file is sequentially decompressed to obtain the decompressed file corresponding to each flash sub-firmware, and the decompressed file is sequentially burned to the flash. It can be seen that before burning the firmware to the external flash, it is necessary to detect the integrity of the burning file. When the burning file is detected to be in a complete state, the burning file is sequentially decompressed, and the decompressed files are burned one by one to the external flash, so that under the condition that the external flash memory size is certain, more firmware can be burned, thereby ensuring that the burning file is complete, thereby improving the utilization rate of the external flash memory.

[0082] In addition, the present invention also provides a firmware burning device, the firmware burning device is applied to a mechanical arm, the mechanical arm at least includes a visual device, referring to Figure 2 , the firmware burning device comprises:

[0083] The splitting module 10 is used to split the flash firmware corresponding to the firmware to be burned according to the preset firmware size to obtain the flash sub-firmware corresponding to the flash firmware;

[0084] A compression module 20, used for compressing the flash sub-firmware to obtain a compressed file corresponding to each of the flash sub-firmware;

[0085] The packaging module 30 is used to package the compressed files to obtain burning files;

[0086] The transmission module 40 is used to transmit the burning file to the lower computer, so that the lower computer can decompress the burning file and burn the decompressed burning file into the flash;

[0087] The receiving module 50 is used for receiving the burning file sent by the host computer according to the receiving instruction after detecting the receiving instruction of the burning file, wherein the burning file is obtained by splitting, compressing and packaging the burning file by the host computer;

[0088] A decompression module 60 is used to decompress the burning files in sequence to obtain decompressed files corresponding to each flash sub-firmware;

[0089] The burning module 70 is used to burn the decompressed files into the flash in sequence.

[0090] Furthermore, the compression module 20 is further configured to compress each of the flash sub-firmware according to the firmware redundancy, and obtain a corresponding compressed file of each of the flash sub-firmware.

[0091] Furthermore, the packaging module 30 includes:

[0092] The first acquisition unit is used to acquire a file header identifier.

[0093] Furthermore, the packaging module 30 is also used to package the file header identifier and the compressed file to obtain the burning file.

[0094] Furthermore, the burning module 70 includes:

[0095] The detection unit is used to detect whether the burning file is in a complete state.

[0096] Furthermore, the decompression module 60 is further used to decompress the burning files in sequence if it is detected that the burning files are in a complete state, and obtain a decompressed file of the burning files accordingly;

[0097] The burning module 70 is also used to burn the decompressed files into the flash in sequence.

[0098] Furthermore, the detection unit comprises:

[0099] An acquisition subunit, used for acquiring a first verification code before the burning file is transmitted and a second verification code after the burning file is transmitted;

[0100] A detection subunit, used to detect whether the first verification code and the second verification code are the same;

[0101] The determination subunit is used to determine that the burning file is in a defective state if it is detected that the first verification code and the second verification code are different; and to determine that the burning file is in a complete state if it is detected that the first verification code and the second verification code are the same.

[0102] Furthermore, the burning module 70 includes:

[0103] The second obtaining unit is configured to obtain a file index value corresponding to each compressed file in the burning file if it is detected that the burning file is in a complete state.

[0104] Furthermore, the decompression module 60 is further used to decompress the compressed files in sequence according to the file index values ​​from small to large, to obtain decompressed files corresponding to the compressed files;

[0105] The burning module 70 is also used to burn the decompressed files into the flash in sequence.

[0106] Furthermore, the firmware burning device also includes:

[0107] A detection module, used for detecting whether a static random access memory SRAM program sent by the host computer is received;

[0108] The startup module is used to start the lower computer through the SRAM program if it is detected that the SRAM program has been received. The startup of the lower computer includes initializing the lower computer hardware, receiving the burning file, decompressing the burning file, detecting the integrity of the burning file, and / or burning the decompressed file.

[0109] The specific implementation of the firmware-based burning device of the present invention is basically the same as the above-mentioned firmware-based burning method embodiments, and will not be repeated here.

[0110] In addition, the present invention also provides a firmware burning device. Figure 3 As shown, Figure 3 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.

[0111] It should be noted that Figure 3 This is a schematic diagram of the structure of the hardware operating environment of the firmware burning device.

[0112] like Figure 3As shown, the firmware burning device may include: a processor 1001, such as a CPU (Central Processing Unit), a memory 1005, a user interface 1003, a network interface 1004, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (board), and the user interface 1003 may optionally include a standard wired interface (such as a USB (Universal Serial Bus) interface) and a wireless interface (such as a Bluetooth interface). The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI (Wireless-Fidelity) interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0113] Optionally, the firmware burning device may further include an RF (Radio Frequency) circuit, a sensor, a WiFi module, and the like.

[0114] Those skilled in the art will understand that Figure 3 The firmware burning device structure shown in the figure does not constitute a limitation on the firmware burning device, and may include more or less components than shown in the figure, or combine certain components, or have different component arrangements.

[0115] like Figure 3 As shown, the memory 1005 as a computer storage medium may include an operating device, a network communication module, a user interface module and a firmware burning program. The operating device is a program that manages and controls the firmware burning device hardware and software resources, and supports the operation of the firmware burning program and other software or programs.

[0116] In the firmware burning device shown in the figure, the user interface 1003 is mainly used for the host computer so that the user can write firmware code and the startup program of the single-chip microcomputer; the network interface 1004 is mainly used for the single-chip microcomputer to communicate files with the host computer to receive the burning files and the single-chip microcomputer startup program sent by the host computer; the processor 1001 can be used to call the firmware burning program stored in the memory 1005, and complete the steps of the control method of the firmware burning device as described above.

[0117] The specific implementation of the firmware burning device of the present invention is basically the same as the above-mentioned firmware burning method embodiments, and will not be repeated here.

[0118] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a firmware burning program is stored. When the firmware burning program is completed by a processor, the steps of the firmware burning method described above are implemented.

[0119] The specific implementation of the computer-readable storage medium of the present invention is basically the same as the above-mentioned firmware burning method embodiments, and will not be described in detail here.

[0120] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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 more restrictive data, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0121] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but the former is a better implementation method in many cases. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of software goods, which are stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a firmware burning device to complete the methods described in each embodiment of the present invention.

Claims

1. A method for burning firmware, It is characterized in that The firmware burning method is applied to a host computer, and the firmware burning method comprises the following steps: The external flash firmware corresponding to the firmware to be burned is split according to the preset firmware size by a splitting tool to obtain the flash sub-firmware corresponding to the flash firmware, wherein the firmware to be burned is compiled by an IDE tool from a pre-written firmware code, and the external flash firmware is the flash firmware split from the firmware to be burned by a GNU tool, and the flash firmware split from the firmware to be burned includes an internal flash firmware and an external flash firmware; Calling a preset compression tool to compress each of the flash sub-firmware according to the firmware redundancy, and correspondingly obtaining a compressed file of each of the flash sub-firmware, wherein the firmware redundancy is determined according to the performance of the flash sub-firmware; Obtain a file header identifier, package the file header identifier and the compressed file to obtain a burning file, and transmit the burning file to a lower computer, so that when the lower computer detects that the burning file is in a complete state, the burning file is decompressed, and the decompressed burning file is burned into a flash, wherein the lower computer receives a static random access memory SRAM program sent by the upper computer before receiving the burning file, and starts the lower computer through the SRAM program, wherein starting the lower computer includes initializing the lower computer hardware, receiving the burning file, detecting the integrity of the burning file, decompressing the burning file, and burning the decompressed file.

2. A method for burning firmware, It is characterized in that The firmware burning method is applied to a lower computer, and the firmware burning method comprises the following steps: Detect whether the static random access memory SRAM program sent by the host computer is received; If it is detected that the SRAM program has been received, the lower computer is started through the SRAM program, and the starting of the lower computer includes initializing the lower computer hardware, receiving the burning file, detecting the integrity of the burning file, decompressing the burning file, and burning the decompressed file; After detecting a receiving instruction for receiving a burning file, the burning file sent by the host computer is received according to the receiving instruction, the burning file is obtained by the host computer packaging a compressed file of a flash sub-firmware, the compressed file of the flash sub-firmware is obtained by the host computer using a splitting tool to split the external flash firmware corresponding to the firmware to be burned according to a preset firmware size, and then compressing the flash sub-firmware according to firmware redundancy, wherein the firmware redundancy is determined according to the performance of the flash sub-firmware, the firmware to be burned is compiled by an IDE tool from a pre-written firmware code, the external flash firmware is a flash memory flash firmware split from the firmware to be burned by a GNU tool, and the flash memory flash firmware split from the firmware to be burned includes an internal flash firmware and an external flash firmware; Detecting whether the burning file is in a complete state; If it is detected that the burning file is in a complete state, the burning file is decompressed in sequence to obtain a decompressed file of the burning file, and the decompressed file is burned to the flash in sequence.

3. The method for burning firmware according to claim 2, It is characterized in that The step of detecting whether the burning file is in a complete state comprises: Obtaining a first verification code before the burning file is transmitted and a second verification code after the burning file is transmitted, and detecting whether the first verification code and the second verification code are the same; If it is detected that the first verification code and the second verification code are different, determining that the burning file is in a defective state; If it is detected that the first verification code is the same as the second verification code, it is determined that the burning file is in a complete state.

4. The method for burning firmware according to claim 2, It is characterized in that If it is detected that the burning file is in a complete state, the burning file is decompressed in sequence to obtain a decompressed file of the burning file, and the decompressed file is burned to the flash in sequence, including: If it is detected that the burning file is in a complete state, obtaining the file index value corresponding to each compressed file in the burning file; The compressed files are decompressed in sequence according to the file index values ​​from small to large, to obtain decompressed files corresponding to the compressed files, and the decompressed files are burned to the flash in sequence.

5. A firmware burning device, It is characterized in that The firmware burning device includes a memory, a processor, and a firmware burning program stored in the memory and running on the processor. When the firmware burning program is completed by the processor, the steps of the firmware burning method as described in any one of claims 1, 2 to 4 are implemented.

6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a firmware burning program, and when the firmware burning program is completed by the processor, the steps of the firmware burning method according to any one of claims 1, 2 to 4 are implemented.