DSP program online upgrade method
In the online upgrade method of DSP program, the Bootloader program is used to checksum write processing of the upgrade program, and the security failure problem caused by incomplete program during the online upgrade process is solved, which improves the security of the device.
Patent Information
- Application Number
- CN201910957392.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-10
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2039-10-10
AI Technical Summary
During the online update and upgrade of electronic products, they are easily affected by external factors, resulting in unsuccessful updates, incomplete procedures, and thus safety failures.
A DSP program online upgrade method is proposed. By receiving the upgrade instructions during the application running, the Bootloader program is erased, the original data in the program backup area is written, and the written program is checked to ensure that After the program is complete, write it to the program run area.
Verify the integrity of the upgrade program, ensure the integrity of the written program, improve the security of the equipment that executes the upgrade program, and avoid security failures caused by incomplete program.
Smart Images

Figure CN112650518B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of program upgrade, and in particular to a DSP program online upgrade method. Background Art
[0002] With the development of electronic technology, various products with DSP (Digital Signal Processing) as the core have been widely used in many fields. These electronic products usually need program upgrade and maintenance during their use cycle.
[0003] At present, online upgrade programs for electronic products are more common, and online upgrades have the advantages of being simple, convenient, and having a high user experience. However, since the online update and upgrade process of electronic product programs is affected by a variety of external factors, it is easy to cause the update and upgrade to fail during the update and upgrade process, resulting in incomplete update and upgrade programs, and causing safety failures in devices that execute incomplete programs. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems in the above-mentioned technology to a certain extent. To this end, the purpose of the present invention is to provide a DSP program online upgrade method, which can verify the upgrade program written during the online upgrade, thereby ensuring the integrity of the written upgrade program and improving the security of the device executing the upgrade program.
[0005] To achieve the above-mentioned purpose, an embodiment of the present invention proposes a DSP (Digital Signal Processing) program online upgrade method, wherein the Flash of the DSP includes a Bootloader program storage area and an application storage area, wherein the application storage area includes a program backup area and a program running area, and the method includes the following steps: S1, after the DSP receives an upgrade instruction during the running of the application, the Bootloader program is run; S2, after erasing the original data in the program backup area, the upgrade program is written into the program backup area; S3, checking whether the application in the program backup area is complete; S4, if the application in the program backup area is complete, then after erasing the original data in the program running area, the current application in the program backup area is written into the program running area.
[0006] According to the DSP program online upgrade method of the embodiment of the present invention, the DSP runs the Bootloader program after receiving the upgrade instruction during the application program running process, and writes the upgrade program to the program backup area after erasing the original data in the program backup area, and verifies whether the application in the program backup area is complete. If the application in the program backup area is complete, the current application in the program backup area is written to the program running area after erasing the original data in the program running area. In this way, the upgrade program written during the online upgrade can be verified, thereby ensuring the integrity of the written upgrade program and improving the security of the device executing the upgrade program.
[0007] In addition, the DSP program online upgrade method proposed in the above embodiment of the present invention may also have the following additional technical features:
[0008] According to one embodiment of the present invention, the DSP program online upgrade method also includes: after the DSP is powered on, running the Bootloader program and checking whether the application in the application storage area is complete; if the application in the application storage area is complete and the transmission information of the upgrade program is not received within the preset time, running the current application in the program running area; if the application in the application storage area is complete and the transmission information of the upgrade program is received within the preset time, executing steps S2 to S4; if the application in the application storage area is incomplete, waiting to receive the upgrade program, and executing steps S2 to S4 after receiving the transmission information of the upgrade program.
[0009] According to an embodiment of the present invention, the DSP program online upgrade method further comprises: before writing the upgrade program into the program backup area, verifying whether the upgrade program is correct.
[0010] According to one embodiment of the present invention, the DSP program online upgrade method also includes: if the application in the program backup area is incomplete, checking whether the application in the program running area is complete; if the application in the program running area is complete, running the current application in the program running area; if the application in the program running area is incomplete, waiting to receive the upgrade program, and executing steps S2 to S4 after receiving the transmission information of the upgrade program.
[0011] According to one embodiment of the present invention, the integrity of the application is verified by performing MD5 (Message-Digest Algorithm 5) verification on the program data in the program backup area, the program running area or the entire application storage area.
[0012] According to an embodiment of the present invention, a cyclic redundancy check (CRC) is performed on each frame of upgrade program data to be written into the program backup area to verify whether the upgrade program is correct. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A flowchart of a DSP program online upgrade method according to an embodiment of the present invention;
[0014] Figure 2 The figure is a flow chart of a DSP program online upgrade method according to a specific embodiment of the present invention. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0016] In one embodiment of the present invention, the Flash of the DSP includes a Bootloader program storage area and an application program storage area, and the application program storage area includes a program backup area and a program running area. For example, the Flash may include areas A to G, where area A may be used as a Bootloader program storage area, areas B, C, and D may be used as program running areas, and areas E, F, and G may be used as program backup areas.
[0017] Based on the above Flash partition, such as Figure 1 As shown, the DSP program online upgrade method of the embodiment of the present invention includes the steps of:
[0018] S1, after receiving the upgrade instruction during the application program running, the DSP runs the Bootloader program.
[0019] In one embodiment of the present invention, after receiving an upgrade instruction from a host computer during the running of an application program, the DSP may jump to the Bootloader program to receive the upgrade program.
[0020] S2, after erasing the original data in the program backup area, write the upgrade program into the program backup area.
[0021] In one embodiment of the present invention, after receiving the transmission information of the upgrade program, ie, the header frame of the upgrade program, the original data in the program backup area may be erased first, and then the upgrade program may be written into the program backup area.
[0022] In one embodiment of the present invention, before writing the upgrade program into the program backup area, it is possible to verify whether the upgrade program is correct. Specifically, the upgrade program can be verified by performing a CRC check on each frame of the upgrade program data to be written into the program backup area to verify whether the upgrade program is correct. If the upgrade program is correct, the upgrade program is written into the program backup area. By checking the upgrade program data to be written into the program backup area frame by frame, the correctness of the written upgrade program can be guaranteed.
[0023] S3, verify whether the application program in the program backup area is complete.
[0024] In one embodiment of the present invention, after the upgrade program is completely written into the program backup area, it is possible to verify whether the application program in the program backup area is complete.
[0025] S4, if the application program in the program backup area is complete, after erasing the original data in the program running area, the current application program in the program backup area is written into the program running area.
[0026] In one embodiment of the present invention, after the current application program in the program backup area, i.e., the upgrade program, is completely written into the program running area, the DSP program is successfully upgraded online, and the current application program in the program running area, i.e., the upgrade program, can be executed after the upgrade is successful.
[0027] In one embodiment of the present invention, after being powered on, the DSP may run a Bootloader program and verify whether the application program in the application program storage area is complete.
[0028] Furthermore, if the application in the application storage area is complete and the transmission information of the upgrade program, i.e., the upgrade program header frame, is not received within a preset time, for example, within 3S, then the current application in the program running area is run; if the application in the application storage area is complete and the transmission information of the upgrade program is received within the preset time, then steps S2 to S4 are executed; if the application in the application storage area is incomplete, then wait for receiving the upgrade program, and execute steps S2 to S4 after receiving the transmission information of the upgrade program.
[0029] In one embodiment of the present invention, if the application program in the program backup area is incomplete, it is checked whether the application program in the program running area is complete.
[0030] Furthermore, if the application in the program running area is complete, the current application in the program running area is run; if the application in the program running area is incomplete, wait for receiving the upgrade program, and execute steps S2 to S4 after receiving the transmission information of the upgrade program, that is, the upgrade program header frame.
[0031] In one embodiment of the present invention, the integrity of the application program can be verified by performing MD5 verification on the program data in the program backup area, the program running area or the entire application storage area.
[0032] The following will refer to Figure 2 The specific flow chart of the DSP program online upgrade method shown further describes the DSP program online upgrade method of the embodiment of the present invention.
[0033] like Figure 2 As shown, after the DSP is powered on or receives an update command from the host computer during the running of the application, it runs the Bootloader program and can verify whether the application in the application storage area is complete through MD5.
[0034] Furthermore, if the application in the application storage area is complete and no upgrade program header frame is received within 3S, the current application in the program running area is run; if the application in the application storage area is complete and an upgrade program header frame is received within 3S, and if the application in the application storage area is incomplete and an upgrade program header frame is received, the original data in the program backup area is erased.
[0035] Furthermore, after erasing the original data in the program backup area, the upgrade program data can be written into the program backup area frame by frame, wherein each time a frame of upgrade program data is received, a CRC check is performed. If the upgrade program data in that frame is correct, the upgrade program data in that frame is written into the program backup area. In this way, it can be verified whether each frame of upgrade program data to be written into the program backup area is correct, and each frame of upgrade program data that passes the check is written into the program backup area.
[0036] Furthermore, after the upgrade program is completely written to the program backup area, MD5 can be used to verify whether the application in the program backup area is complete. If the application in the program backup area is complete, then after erasing the original data in the program running area, the current application in the program backup area will be written to the program running area, and the current application in the program running area will be run; if the application in the program backup area is incomplete, MD5 can be used to verify whether the application in the program running area is complete.
[0037] Furthermore, if the application program in the program running area is complete, the current application program in the program running area is run; if the application program in the program running area is incomplete, the process returns to the step of waiting to receive the upgrade program.
[0038] According to the DSP program online upgrade method proposed in the embodiment of the present invention, the DSP runs the Bootloader program after receiving the upgrade instruction during the application program running process, and writes the upgrade program to the program backup area after erasing the original data in the program backup area, and verifies whether the application in the program backup area is complete. If the application in the program backup area is complete, the current application in the program backup area is written to the program running area after erasing the original data in the program running area. In this way, the upgrade program written during the online upgrade can be verified, thereby ensuring the integrity of the written upgrade program and improving the security of the device executing the upgrade program.
[0039] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0040] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A DSP program online upgrade method, characterized in that: The Flash of the DSP includes a Bootloader program storage area and an application storage area, the application storage area includes a program backup area and a program running area, and the method includes the following steps: S1, after receiving an upgrade instruction during the running of the application program, the DSP runs the Bootloader program; S2, after erasing the original data in the program backup area, writing the upgrade program into the program backup area; S3, verifying whether the application program in the program backup area is complete; S4, if the application program in the program backup area is complete, then after erasing the original data in the program running area, the current application program in the program backup area is written into the program running area, The DSP program online upgrade method also includes: After the DSP is powered on, it runs the Bootloader program and verifies whether the application programs in the application program storage area are complete; If the application programs in the application program storage area are complete and the transmission information of the upgrade program is not received within a preset time, running the current application program in the program running area; If the application program in the application program storage area is complete and the transmission information of the upgrade program is received within the preset time, then executing steps S2 to S4; If the application program in the application program storage area is incomplete, wait for receiving the upgrade program, and execute steps S2 to S4 after receiving the transmission information of the upgrade program. The DSP program online upgrade method also includes: if the application in the program backup area is incomplete, checking whether the application in the program running area is complete; if the application in the program running area is complete, running the current application in the program running area; if the application in the program running area is incomplete, waiting to receive the upgrade program, and executing steps S2 to S4 after receiving the transmission information of the upgrade program.
2. The DSP program online upgrade method according to claim 1, characterized in that: Also includes: Before writing the upgrade program into the program backup area, verify whether the upgrade program is correct.
3. The DSP program online upgrade method according to claim 1 or 2, characterized in that: The integrity of the application program is verified by performing MD5 verification on the program data in the program backup area, the program running area or the entire application storage area.
4. The DSP program online upgrade method according to claim 2, characterized in that: The CRC check is performed on each frame of the upgrade program data to be written into the program backup area to check whether the upgrade program is correct.
Citation Information
Patent Citations
Unmanned aerial vehicle firmware updating method, device, unmanned aerial vehicle and storage medium
CN109117168A
Controller and software upgrading method and device thereof
CN110134415A