External boot loading method and loading system for satellite-borne DSP (digital Signal processor) program

文档序号:1215066 发布日期:2020-09-04 浏览:3次 中文

阅读说明:本技术 一种星载dsp程序外部引导加载方法及加载系统 (External boot loading method and loading system for satellite-borne DSP (digital Signal processor) program ) 是由 武昆 宋克非 孙亮 代霜 张佩杰 于 2020-06-04 设计创作,主要内容包括:一种星载DSP程序外部引导加载方法及加载系统,涉及DSP程序加载技术,解决现有DSP程序加载方法存在程序内存必须小于DSP的内部RAM内存,并且如果与外部引导相关的硬件电路或者FPGA时序逻辑出现故障,引导过程将会失败,导致DSP不能工作等问题,由DSP、FPGA和EEPROM依次相连组成。EEPROM中存储三份二级bootloader程序,所述FPGA作为DSP引导加载三取二的关键,实现了SPI通信协议,分别与DSP和EEPROM进行通信,并对EEPROM中的三份二级bootloader程序数据按位进行三取二校验。本发明所述的引导方法同时具有内部引导和外部引导功能,以防外部引导电路硬件或者FPGA程序出现故障,遥控指令能够通过FPGA灵活切换引导方式,保证用户程序正常运行。(A satellite-borne DSP program external guide loading method and a loading system relate to a DSP program loading technology and solve the problems that a program memory must be smaller than an internal RAM memory of a DSP in the existing DSP program loading method, and if a hardware circuit or FPGA time sequence logic related to external guide fails, a guide process fails, the DSP cannot work and the like. The FPGA is used as a key for the DSP to guide and load the three-to-two, the SPI communication protocol is realized, the communication with the DSP and the EEPROM is respectively realized, and the three-to-two verification is carried out on the data of the three-to-two bootloader programs in the EEPROM according to bits. The guiding method has the functions of internal guiding and external guiding simultaneously, so that the external guiding circuit hardware or the FPGA program is prevented from being in failure, the remote control instruction can flexibly switch the guiding mode through the FPGA, and the normal operation of the user program is ensured.)

1. A satellite-borne DSP program boot loading method is characterized by comprising the following steps: the method is specifically realized by the following steps:

step one, electrifying a system, initializing an SPI module and enabling the SPI module to be startedThe SPI clock can be used, and the frequency of the SPI clock is set; enable signal SPISIMO, signal SPISOMI, clock pulse signal SPICLK and chip select signalThe working mode of setting the SPI module is as follows: 8-bit data stream, internal clock and master mode;

step two, the FPGA reads data on three different address segments of the EEPROM byte by byte, performs two-out-of-three verification according to bits, and stores the verified data into a register;

step three, the DSP guides and loads data through the SPI serial port, and the specific process is as follows:

step three, the DSP reads the state of the GPIOF3 port, starts the SPI guide mode and enables a chip selection signalAfter the FPGA identifies the falling edge of the signal from high to low, counting a clock pulse signal SPICLK loaded by the DSP, and sending the verified data stored in the register in the step two to the DSP through a pin SPISOMI;

step two, the DSP calls an SPI _ Boot program, receives keywords, judges whether the received keywords are 0x08AA or not, if yes, executes step three, and if not, executes step three;

step three, starting SPI external guidance, wherein the DSP continuously receives data through an SPI serial port, the two received bytes are respectively set as numerical values of a low-speed clock register and an SPI baud rate register, after 7 bytes are continuously read and discarded, the received data section is copied to a specified address of an internal RAM area of the DSP according to an external guidance file data stream format, then a pointer jumps to a program entry address, a secondary bootloader program of the internal RAM area is started, and the step four is executed;

step three, the DSP clock pulse signal SPICLK does not send pulses any more, the FPGA stops sending data, starts an internal boot mode, jumps to an internal FLASH inlet address to take out a jump instruction, then jumps to a secondary bootloader program of an internal FLASH area, and executes step five;

