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.

TM4C123GH6PZ: FreeRTOS functions use more SRAM than is available

Part Number: TM4C123GH6PZ

Tool/software:

Greetings,

I am trying to use FreeRTOS on the TM4C line. I have experience using it on Espressif microcontrollers, but not TI ones.

I have a program which, without any FreeRTOS functions used, uses only 0x614 bytes of SRAM according to the .map file. When I add a FreeRTOS function (so far, I have tried vTaskDelay and xTaskCreate), I get an error:

"../tm4c123gh6pz.cmd", line 40: 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 fails for section ".bss" size 0x842b."

I thought this may be due to some project properties or FreeRTOS configurations that are not set correctly. However, when I compile the example project "freertos_demo" provided for the TM4C123GXL Launchpad, I notice that it also uses a whole lot of memory, almost all of the available 32kb of SRAM just for the simple demo.

This doesn't seem right. If FreeRTOS must use so much memory, it would be impractical to use it on this microcontroller because there's no room for anything else. My question is, is there a way to configure FreeRTOS and/or project settings to make it use less SRAM?

My .cmd file has not been changed from the default. I'm using the same FreeRTOSConfig.h provided with the example with no modifications. I added the same FreeRTOS C files as used in the example.

Thank you

  • The bulk of FreeRTOS's SRAM usage is in the heap. The heap size is partly controlled by the choice of MemMang source, one of "heap_N.c" where N=[1,2,3,or 4].

    It looks as though freertos_demo uses heap_2.c, which just declares an array of size [configTOTAL_HEAP_SIZE], which is set in FreeRTOSConfig.h to be 30000 (pretty close to 32KB).

    You probably don't need nearly this much heap, so try adjusting configTOTAL_HEAP_SIZE down. I'm going to guess that 10KB (or even less) is plenty.