The processor of the flight control computer CPU module usually selects PowerPC or X86 series, and the CPU module is designed with a special FLASH chip. In order to ensure the correctness of the flight control program storage, the FLASH test is indispensable. The processor of the intelligent interface module usually selects TMSF240, TMSF2812, etc., and uses the on-chip FLASH to store its own program. This part of the FLASH self-test is often overlooked, and this is not tolerated by the flight control system. This paper introduces a self-test method based on the internal FLASH of TMSF240 chip.
1 problem description
In the case that the CPU processor does not have its own FLASH space, we use the FLASH chip dedicated in the market. Each address space of the FLASH chip can be accessed through hardware design. We can specify different areas to store different contents. There are many methods for self-testing of FLASH chips. At present, the method of checksum is more commonly used, that is, the special programming tool (which can be completed by software) calculates the checksum directly during the programming process. Put it in the specified unit, this unit can be assigned to the free space that can't be written when the program is burned. It is only necessary to recalculate the checksum and compare it with the value. This method is called Method One.
The TMSF240 has its own FLASH storage space, and the burning process is more transparent to the user. We do not directly specify to write data to a specific Flash space, but by executing the batch file provided by TI, and connecting the target machine through the Wenting simulator to complete the process of burning the program, so we use the method directly. Store the checksum for the first method to test the FLASH inside the chip. We must solve the checksum storage problem.
2 chip internal FLASH self-test method overview
The method described below implements the problem of whether the program itself is saved after the test program itself is burned to FLASH. The method does not directly write the checksum to the FLASH, but defines a variable in the program to be burned. The variable is finally used to store the pre-calculated checksum, and the internal FLASH of the chip is realized by two programming. Test function. The problem of invalidation of the self-test algorithm must be avoided by cleverly avoiding program checksum changes caused by changing the program itself.
This method needs to completely debug the program to FLASH beforehand, and then can read the FLASH content to calculate the checksum. At this point, the checksum value is assigned to the previously defined variable, and the final target code is obtained after recompilation and burned into the FLASH. The program runs automatically after power-on. The FLASH self-test program reads out the program space to be tested and calculates the checksum to compare with the variable each time the self-test function is executed. If the comparison result is consistent, the FLASH space to be tested is correct, otherwise Indicates that the FLASH space is faulty.
Since the change in the value of the variable causes a change in the checksum of the entire code, the problem must be properly resolved. The algorithm of the first programmed program is shown in Figure 1.
The second step to the fourth step in the above steps are the implementation focus of this algorithm. It is part of the code and needs to be changed for two programming. See Section 3 for details. The third step is the key to this method. Since sum=0, the sum value is still 0 after the operation of “sum=sum+sum;â€, and the value of sum is not changed. The initial value of sum 0 does not contribute to the true checksum value of the program, which paves the way for the second programming code and calculation.
3 chip internal FLASH self-test method details
3.1 First burning step
The first programming process is as follows:
Step 1: Compile the code containing Figure 1 to form a file to be burned *.out;
Step 2: Compile the code to generate the file to be burned *.out, and then burn it into the FLASH that comes with the chip through the batch file and emulator provided by TI.
3.2 Second programming step
The second programming process is as follows:
Step 1: Use the Wenting simulator to set the code debugging mode in the programming mode, and set the hardware breakpoint to the function entry of the FLASH self-test;
Step 2: After running the program continuously to the breakpoint, step through the calculation to calculate the real code and sum=XXX;
Step 3: At this time, the program is changed, and the calculated checksum is written into the variable defined in the program, that is, the sum=0 in the second step of FIG. 1 is changed to sum=XXX;
Step 4: Recompile the code to generate the file to be burned *.out, and then burn it into the FLASH that comes with the chip through the batch file and emulator provided by TI.
3.3 Method details
In the second programming process, the algorithm shown in Fig. 1 becomes the content shown in Fig. 2.
Since the original checksum is 0, it is now changed to XXX, so the checksum of the second curing program is increased by XXX compared to the checksum of the first curing program. The checksum of the first curing should be XXX, so the final checksum of the second curing program should be checked after the calculation is 2XXX, and the third step in the second step of sum=sum+sum is satisfied. The above requirement is sum=2XXX. Therefore, the fourth step check sum=sum can correctly reflect the self-test results.
It should be added that the algorithm is based on the fact that the first program is reloaded after the first programming is successfully reloaded. The program is automatically calculated by the DSP processor. This is based on the addition, subtraction, multiplication and division of the CPU. The logic operation and other self-tests are guaranteed correctly. This is self-tested in PUBIT at power-on.
4 Conclusion
DSP has been widely used in flight control computer intelligent interface modules. Although it has high reliability, it must also be tested in the use of the flight control system. In this paper, a self-test method is proposed for the FLASH inside the DSP chip. The checksum of the space to be tested is calculated by two flashes of FLASH and counted into the variables defined in the RAM, and recompiled to generate a new one. The object code checksum becomes twice the first checksum. This uses sum=sum+sum to subtly avoid the two checksum additions and cause program changes. This method solves the problem of FLASH self-test inside DSP chip simply and effectively, and has been applied in airborne equipment, including flight control computer interface module, which has certain effect on improving the testability and reliability of airborne equipment. Promote use.
Cummins 201-400KW Diesel Generator
Cummins 201-400Kw Diesel Generator,Cummins Genset,Cummins Diesel Genset,Cummins Engine Diesel Generator
Shanghai Kosta Electric Co., Ltd. , https://www.kostagenerators.com