step four, executing a codetarget jump instruction module of the internal RAM area, jumping a pointer to a WD _ DISABLE module of the RAM area, closing a watchdog in the DSP by the WD _ DISABLE module, jumping the pointer to a two-out-of-three module of the RAM area, reading data from three different storage areas of the user program segment 1 byte by using a three-out-of-two checking method, performing two-out-of-three checking on each byte read respectively, copying the checked data of the user program segment 1 into the RAM area specified by the CMD file, finally jumping the pointer to a user program entry _ C _ INT00, and executing step six;

step five, executing a codetarget skip instruction module of an internal FLASH area, skipping a pointer to a WD _ DISABLE module of the FLASH area, closing a watchdog in the DSP by the WD _ DISABLE module, then skipping the pointer to a two-out-of-three module of the FLASH area, reading data byte by byte in three different storage areas of the user program segment 1 by using a three-out-of-two checking method, performing two-out-of-three checking on each byte respectively read, copying the checked data of the user program segment 1 into a FLASH area designated by a CMD file, finally skipping the pointer to a user program entry _ C _ INT00, and executing step six;

step six, jumping to a main function through a user program entry _ C _ INT00, wherein the main function performs two-out-of-three verification and Flash programming operation on the user program section 2; the specific process is as follows:

sixthly, erasing the sector; erasing a sector I of an internal FLASH by using a Flash API function Flash _ Erase;

sixthly, program segmentation; namely: dividing the user program section 2 into N sections according to the length of the internal RAM area, and burning once in each section; setting t to be 1 and t to be less than or equal to N, wherein t is the number of times of programming;

sixthly, checking the third step by taking the second step; performing three-fetch check on data to be programmed in each section of the user program section 2, and copying the checked data section to an internal RAM area;

sixthly, data programming and verification;

firstly, calling an API function Flash _ Program to burn and write data corresponding to an internal RAM area into an internal FLASH sector I;

secondly, calling an API function Flash _ Verify to Verify whether the data written in the internal FLASH area is correct or not;

sixthly, adding 1 to the programming times t, and circularly executing the step six, the step three and the step six, the step four until all programming is finished;

and step seven, finishing external boot loading of the user program, initializing the DSP and realizing normal operation of the system.

2. The boot loading method for the onboard DSP program according to claim 1, characterized in that: the specific method for checking the third and second data comprises the following steps:

the third check is to judge the three data bit by bit, if the data bit is the same, the same data bit value is taken, if not, the data bit value which occupies most is taken, and the formula of the third check and the second check is as follows:

Figure FDA0002523423660000021

wherein A, B, C are three values respectively,

Figure FDA0002523423660000022

3. The boot loading method for the onboard DSP program according to claim 1, characterized in that: and in the third step, the key word value received by the DSP is changed through the FPGA, and the guide mode switching is realized.

4. The boot loading method for the onboard DSP program according to claim 1, characterized in that: the program is divided into a secondary bootloader program and a user program; the user program respectively stores three internal FLASH segments GH, EF and CD;

the user program will be divided into two parts to run, including a user program section 1 of the internal RAM area and a user program section 2 of the internal FLASH sector I.

5. The boot loading method for the onboard DSP program according to claim 1, characterized in that: in the process of the SPI external boot and the internal boot, the secondary bootloader program consists of a codetarget jump instruction module, a WD _ DISABLE module and a three-fetch check module.

6. The boot loading method for the onboard DSP program according to claim 1, characterized in that: thirdly, acquiring the data content of each program in the data stream by adopting two methods according to the data stream format of the external boot file; firstly, through the relationship between the jump instruction content and the jump destination address, namely: the first word of the jump instruction is the upper sixteen bits of the destination address plus a fixed numerical value 0x40, and the second word is the lower sixteen bits of the destination address, so that the data stream of the SPI external boot file is obtained; and secondly, acquiring the data stream of the SPI external boot file by changing the CMD file of the program.

7. The loading system of the boot loading method of the satellite-borne DSP program according to claim 1, characterized in that: the FPGA comprises an SPI communication module and a third check module; the EEPROM is used for storing three secondary bootstrap data segments;

the SPI communication module is used for communicating with the DSP and the EEPROM, and the third check module is used for checking program data transmitted by the EEPROM;

the SPI _ Boot program of the DSP is used for enabling a signal SPISIMO, a signal SPISOMI, a clock pulse signal SPICLK and a chip selection signalThe DSP is also used for receiving keywords sent by the FPGA, and starting an SPI external boot mode or an SPI internal boot mode according to the values of the keywords; and when the SPI external boot mode is started, executing a secondary bootloader program of the internal RAM area, and when the internal boot mode is started, executing a secondary bootloader program of the internal FLASH area.

8. The on-board DSP program boot loading system according to claim 7, wherein: in the SPI external guide mode, the DSP continuously receives data through an SPI serial port, the two received bytes are respectively set as the numerical values of a low-speed clock register and an SPI baud rate register, and after 7 bytes are continuously read and discarded, the received data segment is copied to the designated address of an internal RAM area of the DSP according to the format of an external guide file data stream;

in the internal boot mode, the DSP clock pulse signal SPICLK no longer sends pulses, and the FPGA stops sending data.

9. The on-board DSP program boot loading system according to claim 7, wherein: the SPI external boot mode is the same as the internal boot mode, and the secondary bootloader programs are respectively a codetarget skip instruction module, a WD _ DISABLE module and a third-fetch check module;

firstly, executing a codetarget jump instruction module, jumping a pointer to a WD _ DISABLE module, closing a watchdog in the DSP by the WD _ DISABLE module, jumping the pointer to a two-out-of-three module, reading data byte by byte in three different storage areas of a user program segment 1 by using a two-out-of-three check method, performing two-out-of-three check on each byte read respectively, copying the checked data of the user program segment 1 to a RAM area or a FLASH area designated by a CMD file, jumping the pointer to a user program entry _ C _ INT00, performing two-out-of-three check and FLASH burning operation on a user program segment 2 in the FLASH area through a main function, and finishing external boot loading of the user program.

Technical Field

The invention relates to an external boot loading method and system for a satellite-borne DSP program, which can prevent the single event upset phenomenon of a digital signal processor TMS320F 2812.

Background

With the continuous development of aerospace technology, the high integration level, high complexity and high reliability of equipment become inevitable development trends of on-board equipment, and large-scale integrated circuits are widely applied to the development of aerospace equipment. However, the space working environment is relatively complex, the influence on a large-scale integrated circuit is increasingly serious, and the satellite fails frequently due to phenomena such as high and low temperature, radiation, space Single Event Upset (SEU) and the like on the track. Single event upset events are most likely to occur in Digital Signal Processors (DSPs), complex programmable logic devices (FPGAs), and other logic devices. Usually, DSP software programs are generally stored in rewritable memories such as Flash or programmable read-only memory (EEPROM) for debugging and changing. However, these memories have low radiation resistance and limited single event resistance, and once the codes stored therein are subjected to single event upset, the whole software may not be loaded normally. It needs to be reinforced in design.

The general method for resisting single event upset mainly adopts two measures of hardware irradiation resistance reinforcement and software redundancy reinforcement. First, the radiation resistance is improved by hardware, usually by adding device redundancy or by using a processor and a memory with high radiation resistance. Secondly, redundancy reinforcement processing is adopted on software design. The idea of adopting redundancy design is to store multiple software codes in a memory, but the loading schemes are different.

In view of the above requirements, at present, many solutions for software redundancy loading exist at home and abroad.

