Hello,
I wanted to know why StackLimit is not defined using HeapLimit in nrf52_common.ld?
Given the fact that the HardFault handler (HardFault_Handler) is checking the value of the Stack Pointer, it seems better to maximize the Stack size, with addresses reaching the HeapLimit address.
/* -----------------------------------------------------------------
* If we have selected MSP check if we may use stack safetly.
* If not - reset the stack to the initial value. */
" ldr r1, =__StackTop \n"
" ldr r2, =__StackLimit \n"
/* MSP is in the range of the stack area */
" cmp r0, r1 \n"
" bhi HardFault_MoveSP \n"
" cmp r0, r2 \n"
" bhi HardFault_Handler_Continue \n"
/* ----------------------------------------------------------------- */
Best,