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 Error: Need resolution to error of stack section

Hello,

    Can anyone help me out in compiler error:

#10099-D program will not fit into available memory. run placement with alignment fails for section ".stack" size 0x1000 . Available memory ranges: EK_TM4C1294XL.cmd /DL_Tiva_v1 line 42 C/C++ Problem

    How to interpret this kind of error & resolve them.

Thanks

Regards

Soumyajit

  • Is this coming out of the compiler or the linker?

    The linker is the one trying to place sections and if there is not enough space in a particular memory for that section, it will complain that it doesn't fit.  If you look at the generated .map file, it will let you know how much memory is left in a particular memory segment.

    You might need to decrease your stack size of try placing it in another memory segment.

    Judah

  • It means your program is too big. Look in the generated .map file (under debug in the CCS project). It lists the available memory and the used memory. It looks like you are running out of RAM (.stack is placed into RAM and not flash). You need to reduce the memory usage. Refer to the Memory Usage section in the TI-RTOS User Guide for tips on reducing the OS requirements.

    If you are using the networking stack, there is this discussion also: http://processors.wiki.ti.com/index.php/TI-RTOS_Networking_Stack_Memory_Usage

    Todd

  • Thanks Guys for putting your time,

       The .map file shows

    MEMORY CONFIGURATION

            name            origin    length      used     unused   attr    fill

    ----------------------  --------  ---------  --------  --------  ----  --------

     FLASH                 00000000   00100000  00024114  000dbeec  R  X

     SRAM                  20000000   00040000  0003f4d9  00000b27  RW X

    I changed the statement in the .cfg file from Program.stack = 4096; to Program.stack = 768; & the program compiled. The new .map file contents changed to

    MEMORY CONFIGURATION

            name            origin    length      used     unused   attr    fill

    ----------------------  --------  ---------  --------  --------  ----  --------

     FLASH                 00000000   00100000  000244a4  000dbb5c  R  X

     SRAM                  20000000   00040000  0003f7d9  00000827  RW X

    But I still don't understand why the remaining SRAM inspite of getting reduced from 0xB27 to 0x827, the program compiled!!

    Thanks

    Regards

    Soumyajit Das

  • Because the first one did not get to place everything in memory. If you look at the mapfile in the first case, it had things that it could not place. So really there was negative unused space (but the mapfile does not include the unplaced items in that table). Once you shrunk the memory down, it was able to fit everything in with some space to spare.

    For example if you had 1000 bytes of memory and you had 3 things all of size 400. The build would fail, but it would show 200 bytes unused. Now if you shrunk them all to 300, it would fit and show unused of 100.

    Todd

  • OK, got it!

    Thanks a lot man