cancel
Showing results for 
Search instead for 
Did you mean: 

FreeRTOS heap size adjustment in stm32CubeMX

Hobbyist
Associate II

I am using stm32cubeIDE for FreeRTOS on stm32f429. As cubemx has option to adjust heap and stack size on generating code in "Project Manager" project tab. While FreeRTOS has also column of heap adjustment in config parameter in cubeMX.

Question:

  1. From where FreeRTOS take heap size as per defined in code generation project tab or column in config parameter?
  2. should i need to adjust both code generation or config parameter column?

Please anyone suggest to best way to avoid any heap/stack overflow.

Thanks to all

2 REPLIES 2
Pavel A.
Evangelist III

There are two independent heaps:

  1. in "Project Manager" project tab you define size of the C library heap (malloc/free).
  2. In FreeRTOS parameters you define the size of FreeRTOS own heap.

FreeRTOS has also an option to use the C (malloc) as its heap, in this case there is only one heap and FreeRTOS size parameter is not used.

Start from reading this discussion:

https://community.st.com/s/question/0D50X0000BB1eL7SQJ/bug-cubemx-freertos-projects-corrupt-memory

-- pa

T J
Lead

You can manually change the heap size in the flash programming file.. stm32F742AG.lds for example...