The patent publication No. CN102043754A proposes a method for improving the loading and booting reliability of an on-board DSP. The invention adopts the CPLD to realize the voting of three out of two for the serial EEPROM loading of the DSP, and expands the pin of the DSP, thereby realizing time division multiplexing and reducing hardware redundancy. However, there are some problems that the DSP cannot normally operate when an external boot has a problem in software or hardware. In addition, the invention only aims at the program which is smaller than the internal RAM memory, and increases the use limitation of the method.

Patent publication No. CN105446783A proposes a method for fast loading pico-satellite DSP programs. According to the invention, DSP programs with different versions are stored in 3 SPI Flash, and the FPGA receives a remote control command with an offset address, reads the DSP program with the corresponding version and sends the DSP program to the DSP. When the satellite software fails, the kernel version can be loaded, and a foundation is provided for failure recovery. The invention has the same problems that when the external boot has software or hardware problems, the DSP can not work normally. In addition, the invention only aims at the program which is smaller than the internal RAM memory, and increases the use limitation of the method.

In summary, the conventional idea is to store a program in three external memory EEPROMs, perform a three-out-of-two check on the program through an external logic circuit FPGA, and load the check result into an internal RAM of the TMS320F2812 for operation, and this method has the limitation that the program memory must be smaller than the internal RAM memory of the TMS320F2812, and meanwhile, if a hardware circuit related to external boot or FPGA sequential logic fails, the boot process will fail, and the DSP cannot work. However, at present, many space programs have complex functions, the occupied memory is large, and the requirement of the boot method cannot be met, and based on the defects of the above technologies, the invention provides the efficient and reliable boot loading method for the user program of the large memory based on TMS320F 2812.

Disclosure of Invention

The invention provides a satellite-borne DSP program external boot loading method and a satellite-borne DSP program external boot loading system, aiming at solving the problems that a program memory is smaller than an internal RAM memory of a DSP, and if a hardware circuit related to external boot or FPGA sequential logic fails, a boot process fails, so that the DSP cannot work and the like in the existing DSP program loading method.

A satellite-borne DSP program external boot loading method is specifically realized by the following steps:

step one, a system is powered on, an SPI module is initialized, an SPI clock is enabled, and the frequency of the SPI clock is set; make itEnable signal SPISIMO, signal SPISOMI, clock pulse signal SPICLK and chip select signal

Figure BDA0002523423670000021

The working mode of setting the SPI module is as follows: 8-bit data stream, internal clock and master mode;

step two, the FPGA reads data on three different address segments of the EEPROM byte by byte simultaneously, performs two-out-of-three verification according to bits, and stores the verified data into a register;

step three, the DSP guides and loads data through the SPI serial port, and the specific process is as follows:

step three, the DSP reads the state of the GPIOF3 port, starts the SPI guide mode and enables a chip selection signal

Figure BDA0002523423670000021

After the FPGA identifies the falling edge of the signal from high to low, counting a clock pulse signal SPICLK loaded by the DSP, and sending the verified data stored in the register in the step two to the DSP through a pin SPISOMI;

step two, the DSP calls an SPI _ Boot program, receives keywords, judges whether the received keywords are 0x08AA or not, if yes, executes step three, and if not, executes step three;

step three, starting SPI external guidance, wherein the DSP continuously receives data through an SPI serial port, the two received bytes are respectively set as numerical values of a low-speed clock register and an SPI baud rate register, after 7 bytes are continuously read and discarded, the received data section is copied to a specified address of an internal RAM area of the DSP according to an external guidance file data stream format, then a pointer jumps to a program entry address, a secondary bootloader program of the internal RAM area is started, and the step four is executed;

step three, the DSP clock pulse signal SPICLK does not send pulses any more, the FPGA stops sending data, starts an internal boot mode, jumps to an internal FLASH inlet address to take out a jump instruction, then jumps to a secondary bootloader program of an internal FLASH area, and executes step five;

