Dual-core DSP firmware updating method, system and device and storage medium
By merging and verifying the firmware files of CPU1 and CPU2, and using the SCI or bus download method, the problems of the traditional upgrade process and error risk in the dual-core DSP system are solved, and a safer and more convenient firmware update is achieved.
Patent Information
- Application Number
- CN202410900607.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the online upgrade process of a dual-core DSP system, the traditional method requires two CPUs to be upgraded separately, resulting in cumbersome operations and the risk of incorrect firmware file selection.
Get the CPU1 and CPU2 files generated by compilation, use the merge tool to merge and generate the firmware update file, and use the file header and CRC check code to verify the legality of the file, parse and download the firmware content of CPU1 and CPU2 for burning, use SCI or Bus download mode.
It simplifies the firmware update process of dual-core DSP, improves the security and convenience of burning, and avoids the risk of incorrect firmware file selection.
Smart Images

Figure CN118733089A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of DSP update, and in particular to a dual-core DSP firmware update method, system, device and storage medium. Background Art
[0002] Online upgrade of embedded systems is a must-have feature for many products nowadays. There are many ways such as JTAG, UART, CAN, SPI, etc., depending on the programming interface. Although the programming interfaces are different, the principles of online upgrade are similar: through external trigger conditions, the microcontroller chip is separated from the execution flow of the conventional application program, jumps to the execution code (bootloader) at a fixed position in the program space, erases the FLASH, and then receives the upgrade data through the corresponding communication protocol, and burns the upgrade data into the FLASH storage area of the chip.
[0003] The existing dual-core online upgrade utilizes the integrated bootloader in each CPU chip of the DSP to complete the boot, and then downloads the burning kernel of each CPU to their respective RAM to complete the firmware update. For dual-core DSP systems, the traditional online upgrade method requires CPU1 and CPU2 to be upgraded separately. Each time the firmware file is selected, it is necessary to update it twice. The operation process is cumbersome and there is a risk of burning errors caused by the selection of the firmware files of the two CPUs. Summary of the invention
[0004] To this end, the embodiments of the present invention provide a dual-core DSP firmware update method, system, device and storage medium to solve the technical problem that the two CPU firmwares need to be updated twice in the prior art, the update process is cumbersome and there may be a risk of CPU firmware file burning errors.
[0005] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] According to a first aspect of an embodiment of the present invention, a dual-core DSP firmware update method is provided, the method being applied to a dual-core CPU, and comprising:
[0007] S1, obtain the compiled cpu1 file and cpu2 file and merge them using a merging tool to generate a firmware update file;
[0008] S2, obtain the file header and CRC check code from the firmware update file, use the file header and CRC check code to verify whether the burning file is legal, if illegal, stop updating, if legal, proceed to the next step;
[0009] S3, parsing the firmware update file, obtaining the firmware content of cpu1 according to the cpu1 offset and cpu1 size, downloading the cpu1 firmware for burning, and then obtaining the firmware content of cpu2 according to the cpu2 offset and cpu2 size, downloading the cpu2 firmware for burning.
[0010] Furthermore, the firmware update file includes all the contents of cpu1 and cpu2, and the file header is a fixed content used for the burning software to perform file type verification.
[0011] Furthermore, the CRC check code is a CRC check code formed by combining the CRC checks of all contents.
[0012] Further, the firmware content of cpu1 is obtained according to the cpu1 offset and the cpu1 size, and the cpu1 firmware is downloaded for burning. Then, the firmware content of cpu2 is obtained according to the cpu2 offset and the cpu2 size, and the cpu2 firmware is downloaded for burning, including:
[0013] The downloading method is through SCI or bus.
[0014] Furthermore, the bus is downloaded as a CAN bus or an etherCat bus.
[0015] According to a second aspect of an embodiment of the present invention, a dual-core DSP firmware update system is provided, the system comprising:
[0016] A preprocessing module is used to obtain the cpu1 file and cpu2 file generated by the compilation and merge them using a merging tool to generate a firmware update file;
[0017] A verification module is used to obtain a file header and a CRC check code from the firmware update file, and use the file header and the CRC check code to verify whether the burning file is legal. If it is illegal, the update is stopped, and if it is legal, the next step is performed;
[0018] The burning module is used to parse the firmware update file, obtain the firmware content of cpu1 according to the cpu1 offset and cpu1 size and download the cpu1 firmware for burning, and then obtain the firmware content of cpu2 according to the cpu2 offset and cpu2 size and download the cpu2 firmware for burning.
[0019] According to a third aspect of an embodiment of the present invention, there is provided a dual-core DSP firmware update device, the device comprising: a processor and a memory;
[0020] The memory is used to store one or more program instructions;
[0021] The processor is used to run one or more program instructions to execute the steps of a dual-core DSP firmware update method as described in any one of the above items.
[0022] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a dual-core DSP firmware update method as described in any one of the above items are implemented.
[0023] The embodiments of the present invention have the following advantages:
[0024] The embodiment of the present invention is applied to a dual-core cpu, which includes: S1, obtaining the cpu1 file and cpu2 file generated by compilation and merging them using a merging tool to generate a firmware update file; S2, obtaining the file header and CRC check code from the firmware update file, using the file header and CRC check code to verify whether the burning file is legal, if it is illegal, stop updating, if it is legal, proceed to the next step; S3, parse the firmware update file, obtain the firmware content of cpu1 according to the cpu1 offset and cpu1 size, download the cpu1 firmware for burning, and then obtain the firmware content of cpu2 according to the cpu2 offset and cpu2 size, and download the cpu2 firmware for burning. The embodiment of the present invention combines the two CPU firmwares of the dual-core DSP into one, and uses the CRC check code attached to the merged file to ensure the integrity of the firmware, thereby greatly improving the security and convenience of burning the dual-core DSP. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0026] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0027] Figure 1 A schematic diagram of the logical structure of a dual-core DSP firmware update system provided by an embodiment of the present invention;
[0028] Figure 2A schematic flow chart of a dual-core DSP firmware update method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] The existing dual-core online upgrade utilizes the integrated bootloader in each CPU chip of the DSP to complete the boot, and then downloads the burning kernel of each CPU to their respective RAM to complete the firmware update. For dual-core DSP systems, the traditional online upgrade method requires CPU1 and CPU2 to be upgraded separately. Each time the firmware file is selected, it is necessary to update it twice. The operation process is cumbersome and there is a risk of burning errors caused by the selection of the firmware files of the two CPUs.
[0031] In order to solve the above technical problem that the two CPU firmwares need to be updated twice respectively, the update process is cumbersome and there may be a risk of CPU firmware file burning errors.
[0032] refer to Figure 1 The embodiment of the present invention discloses a dual-core DSP firmware update system, which includes: a preprocessing module 1; a verification module 2; and a burning module 3.
[0033] Corresponding to the dual-core DSP firmware update system disclosed above, the embodiment of the present invention further discloses a dual-core DSP firmware update method. The following describes in detail a dual-core DSP firmware update method disclosed in the embodiment of the present invention in combination with the dual-core DSP firmware update system described above.
[0034] refer to Figure 2The present invention discloses a dual-core DSP firmware update method, which is applied to a dual-core CPU and includes: S1, obtaining a compiled cpu1 file and a cpu2 file and merging them using a merging tool to generate a firmware update file; S2, obtaining a file header and a CRC check code from the firmware update file, and using the file header and the CRC check code to verify whether the burning file is legal, if it is illegal, stop updating, and if it is legal, proceed to the next step; S3, parsing the firmware update file, obtaining the firmware content of cpu1 according to the cpu1 offset and cpu1 size, downloading the cpu1 firmware for burning, and then obtaining the firmware content of cpu2 according to the cpu2 offset and cpu2 size, and downloading the cpu2 firmware for burning.
[0035] Furthermore, the firmware update file includes all the contents of cpu1 and cpu2, and the file header is a fixed content used for the burning software to perform file type verification.
[0036] Among them, the format of the firmware update file is:
[0037] File Header Cpu1 offset, cpu1 size Cpu2 offset, cpu2 size ……………………… Cpu1 firmware starts...... ………………………………… Cpu2 firmware starts...... ………………………………… File CRC check
[0038] Furthermore, the CRC check code is a CRC check code formed by combining the CRC checks of all contents.
[0039] Further, the firmware content of cpu1 is obtained according to the cpu1 offset and cpu1 size and the cpu1 firmware is downloaded for burning, and then the firmware content of cpu2 is obtained according to the cpu2 offset and cpu2 size and the cpu2 firmware is downloaded for burning, including: the downloading method is downloading through SCI or bus.
[0040] Furthermore, the bus is downloaded as a CAN bus or an etherCat bus.
[0041] In addition, an embodiment of the present invention further provides a dual-core DSP firmware update device, the device comprising: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a dual-core DSP firmware update method as described in any one of the above items.
[0042] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a dual-core DSP firmware update method as described in any one of the above items are implemented.
[0043] In the embodiment of the present invention, the processor may be an integrated circuit chip having the signal processing capability. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0044] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.
[0045] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0046] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
[0047] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).
[0048] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0049] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.
[0050] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A dual-core DSP firmware update method, It is characterized in that The method is applied to a dual-core CPU, and comprises: S1, obtain the compiled cpu1 file and cpu2 file and merge them using a merging tool to generate a firmware update file; S2, obtain the file header and CRC check code from the firmware update file, use the file header and CRC check code to verify whether the burning file is legal, if illegal, stop updating, if legal, proceed to the next step; S3, parsing the firmware update file, obtaining the firmware content of cpu1 according to the cpu1 offset and cpu1 size, downloading the cpu1 firmware for burning, and then obtaining the firmware content of cpu2 according to the cpu2 offset and cpu2 size, downloading the cpu2 firmware for burning.
2. A dual-core DSP firmware update method as claimed in claim 1, It is characterized in that The firmware update file includes all the contents of cpu1 and cpu2, and the file header is a fixed content used for the burning software to perform file type verification.
3. A dual-core DSP firmware update method as claimed in claim 2, It is characterized in that The CRC check code is a CRC check code formed by combining the CRC checks of all contents.
4. A dual-core DSP firmware update method as claimed in claim 3, It is characterized in that Get the firmware content of cpu1 according to the cpu1 offset and cpu1 size and download the cpu1 firmware for burning. Then get the firmware content of cpu2 according to the cpu2 offset and cpu2 size and download the cpu2 firmware for burning, including: The downloading method is through SCI or bus.
5. A dual-core DSP firmware update method as claimed in claim 4, It is characterized in that The bus is downloaded as CAN bus or etherCat bus.
6. A dual-core DSP firmware update system, It is characterized in that The system comprises: A preprocessing module is used to obtain the cpu1 file and cpu2 file generated by the compilation and merge them using a merging tool to generate a firmware update file; A verification module is used to obtain a file header and a CRC check code from the firmware update file, and use the file header and the CRC check code to verify whether the burning file is legal. If it is illegal, the update is stopped, and if it is legal, the next step is performed; The burning module is used to parse the firmware update file, obtain the firmware content of cpu1 according to the cpu1 offset and cpu1 size and download the cpu1 firmware for burning, and then obtain the firmware content of cpu2 according to the cpu2 offset and cpu2 size and download the cpu2 firmware for burning.
7. A dual-core DSP firmware update device, It is characterized in that The device comprises: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a dual-core DSP firmware update method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a dual-core DSP firmware update method as claimed in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for updating firmware, chip and communication terminal
CN102830984A
Method and system for updating EOC software by adopting combined files
CN105302613A
Firmware update device and firmware update method
US20200379745A1
