Skip to main content
arduo
Associate III
February 21, 2019
Question

STM 32 Set min Heap size

  • February 21, 2019
  • 6 replies
  • 1751 views

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

    This topic has been closed for replies.

    6 replies

    After Forever
    Senior III
    February 21, 2019

    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
    Senior III
    February 21, 2019

    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.

    Tesla DeLorean
    Guru
    February 21, 2019

    Keil defines the heap/stack sizes in startup_stm32xyz.s

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    arduo
    arduoAuthor
    Associate III
    February 21, 2019

    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.

    AvaTar
    Senior III
    February 21, 2019

    Don't know recent Keil version, or Cube.

    I suggest you start searching with the map file.

    S.Ma
    Principal
    February 21, 2019

    Check the linker configuration file as well.