This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52832 (SDK 11.0.0): Best way to reduce the Heap Size to 0 bytes

Hi All,

Our application WILL NEVER dynamically allocate memory and thus we'll never need to use the heap. Currently, our SDK carves out 8K of memory for the heap in "gcc_startup_nrf52.s". Which file do I have to modify in order to zero out the heap size? I'm currently inspecting the .map file in order to observe our heap's usage. Our application needs more RAM!

Thanks!

Parents
  • Hi,

    If you use make, add __HEAP_SIZE=0 to ASMFLAGS (i.e. ASMFLAGS += -D__HEAP_SIZE=0).

    If you use Segger Embedded Studio, you can set "Heap Size" in the project Options ("Project" menu -> "Edit Options..."), under "Code" -> "Runtime Memory Area".

    Regards,
    Terje

  • Hi, may i know where to find the ASMFLAGS??

Reply Children
  • Hi,

    That would be for using armgcc and make, and you will find several lines beginning with "ASMFLAGS += " in the Makefile. The line should be added in the Makefile, together with those other similar entries.

    Regards,
    Terje