A general DSP processor online upgrading method
By employing a dual-redundancy design for areas A and B through bootloader and flag management, and utilizing the DSP processor's inherent communication bus to achieve online upgrades, the problem of difficult hardware disassembly and maintenance in existing technologies is solved, enabling reliable online upgrades and fault recovery.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING AEROSPACE INST OF THE LONG MARCH VEHICLE
- Filing Date
- 2023-04-27
- Publication Date
- 2026-07-07
AI Technical Summary
Existing online upgrade methods for DSP processors require disassembling the hardware for software updates, which is difficult to maintain in the field and cannot achieve reliable online upgrades through the inherent communication interface.
It adopts a dual-redundancy design with areas A and B, utilizes bootloader and flag management, and achieves online upgrades through the inherent communication bus, ensuring multiple reliable upgrades without adding hardware.
It enables software upgrades via a built-in communication interface without disassembling the equipment, ensuring the reliability and versatility of the upgrades and supporting fault recovery and re-upgrades at any time.
Smart Images

Figure CN117234546B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a generalized online upgrade method for DSP processors, belonging to the field of embedded electronics technology. Background Technology
[0002] With the development of information technology and intelligence in aircraft, the functions implemented by their software are becoming increasingly complex, and the frequency of software upgrades and maintenance is increasing. Updating software via JTAG interface after the product is already assembled is not only time-consuming, but also requires redoing numerous hardware tests to ensure reliability. This method is extremely difficult to maintain when debugging on-site or when there are many devices. Online upgrade technology effectively solves this problem. Without disassembling the equipment, the host computer software reads and packages the executable file, and uses the system's external communication port to send the data to the slave computer, thereby directly upgrading the software.
[0003] DSP data processors possess powerful data processing capabilities and are widely used in aerospace and other fields. Taking the 6713 as an example, the chip itself does not contain FLASH memory and requires an external EMIF bus. The chip itself has a primary bootloader, but the running software requires a secondary bootloader design. Online upgrade functionality necessitates considering the reliability of dual redundancy backups and a design that is as universal as possible during booting. Summary of the Invention
[0004] The technical problem solved by this invention is to overcome the shortcomings of the prior art and provide a universal online upgrade method for DSP processors, which can achieve multiple and reliable online upgrades without adding hardware.
[0005] The technical solution of this invention is:
[0006] This invention discloses a generalized online upgrade method for DSP processors, comprising:
[0007] Allocate storage space for the bootloader, application A area, application B area, B area valid flag, and B area first run flag;
[0008] Initialize the valid flag and the first-time operation flag for Zone B;
[0009] Perform application design;
[0010] Store the bootloader and application A in the allocated storage space;
[0011] The bootloader reads the valid flag and first-run flag of area B to confirm the running application area A.
[0012] Receive online upgrade data and upgrade instructions, load the upgrade data into the application's B storage space, and perform the program upgrade;
[0013] Determine if the program upgrade was successful. If not, proceed to the upgrade error handling procedure; otherwise, proceed to the post-upgrade handling procedure.
[0014] After a power outage and subsequent power restoration, the bootloader determines whether to run application area A or application area B based on the valid flag and first-run flag of area B.
[0015] Furthermore, in the above upgrade method, the initialization of the valid flag and the first-run flag of area B specifically involves setting the valid flag of area B to NO and the first-run flag of area B to NO.
[0016] Furthermore, in the above upgrade method, the application design specifically includes: the application includes application area A and application area B; application area A includes program header A and application segment A, and application area B includes program header B, flag segment B, and application segment B; application segment A and application segment B have the same content; program header A and program header B are set to different version numbers, and external programs can determine whether area A or area B is currently running by reading the version number; flag segment B reads and determines whether the valid flag of area B is NO, and if so, the valid flag of area B is overwritten to YES.
[0017] Furthermore, in the above upgrade method, the step of confirming the running application A area by reading the valid flag of area B and the first run flag of area B through the boot program is as follows: after storing the boot program and application A in the allocated storage space, the boot program determines that the valid flag of area B is NO and the first run flag of area B is NO, then loads application A area and runs it.
[0018] Furthermore, in the above upgrade method, the step of receiving online upgrade data and upgrade instructions, loading the upgrade data into the application's B-area storage space, and performing the program upgrade specifically involves:
[0019] Receive upgrade data and upgrade instructions, and perform CRC verification on the upgrade data;
[0020] If the verification passes, the verified upgrade data is written to the application's B-zone storage space according to the upgrade command; otherwise, an upgrade data error is reported to the ground, and the system waits for the ground to send the upgrade command again.
[0021] Furthermore, in the above upgrade method, the upgrade error handling procedure specifically involves setting both the valid flag of area B and the first-run flag of area B to NO.
[0022] Furthermore, in the above upgrade method, the upgraded processing procedure is specifically as follows: upon the first power-on after the upgrade, the first-run flag of area B is set to YES and the valid flag of area B is set to NO; upon power-on again, the first-run flag of area B is set to NO and the valid flag of area B is set to YES.
[0023] Furthermore, in the above upgrade method, the boot program determines whether to run application area A or application area B based on the valid flag of area B and the first run flag of area B. Specifically, if the boot program determines that the first run flag of area B is YES and the valid flag of area B is NO, or if the first run flag of area B is NO and the valid flag of area B is YES, then it runs application area B; otherwise, it runs application area A.
[0024] Furthermore, the above upgrade method supports upgrading again after an upgrade failure occurs at any time.
[0025] Furthermore, in the above upgrade method, the upgrade data is transmitted using an inherent communication bus.
[0026] The advantages of this invention over the prior art are as follows:
[0027] (1) This invention solves the problem of not being able to program via JTAG and enables software upgrades through communication via the inherent communication interface of the equipment, such as serial port;
[0028] (2) The present invention adopts a dual redundancy design of area A and area B, which solves the problem that when the upgrade file is faulty, the application can still be executed through area A or the upgrade can be performed again;
[0029] (3) This invention enables the system to be upgraded again after a power failure or other fault at any time by setting and reading judgment identifiers. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0031] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] like Figure 1 As shown, this invention discloses a generalized online upgrade method for DSP processors, comprising:
[0033] Step 1: Allocate storage space for the bootloader, application A area, application B area, B area valid flag, and B area first run flag;
[0034] Step 2: Initialize the valid flag and the first-run flag for area B;
[0035] Step 3: Design the application.
[0036] Step 4: Store the bootloader and application A in the allocated storage space;
[0037] Step 5: Read the valid flag and first-run flag of area B through the bootloader to confirm the running application area A;
[0038] Step 6: Receive online upgrade data and upgrade instructions, load the upgrade data into the application's B storage space, and perform the program upgrade;
[0039] Step 7: Determine if the program upgrade was successful. If not, proceed to the upgrade error handling procedure; otherwise, proceed to the post-upgrade handling procedure.
[0040] Step 8: After power off and then power on again, the boot program will determine whether to run application area A or application area B based on the valid flag and the first run flag of area B.
[0041] Preferably, the valid flag of area B and the first-run flag of area B are initialized, specifically by setting the valid flag of area B to NO and the first-run flag of area B to NO.
[0042] Preferably, the application is designed as follows: the application includes an application area A and an application area B; application area A includes a program header A and an application segment A, and application area B includes a program header B, a flag segment B, and an application segment B; application segment A and application segment B have the same content; program header A and program header B are set to different version numbers, and external programs can determine whether the currently running application is in area A or area B by reading the version number; the flag segment B reads and determines whether the valid flag of area B is NO, and if so, the valid flag of area B is overwritten to YES.
[0043] Preferably, the bootloader reads the valid flag and the first-run flag of area B to confirm the running of application area A. Specifically, after storing the bootloader and application A in the allocated storage space, the bootloader determines that the valid flag of area B is NO and the first-run flag of area B is NO, then loads and runs application area A.
[0044] Preferably, the system receives online upgrade data and upgrade instructions, loads the upgrade data into the application's B-area storage space, and performs a program upgrade, specifically as follows:
[0045] Receive upgrade data and upgrade instructions, and perform CRC verification on the upgrade data;
[0046] If the verification passes, the verified upgrade data is written to the application's B-zone storage space according to the upgrade command; otherwise, an upgrade data error is reported to the ground, and the system waits for the ground to send the upgrade command again.
[0047] Preferably, the error handling procedure is upgraded by setting both the valid flag for area B and the first-run flag for area B to NO.
[0048] Preferably, the upgraded processing procedure is as follows: upon first power-on after the upgrade, the first-run flag of area B is set to YES and the valid flag of area B is set to NO; upon power-on again, the first-run flag of area B is set to NO and the valid flag of area B is set to YES.
[0049] Preferably, the bootloader determines whether to run application area A or application area B based on the valid flag and the first run flag of area B. Specifically, if the bootloader determines that the first run flag of area B is YES and the valid flag of area B is NO, or if the first run flag of area B is NO and the valid flag of area B is YES, then application area B is run; otherwise, application area A is run.
[0050] Preferably, it supports upgrading again after an upgrade failure occurs at any time.
[0051] Preferably, the upgrade data is transmitted using an existing communication bus.
[0052] Example
[0053] FLASH storage space allocation design: Fixed FLASH space is allocated for the boot program, application A area, application B area, B area valid flag and B area first run flag. The specific allocation address is shown in Table 1 for example of 6713.
[0054] Table 1 FLASH Address Allocation
[0055]
[0056] Bootloader Design: After the chip powers on, the bootloader runs first, performing basic hardware initialization configuration. Then, it determines whether to load application area A or application area B and jumps accordingly. If the valid flag for application area B in the FLASH memory is YES or the first-run flag for area B is YES, then area B is loaded; otherwise, area A is loaded and a jump occurs. Figure 1 As shown.
[0057] Application Design: Applications in Area A and Area B are basically the same, with two main differences. Difference 1: At startup, the program in Area B checks if the valid flag for Area B is NO. If it is NO, it overwrites it to YES. Then it executes its own task function or online upgrade function. Difference 2: The version numbers set in Area A and Area B are different. The current version number can be read using ground commands, clearly and easily confirming whether Area A or Area B is currently running.
[0058] Online upgrade communication design: The online upgrade uses the same hardware communication interface as other task function instructions. During online software upgrade, the first-run flag in area B is set to YES, and the area B valid flag is set to NO. Then, the upgrade software is written to area B in the FLASH memory. Regardless of whether the currently running program is in area A or area B, the upgrade only upgrades area B; that is, only the FLASH memory in area B is erased and written.
[0059] Anti-incorrect upgrade file selection design: Only the correct upgrade file contains the content to erase and reset the valid flag of area B to YES if it is not YES. Therefore, when an incorrect file is selected, the valid flag of area B will not be changed. This ensures that after power-on, the bootloader determines that both the valid flag of area B and the first-run flag of area B are NO, and enters area A, allowing subsequent upgrades to continue.
[0060] Programming and upgrade process:
[0061] a. After completing the bootloader, Area A program, and Area B program, the bootloader and Area A program are burned to the corresponding areas of the FLASH via the JTAG port for the first time. The valid flag for Area B is set to NO, and the first run flag for Area B is also set to NO.
[0062] b. Power on the device, load the upgrade file from area B via the host computer, send upgrade data and instructions, and write the software to area B of the FLASH memory. After a successful upgrade, the area B valid flag is set to NO, and the first-run flag is set to YES.
[0063] c. Upon first power-on after the upgrade, the bootloader determines that the first-run flag for partition B is YES, and then loads the partition B program. If the partition B program is valid, the loaded partition B program will set the partition B validity flag to YES. Figure 1 As shown.
[0064] d. Upon subsequent power-on, the first-run flag for partition B has been set to NO. If the correct file was selected during the upgrade in step b, the valid flag for partition B during the upgrade in step c will be set to valid YES, and partition B will continue to be loaded. If the wrong file was selected during the upgrade in step b, and it is a garbled file, the valid flag for partition B during the upgrade in step c will not be set to YES. In this case, both the valid flag and the first-run flag for partition B will be NO, and partition A will be loaded.
[0065] Based on the above process, regardless of the circumstances, either partition A or partition B can be successfully loaded, and applications in partition A or B can continue to support the upgrade process. This ensures the reliable and sustainable completion of the upgrade process even in the event of abnormal power outages or incorrect file selection.
[0066] The above description is only the best specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.
[0067] The contents not described in detail in this specification are common knowledge to those skilled in the art.
Claims
1. A universal online upgrade method for DSP processors, characterized in that, include: Allocate storage space for the bootloader, application A area, application B area, B area valid flag, and B area first run flag; Initialize the valid flag and the first-time operation flag for Zone B; Perform application design; Store the bootloader and application A in the allocated storage space; The bootloader reads the valid flag and first-run flag of area B to confirm the running application area A. Receive online upgrade data and upgrade instructions, load the upgrade data into the application's B storage space, and perform the program upgrade; Determine if the program upgrade was successful; if not, proceed to the upgrade error handling procedure. Otherwise, proceed with the upgraded processing procedure; After a power outage and subsequent power restoration, the bootloader uses the valid flag of area B and the first-run flag of area B to determine whether to run application area A or application area B. The upgraded processing procedure is as follows: upon first power-on after the upgrade, the first-run flag of area B is set to YES and the valid flag of area B is set to NO. Upon power-on again, the first-run flag of area B is set to NO and the valid flag of area B is set to YES.
2. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: The initialization of the valid flag and the first-run flag of area B is specifically performed by setting the valid flag of area B to NO and the first-run flag of area B to NO.
3. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: The application design specifically includes: an application area A and an application area B; application area A includes a program header A and an application segment A, and application area B includes a program header B, a flag segment B, and an application segment B; application segment A and application segment B have the same content; program header A and program header B are set to different version numbers, and external programs can determine whether they are currently running in area A or area B by reading the version number; the flag segment B reads and determines whether the valid flag of area B is NO, and if so, it is overwritten to YES.
4. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: The process of confirming the running of application A by reading the valid flag and first-run flag of area B through the bootloader is as follows: after storing the bootloader and application A in the allocated storage space, the bootloader determines that the valid flag of area B is NO and the first-run flag of area B is NO, then loads and runs application A.
5. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: The process of receiving online upgrade data and upgrade instructions, loading the upgrade data into the application's B-area storage space, and performing the program upgrade specifically involves: Receive upgrade data and upgrade instructions, and perform CRC verification on the upgrade data; If the verification passes, the verified upgrade data is written to the application's B-zone storage space according to the upgrade command; otherwise, an upgrade data error is reported to the ground, and the system waits for the ground to send the upgrade command again.
6. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: The upgrade error handling procedure specifically involves setting both the valid flag for area B and the first-run flag for area B to NO.
7. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: The bootloader determines whether to run application area A or application area B based on the valid flag and the first run flag of area B. Specifically, if the bootloader determines that the first run flag of area B is YES and the valid flag of area B is NO, or if the first run flag of area B is NO and the valid flag of area B is YES, then application area B will be run; otherwise, application area A will be run.
8. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: It supports upgrading again after an upgrade failure occurs at any time.
9. The generalized online upgrade method for a DSP processor according to claim 1, characterized in that: Upgrade data is transmitted using the built-in communication bus.