HOWTO: Move FreeRTOS Heap into DTCM memory - S32K3xx + RTD

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOWTO: Move FreeRTOS Heap into DTCM memory - S32K3xx + RTD

HOWTO: Move FreeRTOS Heap into DTCM memory - S32K3xx + RTD

 

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:

jiri_kral_0-1718190416022.png

 

Second step - open linker script file and create new section which points into DTCM memory: 

jiri_kral_1-1718190506796.png

 

 Third step - define ucHeap variable with section attribute: 

jiri_kral_2-1718190668763.png

 

 We are done - FreeRTOS Heap is moved into DTCM memory: 

jiri_kral_3-1718190832690.png

 

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: 

jiri_kral_0-1718363614138.png

 

FreeRTOS heap will be placet at the end of used DTCM memory: 

jiri_kral_1-1718363685771.png

 

 

Labels (1)
100% helpful (1/1)
Version history
Last update:
‎06-14-2024 04:15 AM
Updated by: