How to Resolve Error: section .heap overlaps absolute placed section .stack

Hello, I am having the following error.
section .heap overlaps absolute placed section .stack

I am wondering if there is a way I can adjust the .heap bounds or .stack bounds to accommodate my program.
When I compile our release code I use only 65% of flash memory but I am using 98.1% of RAM. When I try to compile our debug code with additional logging I get the error.

Also, are there strategies you would recommend to optimize memory within our program?

All the best,

Caleb

Parents Reply
  • Thanks. In that case, you can adjust the heap and stack sections from your project settings here: 

    You can also get a breakdown of what is consumed by the various RAM sections from the "Memory Usage" view:

    Or check the RAM usage by the various source files from the "Project items" view:

    We don't use heap in our SDK examples, so unless you are using it in your application, you can set the heap section to 0.

Children
  • Excellent thank you Vidar!
    That helps with my understanding of how the memory is being used.

    Would you be able to advise on any resources / best practices for reducing RAM usage?

    Also, how can .reserved_ram or .bss be adjusted through code optimizations?

  • It's good to hear that my answer was useful to you.

    Unfortunately, it is a bit hard to give general advice on how to optimize RAM usage as it is quite application dependent and usually involves optimizing the code itself. 

    .reserved_ram is the section allocated to the Softdevice. How much RAM the Softdevice needs depends on the configuration settings you have in sdk_config.h. You may be able to free up a few kBs to the application by changing the SD configurations in sdk_config.h here:

     

    Then reduce the app RAM start address here: 

    .bss contains zero initialized global and 'static' variables so reducing this section requires code modification. 

    I can try to look for things to optimize if you are able to share your project here or in a private ticket. 

  • Hi Vidar, I appreciate the explanation. Our memory is working well for us now. If I do need more project specific help I will open up a private ticket.

    All the best

Related