Hi
In the linker script for GCC the following are set:
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = ORIGIN(DTC_STACK) + LENGTH(DTC_STACK); /* end of "RAM" Ram type memory */
_Min_Heap_Size = 4K; /* required amount of heap */
_Min_Stack_Size = 4K; /* required amount of stack */
/* Memories definition */
MEMORY
{
DTC_STACK (xrw) : ORIGIN = 0x10000000, LENGTH = _Min_Heap_Size + _Min_Stack_Size
DTCM_MISC (xrw) : ORIGIN = 0x10000000 + _Min_Heap_Size + _Min_Stack_Size, LENGTH = 10K - _Min_Heap_Size + _Min_Stack_Size
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K - 1k
RAM_NVS (xrw) : ORIGIN = 0x20008000, LENGTH = 1K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
}
I am guessing the stack is used for interrupt processing, saving registers etc, but what is the heap used for. What’s the best way of working out the size necessary for each of these?
Thanks
Rob