cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX how to change stack/heap memory size

LPetr.1
Senior

Hello. I would like to understand a little bit more about the minimum stack and minimum heap parameters on the cube mx:

0693W00000QNHo8QAH.png 

I use stm32cubemx and stm32cubeIDE

1.How can I see what is total available heap and stack memory

2.Currently, I use Build Analyzer in stm32cubeIDE

0693W00000QNHowQAH.png0693W00000QNHrHQAX.pngFrom what I understand, currently, my program occupies 55.39KB RAM of which some of it is stack and some of which is heap is that correct?

Is there any way to know how much heap and how much stack precisely?

3.I dont understand the connection between the minimum heap size and minimum stack size under the stm32cubemx project manager. Currently I have set both to 0x5000 but I am not sure how it affect the my firmware. Could someone clarify this to me please?

4.If I understand this correctly, I can choose how much memory to allow for stack and how much to allow for heap is that correct?

5.I use freertos and when I try to create more tasks I run out of heap size:

0693W00000QNHzGQAX.png Changing minimum stack or minimum heap size and then generating project does not have affect on available heap. How can I increase available heap size?

I think I have the same issue as described here:

https://community.st.com/s/question/0D50X00009XkgaCSAR/configuration-of-stacksize-and-heapsize-when-using-cubemx

I can manually change the the TOTAL_HEAP_SIZE in FreeRTOSConfig.h

0693W00000QNI4QQAX.pngHowever, when I change something in the .ioc file, this files gets overwritten and it always write the default values to this file. I am not fully understanding how can I override these values because modifying minimum stack and minimum heap size does not have any affect on them.

4 REPLIES 4
Javier1
Principal

Are you using any RTOS?(FreeRTOS)

we dont need to firmware by ourselves, lets talk
Piranha
Chief II

To understand these, one has to learn the actual software development. Clicking Cube won't help...

Yes I am using Freertos

This reply was not necessary