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.

TMS320F280049C: #10099-D program will not fit into available memory for DriverLib example

Part Number: TMS320F280049C

Hello,

I am using the spi_ex1_loopback example from the C200ware DriverLib for a
TMS320F280049C. When I compile form RAM everything works fine. However,
When I compile for flash using the linker script 28004x_generic_flash_lnk.cmd,
which comes with the example, I am getting the following 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. placement
with alignment/blocking fails for section ".text" size 0x2080 page 0. 
Available memory ranges:        
28004x_generic_flash_lnk.cmd        /P1439_DrvLib_02        l
ine 77        C/C++ Problem

Here is the part of the linker file which the compiler is complaining about:

The flash sections for BANK0 are defined like this:

   /* Flash sectors */
   /* BANK 0 */
   FLASH_BANK0_SEC0  : origin = 0x080002, length = 0x000FFE	/* on-chip Flash */
   FLASH_BANK0_SEC1  : origin = 0x081000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC2  : origin = 0x082000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC3  : origin = 0x083000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC4  : origin = 0x084000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC5  : origin = 0x085000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC6  : origin = 0x086000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC7  : origin = 0x087000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC8  : origin = 0x088000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC9  : origin = 0x089000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC10 : origin = 0x08A000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC11 : origin = 0x08B000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC12 : origin = 0x08C000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC13 : origin = 0x08D000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC14 : origin = 0x08E000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC15 : origin = 0x08F000, length = 0x001000	/* on-chip Flash */

Do I need to connect three sections?

What is a trampoline?

Cheers,

John

  • Hi John,

    If you see the error message the size of .text is 0x2080 which cannot fit into two sections (section2 and section3). You will probably need 3 sectors.

    Best Regards,

    Nirav

  • Hello Nirav,

    Thanks for your suggestion. I saw this with the size of .text being 2080, so size was the first one I tried by adding another sector. You can see the code I used in line 77, but this resulted in the same error message. Is the command format I used okay?

    The error message also indicates some other possible causes. The next one is something about a call that requires a trampoline that cannot be generated for this section. I am googling this issue and reading lots of TI docs about the linker command file and so on, but have not yet found anything. What does it mean with the trampoline and why can it not be generated or do you have an idea what this could mean?

    It also says something about placement with alignment/blocking fails for section. I though the ALIGN(4) would take care of this but I am not sure. What do you think?

    Kind Regards,

    John

  • Hello Nirav,

    as you suggested, the problem seems to be the size problem. I found a solution here which helped:

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1047324/tms320f280049c-error--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?tisearch=e2e-sitesearch&keymatch=trampoline%2520call#

    I used the solution of grouping the flash sections together like this:

       /* Flash sectors */
       /* BANK 0 */
       FLASH_BANK0_SEC0  : origin = 0x080002, length = 0x000FFE	/* on-chip Flash */
       FLASH_BANK0_SEC1  : origin = 0x081000, length = 0x001000	/* on-chip Flash */
    //   FLASH_BANK0_SEC2  : origin = 0x082000, length = 0x001000	/* on-chip Flash */
    //   FLASH_BANK0_SEC3  : origin = 0x083000, length = 0x001000	/* on-chip Flash */
    //   FLASH_BANK0_SEC4  : origin = 0x084000, length = 0x001000	/* on-chip Flash */
    //   FLASH_BANK0_SEC5  : origin = 0x085000, length = 0x001000	/* on-chip Flash */
       FLASH_BANK0_SEC2345 : origin = 0x082000, length = 0x004000	/* on-chip Flash */
       FLASH_BANK0_SEC6  : origin = 0x086000, length = 0x001000	/* on-chip Flash */

    and changed the command for .text to this:

    SECTIONS
    {
       codestart        : > BEGIN,     PAGE = 0, ALIGN(4)
       .text            : >> FLASH_BANK0_SEC2345,   PAGE = 0, ALIGN(4)
    //   .text            : >> FLASH_BANK0_SEC2 | FLASH_BANK0_SEC3 | FLASH_BANK0_SEC5,   PAGE = 0, ALIGN(4)
       .cinit           : > FLASH_BANK0_SEC1,     PAGE = 0, ALIGN(4)

    In the link above, there is another solution by adding the -gen_func_subsections flag switch to the compiler options, but I have not tried this solution out. I have the feeling that the change in the linker command file is more visible, so I prefer this silution.

    Thanks again for your support.

    Greetings,

    John