Program on-orbit upgrading system based on DSP
By designing a program on-orbit upgrade system based on DSP, the problem that the DSP flight system cannot be upgraded in orbit is solved, the online maintenance and upgrade of the DSP software is realized, the reliability and safety of the system are improved, and the equipment is ensured under abnormal conditions. of normal operation.
Patent Information
- Application Number
- CN202410430116.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2024-08-23
AI Technical Summary
The existing DSP flight system cannot achieve on-orbit software maintenance and upgrades. In particular, dedicated PROM chips require special tools for programming and solidification, and cannot be debugged and loaded online.
A DSP-based program on-orbit upgrade system is designed, including an upgrade code generation module, an upgrade code receiving module, a program switching module and a secondary boot module. The upgrade program is received through an external communication interface and stored in a non-volatile, reusable state after power failure. In the online read-write memory, the on-orbit maintenance of the DSP software is realized, and the program loading and running are automatically completed through the secondary boot module, and a fault-tolerant mechanism is added to ensure the normal startup of the equipment under abnormal circumstances.
It realizes on-orbit maintenance and upgrade of DSP software, improves the reliability and safety of software operation, avoids the problem of equipment being unable to start normally due to abnormal on-orbit upgrade, and ensures the normal start-up and operation of equipment under abnormal circumstances.
Smart Images

