RAM usage not affected by heap/stack size

Hi,

working with nRF52840 with S140 v7.2.0, not sure about SDK version. VS Code + ARM GCC + LD Gold linker.

I changed stack and heap sizes via __HEAP_SIZE and __STACK_SIZE defines. Change is confirmed by .map file, but RAM usage(reported by linker flag --print-memory-usage) is not affected.

No matter what size I set to defines, RAM usage reported by linker stays the same.

How to fix this?

Parents
  • I think by default head and stack are defined as COPY sections and not the NOLOAD (modules/nrfx/mdk/nrf_common.ld: line 137) , COPY sections are not included in the print mem usage option.

    if you want --print-memory-usage to include heap and stack aswell then you need to change the linker script to NOLOAD , prestine build and check if that works.

Reply
  • I think by default head and stack are defined as COPY sections and not the NOLOAD (modules/nrfx/mdk/nrf_common.ld: line 137) , COPY sections are not included in the print mem usage option.

    if you want --print-memory-usage to include heap and stack aswell then you need to change the linker script to NOLOAD , prestine build and check if that works.

Children
Related