step four, executing a codetarget jump instruction module of the internal RAM area, jumping a pointer to a WD _ DISABLE module of the RAM area, closing a watchdog in the DSP by the WD _ DISABLE module, jumping the pointer to a two-out-of-three module of the RAM area, reading data from three different storage areas of the user program segment 1 byte by using a three-out-of-two checking method, performing two-out-of-three checking on each byte read respectively, copying the checked data of the user program segment 1 into the RAM area specified by the CMD file, finally jumping the pointer to a user program entry _ C _ INT00, and executing step six;

step five, executing a codetarget skip instruction module of an internal FLASH area, skipping a pointer to a WD _ DISABLE module of the FLASH area, closing a watchdog in the DSP by the WD _ DISABLE module, then skipping the pointer to a two-out-of-three module of the FLASH area, reading data byte by byte in three different storage areas of the user program segment 1 by using a three-out-of-two checking method, performing two-out-of-three checking on each byte respectively read, copying the checked data of the user program segment 1 into a FLASH area designated by a CMD file, finally skipping the pointer to a user program entry _ C _ INT00, and executing step six;

step six, jumping to a main function through a user program entry _ C _ INT00, wherein the main function performs two-out-of-three verification and Flash programming operation on the user program section 2; the specific process is as follows:

sixthly, erasing the sector; erasing a sector I of an internal FLASH by using a Flash API function Flash _ Erase;

sixthly, program segmentation; namely: dividing the user program section 2 into N sections according to the length of the internal RAM area, and burning once in each section; setting t to be less than or equal to N, wherein t is the number of times of programming;

sixthly, checking the third step by taking the second step; performing three-fetch check on data to be programmed in each section of the user program section 2, and copying the checked data section to an internal RAM area;

sixthly, data programming and verification;

firstly, calling an API function Flash _ Program to burn and write data corresponding to an internal RAM area into an internal FLASH sector I;

secondly, calling an API function Flash _ Verify to Verify whether the data written in the internal FLASH area is correct or not;

sixthly, adding 1 to the programming times t, and circularly executing the step six, the step three and the step six, the step four until all programming is finished;

and step seven, finishing external boot loading of the user program, initializing the DSP and realizing normal operation of the system.

A satellite-borne DSP program external guide loading system comprises an FPGA and an EEPROM, wherein the FPGA comprises an SPI communication module and a third check module; the EEPROM is used for storing three secondary bootstrap data segments;

the SPI communication module is used for communicating with the DSP and the EEPROM, and the third check module is used for checking program data transmitted by the EEPROM;

the SPI _ Boot program of the DSP is used for enabling a signal SPISIMO, a signal SPISOMI, a clock pulse signal SPICLK and a chip selection signal

Figure BDA0002523423670000041

The DSP is also used for receiving keywords sent by the FPGA, and starting an SPI external boot mode or an SPI internal boot mode according to the values of the keywords; and when the SPI external boot mode is started, executing a secondary bootloader program of the internal RAM area, and when the internal boot mode is started, executing a secondary bootloader program of the internal FLASH area.

The invention has the beneficial effects that: the DSP program external guide loading method solves the problem of program memory limitation of SPI external guide, and the user program does not need to be smaller than the internal RAM memory, thus being convenient for the guide process of a plurality of complex programs.

The guiding method has the functions of internal guiding and external guiding simultaneously, so that the external guiding circuit hardware or the FPGA program is prevented from being in failure, the remote control instruction can flexibly switch the guiding mode through the FPGA, and the normal operation of the user program is ensured.

Drawings

FIG. 1 is a schematic block diagram of an external boot loading system for a satellite-borne DSP program according to the present invention;

FIG. 2 is a timing chart of external boot loading of a DSP in the method for external boot loading of a satellite-borne DSP program according to the present invention;

FIG. 3 is a flowchart of a method for external boot loading of a satellite-borne DSP program according to the present invention;

fig. 4 is a distribution structure diagram of a program in the external boot loading method of a satellite-borne DSP program according to the present invention.

Detailed Description

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于诱饵效应的雾节点任务卸载方法、系统、介质及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!