Figure CN118535199A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a DSP-based on-orbit program upgrade system. Background Art
[0002] In order to meet the requirements of modern spacecraft for long life, on-orbit maintainability, and autonomous health management, space flight equipment usually needs to have the ability to be upgraded on-orbit to cope with possible mission expansions and potential software defects.
[0003] During the development of flight systems with DSP as the core, simulators are usually used to debug and load online through the JTAG (Joint Test Action Group) interface. For dedicated PROM chips, special tools are required for burning and curing; it is impossible to perform on-orbit maintenance of DSP software.
[0004] Therefore, a DSP-based on-orbit program upgrade system is needed. Summary of the invention
[0005] The present invention is to solve the problem of DSP on-orbit upgrade, and provides a DSP-based on-orbit program upgrade system, including an upgrade code generation module, an upgrade code receiving module, a program switching module, and a secondary boot module. The system receives the upgrade program through an external communication interface and stores it in a non-volatile memory that can be read and written online when the power is off; the program switching is controlled by external instructions, and the loading and running of the upgrade program is realized through the secondary boot module; thereby realizing the on-orbit maintenance of the DSP software. The upgrade code generation module increases the flexibility of program loading by adding the segment length and segment running address before the loaded segment, so that the secondary boot module can automatically complete the complete loading of any number of segments of the program. In order to improve the reliability and security of software operation, the secondary boot module adds a fault-tolerant mechanism to ensure that the device can still start normally in the event of an abnormal upgrade. The present invention is also suitable for secondary program loading and on-orbit upgrade applications of the CPU system of satellite-borne equipment.
[0006] The present invention provides a DSP-based program on-orbit upgrade system, comprising an upgrade code generation module arranged on the ground and a communication interface connected to a spacecraft, an upgrade code receiving module, a code storage space allocation module, a memory, a DSP operating system, a program switching module, and a secondary boot module;
[0007] The upgrade code receiving module is electrically connected to the communication interface, the code storage space allocation module, and the memory; the DSP operating system is electrically connected to the memory, the program switching module, and the secondary boot module; the program switching module is connected to the communication interface; the program switching module triggers the watchdog and triggers the secondary boot module through the watchdog;
[0008] The upgrade code generation module generates the DSP upgrade code that can be automatically loaded by the secondary boot module; the DSP upgrade code includes at least two groups of upgrade segments, and the upgrade segments are stored in sequence according to the following format: segment length, segment running address and segment content;
[0009] The upgrade code receiving module receives the DSP upgrade code through the communication interface according to the external bus command and stores it into the memory according to the storage space allocated by the code storage space allocation module;
[0010] The DSP factory program is burned into the memory before the spacecraft is launched;
[0011] The program switching module receives an external bus command through a communication interface and sets a loading identification setting according to the external bus command and switches between a factory program and an upgrade program;
[0012] The secondary boot module loads and runs the DSP factory program or DSP upgrade program according to the loading identifier through DMA and completes the on-orbit upgrade of the DSP operating system.
[0013] The DSP-based on-orbit program upgrade system described in the present invention is, as a preferred method, an upgrade code generation module injects a C entry address into the DSP upgrade code; after completing the loading of the DSP upgrade program, the secondary boot module jumps to the corresponding C entry address, enters the main program and runs the program;
[0014] The upgrade code generation module makes the storage length of each upgrade segment an integer multiple of 4 bytes during the upgrade code generation process; when the upgrade segment length is not an integer multiple of 4 bytes, the upgrade code generation module fills the segment content during the storage of the DSP upgrade code;
[0015] After completing the generation of all valid upgrade segments, the upgrade code generation module performs at least 8 bytes of zero padding at the end of the DSP upgrade code as an upgrade code end marker.
[0016] In the DSP-based on-orbit program upgrade system described in the present invention, as a preferred embodiment, the secondary boot module only loads the segment content of the effective length during the process of loading the DSP upgrade code.
[0017] The DSP-based on-orbit program upgrade system described in the present invention is preferably configured such that the effective upgrade segments include a vector table upgrade code, a .text segment upgrade code, a .cinit segment upgrade code, a .const segment upgrade code and a .switch segment upgrade code.
[0018] The DSP-based on-orbit program upgrade system described in the present invention is, as a preferred embodiment, a code storage space allocation module allocates independent storage spaces for the DSP factory program and the DSP upgrade code respectively, the storage space of the DSP factory program is readable online, and the storage space of the DSP upgrade code is readable and writable online;
[0019] The code storage space allocation module allocates the space for the interrupt vector table and the secondary boot module in the same way as the space mapping of the internal program RAM area of the DSP operating system. The DSP operating system can automatically complete the loading and operation of the interrupt vector table and the secondary boot module.
[0020] The DSP-based on-orbit program upgrade system described in the present invention is preferably configured such that when the upgrade code receiving module receives the DSP upgrade code, the loading flag is first set to the factory state and then the DSP upgrade code is saved;
[0021] The loading flag is stored in a non-volatile memory that is readable and writable online when power is off;
[0022] If an abnormal situation occurs during the DSP on-orbit upgrade, the DSP operating system will re-run the DSP factory program by powering on or resetting. The abnormal situation includes power failure and upgrade error.
[0023] The DSP-based on-orbit program upgrade system described in the present invention is preferably configured such that the program switching module switches and loads the DSP factory program and the DSP upgrade code by resetting.
[0024] The DSP-based on-orbit program upgrade system described in the present invention is preferably configured such that when the secondary boot module loads the DSP upgrade code, the number of program loading errors is judged. If the DSP upgrade code fails to load three times in a row, the loading flag is set to the factory program.
[0025] The secondary boot module selects to load the data from the factory program storage space or the upgrade program storage space in the memory according to the loading identifier, and loads the subsequent segment content through DMA according to the stored segment length and segment running address; after reading that the segment length is 0, the secondary loading process is automatically ended, and jumps to the C program entry address _c_int00. After completing the initialization of the C running environment, it enters the main() function and runs the user application.
[0026] Different from embedded chips such as single-chip microcomputers and ARM, the burning and loading of executable files of DSP chips usually require users to write programs to achieve. In the process of loading DSP programs, secondary loading is usually required to achieve the complete operation of the program. The present invention realizes the loading and running of the upgrade program with the minimum amount of code by universally designing the secondary boot program.
[0027] The present invention is also applicable to secondary program loading and on-orbit upgrade applications of a CPU system of a satellite-borne device.
[0028] The present invention has the following advantages:
[0029] (1) The code storage space allocation module can open up two storage spaces, allocating independent storage spaces for the factory program and the upgrade program, to avoid the factory program being overwritten by the wrong program code due to an abnormal in-orbit upgrade, resulting in the device being unable to start normally.
[0030] (2) A secondary boot module is set up and a fault-tolerant mechanism is set up in the secondary boot module. Even if an abnormality occurs during the loading process of the DSP upgrade program, the on-orbit device can still start normally, ensuring the effectiveness of the program after loading.
[0031] (3) By adding the segment length and segment running address before the segment program to be loaded, the flexibility of program loading is increased, so that the secondary boot program can completely load programs with any number of segments.
[0032] (4) The present invention receives the upgrade program through an external communication interface and stores it in a non-volatile memory that can be read and written online. The program switching is controlled by external instructions, and the loading and running of the upgrade program is realized through the secondary boot module, thereby realizing on-orbit maintenance of the DSP software. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a schematic diagram of a DSP-based on-orbit program upgrade system;
[0034] Figure 2 It is a map of the upgrade code storage space of a DSP-based program on-orbit upgrade system;
[0035] Figure 3a It is a factory program map of a DSP-based on-orbit program upgrade system;
[0036] Figure 3b The present invention is a mapping diagram of the DSP internal program RAM area of a DSP-based program on-orbit upgrade system.
[0037] Reference numerals:
[0038] 1. Upgrade code generation module; 2. Communication interface; 3. Upgrade code receiving module; 4. Code storage space allocation module; 5. Memory; 6. DSP operating system; 7. Program switching module; 8. Secondary boot module. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0040] Example 1
[0041] like Figure 1 As shown in Figure 3, a DSP-based on-orbit program upgrade system includes an upgrade code generation module 1 arranged on the ground and a communication interface 2 connected to the spacecraft, an upgrade code receiving module 3, a code storage space allocation module 4, a memory 5, a DSP operating system 6, a program switching module 7, and a secondary boot module 8;
[0042] The upgrade code receiving module 3 is electrically connected to the communication interface 2, the code storage space allocation module 4, and the memory 5, the DSP operating system 6 is electrically connected to the memory 5, the program switching module 7, and the secondary boot module 8, and the program switching module 7 is connected to the communication interface 2;
[0043] The upgrade code generation module 1 generates a DSP upgrade code that can be automatically loaded by the secondary boot module 8; the DSP upgrade code includes at least two groups of upgrade segments, and the upgrade segments are stored in sequence according to the following format: segment length, segment running address and segment content;
[0044] The upgrade code receiving module 3 receives the DSP upgrade code through the communication interface 2 according to the external bus command and stores it in the memory 5 according to the storage space allocated by the code storage space allocation module 4;
[0045] The DSP factory program is burned into memory 5 before the spacecraft is launched;
[0046] The program switching module 7 sets the loading identification setting according to the external bus command and switches between the factory program and the upgrade program;
[0047] The secondary boot module 8 loads and runs the DSP factory program or the DSP upgrade program according to the loading identifier through DMA and completes the on-track upgrade of the DSP operating system 6;
[0048] The upgrade code generation module 1 injects the C entry address into the DSP upgrade code; after completing the loading of the DSP upgrade program, the secondary boot module 8 jumps to the corresponding C entry address, enters the main program and runs the program;
[0049] The upgrade code generation module 1 makes the storage length of each upgrade segment an integer multiple of 4 bytes during the upgrade code generation process; when the upgrade segment length is not an integer multiple of 4 bytes, the upgrade code receiving module 3 fills the segment content during the storage of the DSP upgrade code;
[0050] After completing the generation of all valid upgrade segments, the upgrade code generation module 1 performs at least 8 bytes of zero padding at the end of the DSP upgrade code as an upgrade code end mark;
[0051] The secondary boot module 8 only loads the segment contents of the valid length during the process of loading the DSP upgrade code. The valid upgrade segments include the vector table upgrade code, the .text segment upgrade code, the .cinit segment upgrade code, the .const segment upgrade code and the .switch segment upgrade code.
[0052] The code storage space allocation module 4 allocates independent storage space for the DSP factory program and the DSP upgrade code respectively. The storage space of the DSP factory program can be read online, and the storage space of the DSP upgrade code can be read and written online.
[0053] The code storage space allocation module 4 allocates the space for the interrupt vector table and the secondary boot module 8 in the same way as the space mapping of the internal program RAM area of the DSP operating system 6. The DSP operating system 6 can automatically complete the loading and operation of the interrupt vector table and the secondary boot module 8.
[0054] When the upgrade code receiving module 3 receives the DSP upgrade code, it first sets the loading flag to the factory state and then saves the DSP upgrade code;
[0055] The loading flag is stored in a non-volatile memory that is readable and writable online when power is off;
[0056] If an abnormal situation occurs during the DSP on-orbit upgrade, the DSP operating system 6 re-runs the DSP factory program by powering on or resetting. The abnormal situation includes power failure and upgrade error;
[0057] The program switching module 7 switches and loads the DSP factory program and the DSP upgrade code by resetting;
[0058] When the secondary boot module 8 loads the DSP upgrade code, it determines the number of program loading errors. If the DSP upgrade code fails to load three times in a row, the loading flag is set to the factory program.
[0059] The secondary boot module 8 selects to load the data from the factory program storage space or the upgrade program storage space in the memory 5 according to the loading identifier, and loads the subsequent segment content through DMA according to the stored segment length and segment running address; after reading that the segment length is 0, the secondary loading process is automatically ended, and jumps to the C program entry address _c_int00. After completing the initialization of the C running environment, it enters the main() function to run the user application.
[0060] The upgrade code generation module 1 adds information such as the segment length and the segment running address before the loaded segment, so that the secondary boot program can automatically complete all segment loading work.
[0061] The upgrade code generation module is only used to upgrade the user application program, and does not upgrade or reload the secondary boot program. DSP software usually only needs to load the interrupt vector table (.vectors segment), code segment (.text segment), .cinit segment, .const segment, and .switch segment. The C entry address (_c_int00), segment length, and segment running address can all be obtained from the .map file and used to upgrade the code generation module as follows: Figure 2 Generate the upgrade code as shown. By injecting the C entry address of the on-track upgrade program, the secondary boot module can jump to the corresponding C entry address after completing the loading of the upgrade program, enter the main program, and run the program. During the upgrade code generation process, it is necessary to ensure that the storage length of each segment is an integer multiple of 4 bytes; if the segment length does not meet the requirements, the segment content is filled during the storage process. During the loading process, only the segment content of the valid length is loaded. For example: the .const segment length of DSP is usually not aligned with 4 bytes. When it is 0xea, the segment length is still written as 0xea, and space of 0xec is opened for the segment content. The last two bytes are filled with 0x00; the secondary boot module loads the data length of 0xea for the .const segment to the internal RAM area of DSP. After completing the generation of all valid segments, it is necessary to fill at least 8 bytes of zeros at the end of the upgrade code as the end mark of the upgrade code. As shown Figure 2 As shown in the figure, after the code generation of the C entry address (_c_int00), interrupt vector table (.vectors segment), code segment (.text segment), .cinit segment, .const segment and .switch segment is completed, 8 bytes 0x00 are filled at the end of the upgrade code as the end mark of the upgrade code.
[0062] The upgrade code receiving module 3 is used to complete the on-orbit reception and storage of the upgrade code according to the external bus command. The specific implementation is: when the DSP program receives the upgrade code, it first sets the loading flag to the factory state, and then saves the upgrade code. It ensures that during the on-orbit upgrade process of the program, if there is an abnormal situation such as power failure or upgrade error, the device can re-run the factory program by powering on / resetting.
[0063] The program switching module 7 is used to set the loading mark according to the external bus command to complete the switching between the factory program and the upgrade program.
[0064] The loading flag is divided into the loading factory program flag and the loading upgrade program flag. The loading flag needs to be stored in the power-off non-volatile memory, which has the online read-write function. After the DSP receives the external switching command, it will always work in the specified mode and will not be affected by power failure. Usually, program switching and loading are achieved through hardware reset.
[0065] The secondary boot module 8 is used to complete the loading and running of the factory program or the upgrade program according to the loading identifier, and is implemented in assembly language. The specific implementation is: in order to improve the reliability and security of the software, before the secondary loading, the DSP internal program RAM area and the entire data RAM area are filled with empty instructions. After the filling is completed, the secondary loading module is only used to load the valid area of the DSP internal program and data RAM area. The number of errors in program loading is judged. If the program is loaded with errors three times in a row, the loading identifier is set to load the factory program. According to the loading identifier, the data of the factory program storage space or the upgrade program storage space is selected to be loaded, and the content of the segment that follows is loaded through DMA according to the stored segment length and segment running address. After reading that the segment length is 0, the secondary loading process is automatically ended, and jumps to the C program entry address _c_int00. After completing the initialization of the C operating environment, the main() function is entered to run the user application.
[0066] When designing DSP software and hardware, space allocation is performed according to the following code storage space allocation module.
[0067] The code storage space allocation module is used to allocate two storage spaces for the factory program and the upgrade program to allocate independent storage space, so as to avoid the factory program being overwritten by the wrong program code due to abnormal in-orbit upgrade, and the device cannot start normally. Among them, the upgrade program storage space must have the function of non-volatile power failure and online reading and writing; the factory program storage space only needs to have the function of non-volatile power failure and online reading.
[0068] The upgrade program is stored in the magnetic memory MRAM which is readable and writable, non-volatile when power is off and immune to single particle effects, and the factory program is stored in the read-only PROM.
[0069] like Figure 3a , 3b As shown, in the code storage space allocation module, the space allocation of the interrupt vector table and the secondary boot program is consistent with the space allocation of the DSP internal program RAM area, and the DSP hardware automatically completes the loading and running.
[0070] The present invention can meet the use of different hardware environments and multiple application scenarios. It can realize program loading in scenarios such as loading only the data area, insufficient loading space at one time to store the complete user program code, inconsistent allocation of loading space at one time with the internal program RAM area space, and program in-orbit upgrade.
[0071] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A DSP-based on-orbit program upgrade system, characterized by: It comprises an upgrade code generation module (1) arranged on the ground, a communication interface (2) connected to the spacecraft, an upgrade code receiving module (3), a code storage space allocation module (4), a memory (5), a DSP operating system (6), a program switching module (7), and a secondary boot module (8); The upgrade code receiving module (3) is electrically connected to the communication interface (2), the code storage space allocation module (4), and the memory (5); the DSP operating system (6) is electrically connected to the memory (5), the program switching module (7), and the secondary boot module (8); and the program switching module (7) is connected to the communication interface (2); The upgrade code generation module (1) generates a DSP upgrade code that can be automatically loaded by the secondary boot module (8); the DSP upgrade code includes at least two groups of upgrade segments, and the upgrade segments are stored in sequence according to the following format: segment length, segment running address and segment content; The upgrade code receiving module (3) receives the DSP upgrade code through the communication interface (2) according to the external bus command and stores it in the memory (5) according to the storage space allocated by the code storage space allocation module (4); Before the spacecraft is launched, a DSP factory program is burned into the memory (5); The program switching module (7) receives an external bus command through the communication interface (2), sets a loading identifier according to the external bus command, and switches between the factory program and the upgrade program; The secondary boot module (8) loads and runs the DSP factory program or the DSP upgrade program according to the loading identifier through DMA and completes the on-track upgrade of the DSP operating system (6).
2. The DSP-based on-orbit program upgrade system according to claim 1, characterized in that: The upgrade code generation module (1) injects the C entry address into the DSP upgrade code; after completing the loading of the DSP upgrade program, the secondary boot module (8) jumps to the corresponding C entry address, enters the main program and runs the program; The upgrade code generation module (1) makes the storage length of each upgrade segment an integer multiple of 4 bytes during the upgrade code generation process; When the upgrade segment length is not an integer multiple of 4 bytes, the upgrade code generation module (1) fills the segment content in the process of storing the DSP upgrade code; After completing the generation of all valid upgrade segments, the upgrade code generation module (1) performs at least 8 bytes of zero padding at the end of the DSP upgrade code as an upgrade code end mark.
3. The DSP-based on-orbit program upgrade system according to claim 2, characterized in that: The secondary boot module (8) only loads the content of the segment with a valid length during the process of loading the DSP upgrade code.
4. The DSP-based on-orbit program upgrade system according to claim 2, characterized in that: The effective upgrade segment includes a vector table upgrade code, a .text segment upgrade code, a .cinit segment upgrade code, a .const segment upgrade code and a .switch segment upgrade code.
5. The DSP-based on-orbit program upgrade system according to claim 1, characterized in that: The code storage space allocation module (4) allocates independent storage space for the DSP factory program and the DSP upgrade code respectively, the storage space of the DSP factory program can be read online, and the storage space of the DSP upgrade code can be read and written online; The space allocation of the code storage space allocation module (4) for the interrupt vector table and the secondary boot module (8) is the same as the space mapping of the internal program RAM area of the DSP operating system (6), and the DSP operating system (6) can automatically complete the loading and operation of the interrupt vector table and the secondary boot module (8).
6. The DSP-based on-orbit program upgrade system according to claim 1, characterized in that: When the upgrade code receiving module (3) receives the DSP upgrade code, it first sets the loading flag to the factory state and then saves the DSP upgrade code; The loading identifier is stored in a memory that is non-volatile when power is off and is readable and writable online; If an abnormal situation occurs during the DSP on-orbit upgrade process, the DSP operating system (6) re-runs the DSP factory program by powering on or resetting. The abnormal situation includes power failure and upgrade error.
7. The DSP-based on-orbit program upgrade system according to claim 1, characterized in that: The program switching module (7) switches and loads the DSP factory program and the DSP upgrade code through resetting.
8. The DSP-based on-orbit program upgrade system according to claim 1, characterized in that: The secondary boot module (8) judges the number of program loading errors when loading the DSP upgrade code, and if the DSP upgrade code fails to load three times in a row, sets the loading flag to the factory program; The secondary boot module (8) selects to load the data of the factory program storage space or the upgrade program storage space in the memory (5) according to the loading identifier, and loads the content of the segment immediately following it through DMA according to the stored segment length and the segment running address; after reading that the segment length is 0, the secondary loading process is automatically ended, and the program is jumped to the C program entry address _c_int00, and after completing the initialization of the C running environment, the main() function is entered to run the user application program.
