In some cases FreeRTOS heap can consume huge portion of RAM memory - especially on small devices like S32K312 and for example DTCM memory is unused. FreeRTOS allows user defined heap which can be moved in any section in RAM.
First step - make sure, that in FreeRTOS config is application allocated heap is disabled:
Second step - open linker script file and create new section which points into DTCM memory:
Third step - define ucHeap variable with section attribute:
We are done - FreeRTOS Heap is moved into DTCM memory:
In case, that DTCM memory is used - typically there can be Interrupt Vector Table, stack and so on, you can skip creating new section in linker script file and simply add *(my_head) at the end of existing section mapped into dtcm:
FreeRTOS heap will be placet at the end of used DTCM memory: