How to reduce the heap size, or remove completely the heap?
..
..
Heap and Stack are at the top end of the RAM (unless you're using an RTOS).
from generated sysmem.c:
* ############################################################################
* # .data # .bss # newlib heap # MSP stack #
* # # # # Reserved by _Min_Stack_Size #
* ############################################################################
* ^-- RAM start ^-- _end _estack, RAM end --^So, the heap does not waste space except you're using it at runtime.
The .ld linker file reserves some space for the heap at link time using the symbol _Min_Heap_Size. Linking fails if less than _Min_Heap_Size + _Min_Stack_Size are free in RAM. You can adjust these linker values in the .ioc file's Project Manager tab. But, if linking succeeds you can gain nothing from changing these values.
Keep in mind that some C runtime functions may use the heap internally, so you might set a breakpoint or do some debug print in sysmem.c function _sbrk to find out whats happening in your system at runtime or study the sources.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.