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.

CCS/TM4C123GH6PM: Program will not fit into available memory (problem with .text section)

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hi all,

I am writing in this forum because I have tried to add code to a project and it does not compile because of the error "Program will not fit into available memory". More concretely, I have found the following:

<Linking>
warning #10210-D: creating ".stack" section with default size of 0x800; use the -stack option to change the default size
"../tm4c123gh6pm.cmd", line 32: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".text" size 0x57a88 .  Available memory ranges:
   FLASH        size: 0x40000      unused: 0x3fd94      max hole: 0x3fd94   
error #10010: errors encountered during linking; "touch screen.out" not built
 
>> Compilation failure
makefile:143: recipe for target 'touch screen.out' failed
gmake: *** [touch screen.out] Error 1
gmake: Target 'all' not remade because of errors.

**** Build Finished ****

I understand the problem, but I don't see how I can fix it. For what I could find in this forum I have seen examples of how to change sizes, for example applying the or ("|") operation, but I don't know how to apply in my case in the file TM4C123GH6PM.cmd, so I would be grateful if someone can explain me how it works so I can understand how I should solve the problem.

Thanks,

Javier

  • Javier,

    The TM4C123GH6PM device has a total Flash memory space of 0x40000 (as noted in the linker command file), but your program seems to have a code size of 0x57a88. Thus it will not fit within this MCU. You should look to see if you can trim out some of the code and/or are able to optimize it sufficiently enough to fit within the available memory. Or if the code size cannot be reduced, you should consider a different TM4C processor with more Flash memory.

  • Hi AartiG,

    Many thanks for your answer. For what you say I am afraid I will need to look for another board or try to read data from a file as what caused the problem was trying to upload a firmware to a chip.

    Thanks and regards,

    Javier