summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott@chickadee.tech>2016-10-17 15:10:00 -0700
committerScott Shawcroft <scott@chickadee.tech>2016-10-21 15:43:24 -0700
commit853e5fc652a50a5424ef62495fcbf962df7650c3 (patch)
tree54c231e0e21ea113de7adfb2202858f8b102714b
parent306c921ed1437fc79423958a5e4bd8b0e96bc863 (diff)
atmel-samd: Ensure at least 2k is left for the stack.
-rw-r--r--atmel-samd/boards/samd21x18-bootloader.ld8
-rw-r--r--atmel-samd/boards/samd21x18.ld8
2 files changed, 16 insertions, 0 deletions
diff --git a/atmel-samd/boards/samd21x18-bootloader.ld b/atmel-samd/boards/samd21x18-bootloader.ld
index 89ff084fb..b43c292b1 100644
--- a/atmel-samd/boards/samd21x18-bootloader.ld
+++ b/atmel-samd/boards/samd21x18-bootloader.ld
@@ -64,5 +64,13 @@ SECTIONS
_ebss = .;
} >RAM
+ /* this just checks there is enough RAM for a minimal stack */
+ .stack :
+ {
+ . = ALIGN(4);
+ . = . + 0x800; /* Reserve a minimum of 2K for the stack. */
+ . = ALIGN(4);
+ } >RAM
+
.ARM.attributes 0 : { *(.ARM.attributes) }
}
diff --git a/atmel-samd/boards/samd21x18.ld b/atmel-samd/boards/samd21x18.ld
index 0f1168c57..995d2754f 100644
--- a/atmel-samd/boards/samd21x18.ld
+++ b/atmel-samd/boards/samd21x18.ld
@@ -63,5 +63,13 @@ SECTIONS
_ebss = .;
} >RAM
+ /* this just checks there is enough RAM for a minimal stack */
+ .stack :
+ {
+ . = ALIGN(4);
+ . = . + 0x800; /* Reserve a minimum of 2K for the stack. */
+ . = ALIGN(4);
+ } >RAM
+
.ARM.attributes 0 : { *(.ARM.attributes) }
}