[SAMR21] change stack allocation to use all free RAM (#2334)

Initially fixed size 8k was allocated for stack.
As result there was almost no free RAM. This
change creates stack on all free RAM.

Signed-off-by: Oleksandr Grytsov <[email protected]>
This commit is contained in:
Oleksandr Grytsov
2017-11-10 15:56:57 -08:00
committed by Jonathan Hui
parent 1667cc7558
commit c4dc72cf2d
+7 -9
View File
@@ -53,9 +53,6 @@ MEMORY
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
/* Section Definitions */
SECTIONS
{
@@ -151,15 +148,16 @@ SECTIONS
} > ram
/* stack section */
.stack (NOLOAD):
.stack_dummy (NOLOAD):
{
. = ALIGN(8);
_sstack = .;
. = . + STACK_SIZE;
. = ALIGN(8);
_estack = .;
KEEP(*(.stack*))
} > ram
_sstack = _ebss;
_estack = ORIGIN(ram) + LENGTH(ram);
ASSERT(_sstack < _estack, "region RAM overflowed with stack")
. = ALIGN(4);
_end = . ;
end = _end;