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: Combining different memory sections in linker cmd file

Part Number: TMS320F28377D

Tool/software: TI C/C++ Compiler

Hi,

I am trying to combine (OR) different memory section for placing .text section but getting following error.

"C:/D Drive/Bitbucket/c2000_tenor_avv/testcases/MemCtrl/MemCtrl_prot_chk_dxmem/Local_RAM_lnk.cmd", line 119: error #10099-D: program will not fit into available memory.  placement with alignment/blocking fails for section ".text" size 0x10a6 page 0.  Available memory ranges:

   RAMLS0       size: 0x800        unused: 0x45         max hole: 0x45     

   RAMLS1       size: 0x800        unused: 0x800        max hole: 0x800    

   RAMLS2       size: 0x800        unused: 0x800        max hole: 0x800  

 

 I have defined the memory section like below –

 

   RAMLS0      : origin = 0x008000, length = 0x000800

   RAMLS1      : origin = 0x008800, length = 0x000800

   RAMLS2      : origin = 0x009000, length = 0x000800

 

And placed the .text section like below.

 

   .text            : >> RAMLS0 | RAMLS1 | RAMLS2,  PAGE = 0

 

 Why it’s not able to place it. Strange part is if I combine LS0 and LS1 into one memory block and then OR it with LS3 (liek below) it works fine.

  .text            : >> RAMLS0_LS1 | RAMLS2,  PAGE = 0

Can we only OR two memory section?

Regards,

Vivek Singh

 

  • My guess is you have a .text input section that is larger than 0x800.  To understand what I mean by that, please see the article Linker Command File Primer.  Read the first half to get the basics on input sections, how they are combined into output sections, and how those output sections are then allocated to memory ranges.  Then skip down to the part on section splitting.

    Thanks and regards,

    -George

  • George,

    Sorry looking at this again after vacation. Yes, the .text is larger than 0x800 that is why I am combining more RAMs to allocate .text.

      .text            : >> RAMLS0 | RAMLS1 | RAMLS2,  PAGE = 0

    This should work as explained on this wiki page.

    This worked with old compiler but not with latest one. So something has changed in latest compile.

    Regards,

    Vivek Singh

  • Vivek Singh said:

    Yes, the .text is larger than 0x800 that is why I am combining more RAMs to allocate .text.

      .text            : >> RAMLS0 | RAMLS1 | RAMLS2,  PAGE = 0

    This should work as explained on this wiki page.

    You need to allocate more RAM, but this method doesn't do that.  You allocate more memory ranges, and section split across them.  But keep in mind that section splitting never splits an input section.  An input section is typically the .text section from a single object file.  In your case, one .text input section is bigger than any one memory range.  So, you need to combine the memory ranges together, like this ...

    RAMLS0_LS1_LS2 : origin = 0x008000, length = 0x800 * 3
    

    Then allocate .text into that ...

        .text > RAMLS0_LS1_LS2, PAGE 0

    Thanks and regards,

    -George

  • George,

    Same linker cmd file worked fine with older compile.

    Vivek Singh
  • It seems likely that, with the older compiler, none of the .text input sections were larger than 0x800.  Is that correct?

    Thanks and regards,

    -George

  • I am not sure about that but it'll be helpful if the error specifically mention that which section is not fitting. Right now it just says that .text is not able to fit. Have you tried this at your end? Should I send you the project I am using?

    Vivek Singh
  • Another method to consider ... In combination with section splitting, build with the compiler option --gen_func_subsections.  Please read about that option in the C28x compiler manual.  It will make the input sections smaller, thus the section splitting will become more effective.

    Vivek Singh said:
    Should I send you the project I am using?

    If this last suggestion does not work, then yes.

    Thanks and regards,

    -George