RTOS is not used in my application.
The default stack and heap is now set to 0x400 only.
In the application there will be done iterative deepening,
the demand for stack may grow depending on runtime.
There is defined in "stackheap.h" :
#define USER_HEAP_BASE 0x28801000
#define USER_HEAP_SIZE 0x01400000
In main.c there will be executed "userInitStackHeap():
#include "stackheap.h"
__asm void userInitStackHeap(void)
{
IMPORT __use_two_region_memory
EXPORT __user_setup_stackheap
EXPORT __heap_base
EXPORT __heap_limit
__heap_base EQU USER_HEAP_BASE
__heap_limit EQU USER_HEAP_BASE + USER_HEAP_SIZE
__user_setup_stackheap
LDR R0, = __heap_base
LDR R2, = __heap_limit
BX LR
ALIGN
}
I use scatter-load-description as well:
LR_IROM1 0x1A000000 0x00080000 {
ER_IROM1 0x1A00.0000 0x00080000 {
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM1 0x10000000 0x00008000 {
system_LPC43xx.o (+RW +ZI)
}
RW_IRAM2 0x20000000 0x00010000 {
startup_LPC43xx.o (+RW +ZI) ; may be put in RW_IRAM1 as well
}
RW_RAM1 0x28000000 0x01DFFFFF {
.ANY (+RW +ZI)
}
ARM_LIB_HEAP 0x28801000 EMPTY 0x1400000 {}
ARM_LIB_STACK 0x29DF0000 EMPTY -0x40000 {}
}
The application is working and heap is fully used,
but the stack will not be remaped.