This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28377D: Ask for the problem of using const data in CAL!

Part Number: TMS320F28377D

Tool/software: TI C/C++ Compiler

In the CLA program, in flash mode, need to use const short Table[] = {0,1,2...}. The CMD part of the CMD is defined as follows:
  CLAscratch:
                     { *.obj(CLAscratch)
                     += CLA_SCRATCHPAD_SIZE;
                      RAMLS0, PAGE = 1  

   .scratchpad : > RAMLS0, PAGE = 1

  .bss_cla : > RAMLS0, PAGE = 1

  //.const_cla       : > RAMLS0,       PAGE = 1
   .const_cla : LOAD = FLASHB,
                       RUN = RAMLS0,
                       RUN_START(_Cla1ConstRunStart),
                       LOAD_START(_Cla1ConstLoadStart),
                       LOAD_SIZE(_Cla1ConstLoadSize),
                       PAGE = 1

The following alarm appears after the program is compiled:
"../FLASH_lnk_cpu1.cmd", line 274: error #10265: no valid memory range(NULL) available for placement of ".const_cla"
"../FLASH_lnk_cpu1.cmd", line 274: error #10099-D: program will not fit into available memory. load placement with alignment/blocking fails for section ".const_cla" size 0x20 page 1
The variables Cla1ConstRunStart, Cla1ConstLoadStart, and Cla1ConstLoadSize also do not see where they are defined. The routines did not find any const data.

question:

1、which one is right? ".const_cla       : > RAMLS0,       PAGE = 1" or

              "  .const_cla : LOAD = FLASHB,
                       RUN = RAMLS0,
                       RUN_START(_Cla1ConstRunStart),
                       LOAD_START(_Cla1ConstLoadStart),
                       LOAD_SIZE(_Cla1ConstLoadSize),
                       PAGE = 1"

2、when I use the ".const_cla       : > RAMLS0,       PAGE = 1",the const data simulation is correct, cost simulation is not correct.

thank you !

  • Hi,

    1. If you are loading your program to flash, then all the data needs to be loaded to flash and then copied to RAM. So the second one is correct.

    With the build error, can you confirm that FLASHB and RAMLS0 are on the same page in the linker command file, please?

    Regards,
    sal