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.

TMS320F28388D: Place Section into multiple Memory-Ranges (Linker-Command)

Part Number: TMS320F28388D

Hello everyone,

could you please explain why 1) isn't working while 2) does?

1)

MEMORY{
...
RAMLS0           : origin = 0x008000, length = 0x000800
RAMLS1           : origin = 0x008800, length = 0x000800
...
}

SECTIONS{
...
PARAMS_ACTIVE_CPU_CLA_SHARED : >> RAMLS0 | RAMLS1
...
}

Generates Linker-Error:
"../Linker CMD/2838x_RAM_CLA_lnk_cpu2.cmd", line 130: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. run placement with alignment/blocking fails for section "PARAMS_ACTIVE_CPU_CLA_SHARED" size 0x8f5page 0.  Available memory ranges:
   RAMLS0       size: 0x800        unused: 0x800        max hole: 0x800     
   RAMLS1       size: 0x800        unused: 0x800        max hole: 0x800 

2)

MEMORY{
...
RAMLS01           : origin = 0x008000, length = 0x000100
...
}

SECTIONS{
...
PARAMS_ACTIVE_CPU_CLA_SHARED : > RAMLS01
...
}

Thanks and Regards,

Marcel.

  • Hi Marcel,

    In the first case, the size of the section is 0x8f5 and the linker is trying to fit that in RAMLS0 | RAMLS1. If there are subsections within this section, linker can split that and map one subsection in LS0 and LS1. The linker cannot split the section otherwise.

    In the second case, you have combined the memory region and hence linker is able to fit in the section correctly in the combined region.

    Lets take an example of .text region ( .text :>> RAMLS0 | RAMLS1 ). The entire code in the application is present in the .text region (unless you use CODE_SECTION pragma) By default, the linker can split the .text section into subsections at the file level. That means the section will be split into .text.1 with file1.obj contents and .text.2 with file2.obj contents. .text.1 can be mapped to LS0 and ,text.2 can be mapped to LS1. There is compile flag available in CCS (--gen_func_dubsections) which makes the compiler generate separate subsections for each functions in the file. So, even though the file code size if big, the linker will split them into different subsections at function level and map them into different memory regions. There is similar option for data section as well (--gen_data_subsections). This option is available in Properties->C2000 Compiler->Advanced Options

    In your case, looks like the custom section PARAMS_ACTIVE_CPU_CLA_SHARED is bigger than the single memory region and linker is unable to slit them into smaller subsections. To resolve this issue, you can either combine memory regions to make its size bigger (like you did in 2) or enable these compile flags which allows linker to split them into smaller subsections so that they can be allocated to different memory regions

    Regards,

    Veena