cancel
Showing results for 
Search instead for 
Did you mean: 

STM 32 Set min Heap size

arduo
Senior

how to set the minimum heap size manually in code without cubemX?

6 REPLIES 6

Depends on your IDE/toolchain.

For GCC-based toolchain you just edit the _Min_Heap_Size (or similiar) value in the linker script file (the one with .ld extension).

AvaTar
Lead

The heap is defined in the linker file, and used for malloc()-like functionality. Most linker files come with a heapsize definition of zero.

You are sure you need it ?

If so, you need to setup the size, and the malloc/free like memory adminstration by yourself.

Keil defines the heap/stack sizes in startup_stm32xyz.s

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

And cube i made the project with cube and now i want to change the heap size but can't find it and i don't want so set it up again from scratch.

Don't know recent Keil version, or Cube.

I suggest you start searching with the map file.

S.Ma
Principal

Check the linker configuration file as well.