DM648 self-starting problem caused by CMD file under CCS5.2
[Copy link]
I used to use CCS3.3, because the software was too prone to blue screens and crashes, and using a virtual machine seriously affected the speed of the emulator. So I switched to CCS5.2.
The ECLIPS architecture used by CCS5 is almost completely incompatible with the previous CCS3.3... DSP/BIOS has also been upgraded, and many functions have been renamed. Even the previous gel files have been wrapped in a different way...
I finally modified the program to be able to run in simulation, but when I downloaded it to SPIFLASH to start it, problems occurred again and the program failed to start normally.
Later, I tested the waveform and found that the program had completed loading, but could not run correctly. After several twists and turns, I finally found the cause. It was found that the compiled .map file had two .cinit segments and two .pinit segments. And one of them showed a length of 0 and was in the UNINITIALIZED state:
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.pinit 0 e0400000 00000000 UNINITIALIZED
.cinit 0 e0300000 00000000 UNINITIALIZED
.pinit 0 00a10000 00000000 UNINITIALIZED
……
.cinit 0 e15840b0 0000148c
After checking the "TI SYS/BIOS v6.33 Real-time Operating System User's Guide", I found that the memory configuration work has been automatically generated from the new .cfg file to the linker.cmd file, and the user-defined .cmd file cannot conflict with it. The document recommends not to use user-defined cmd files. If you need to configure the space yourself, you can modify the .cfg or linker.cmd file.
Previously, I continued the habit of using CCS3.3 and used my own .cmd file, so there were two .cinit sections and two .pinit sections. As a result, the variables could not be initialized when self-loading, and the program could not run normally.
……
.vecs> IRAM_Code
.text > IRAM_Code /* Common Code */
.bss > IRAM_Data /* variable*/
.cinit > DDR2 _Code
.switch> IRAM_Data
.far > IRAM_Data /* array*/
.const > IRAM_Data/*DDR2_L2Shadow IRAM3*/
.bootload> IRAM_Code
.printf> IRAM_Data
.pinit > IRAM_Data /* Common Code */
.cio > IRAM_Data
.data > IRAM_Data
.system> IRAM_Data
……
Delete the relevant sections in the custom .cmd file. After compiling, there is only one set of .cinit and .pinit in the .map file. After burning to SPI FLASH, the program can be loaded and run normally.
……
.vecs> IRAM_Code
.text > IRAM_Code /* Common Code */
.bss > IRAM_Data /* Variable*/
.switch> IRAM_Data
.far > IRAM_Data /* Array*/
.const > IRAM_Data/*DDR2_L2Shadow IRAM3*/
.bootload> IRAM_Code
.printf> IRAM_Data
.cio > IRAM_Data .
data > IRAM_Data
.system> IRAM_Data
……
|