aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dario Nieuwenhuis <dirbaio@dirbaio.net> 2023-02-11 03:03:10 +0100
committerGravatar Dario Nieuwenhuis <dirbaio@dirbaio.net> 2023-02-11 03:42:56 +0100
commit34b14d802156a77c9533cab2349e93523ce0aa96 (patch)
tree8d540b62422397a55b15b9ab729515875ff4b21e
parentac8d42bb2e0b41ea29efe3fbeb85273d388e6a0c (diff)
downloadcortex-m-34b14d802156a77c9533cab2349e93523ce0aa96.tar.gz
cortex-m-34b14d802156a77c9533cab2349e93523ce0aa96.tar.zst
cortex-m-34b14d802156a77c9533cab2349e93523ce0aa96.zip
cortex-m-rt: assert in linker script that stack_start is 8-byte aligned.
-rw-r--r--cortex-m-rt/link.x.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in
index 4461646..9f893d4 100644
--- a/cortex-m-rt/link.x.in
+++ b/cortex-m-rt/link.x.in
@@ -217,6 +217,12 @@ BUG(cortex-m-rt): .bss is not 4-byte aligned");
ASSERT(__sheap % 4 == 0, "
BUG(cortex-m-rt): start of .heap is not 4-byte aligned");
+ASSERT(_stack_start % 8 == 0, "
+ERROR(cortex-m-rt): stack start address is not 8-byte aligned.
+If you have set _stack_start, check it's set to an address which is a multiple of 8 bytes.
+If you haven't, stack starts at the end of RAM by default. Check that both RAM
+origin and length are set to multiples of 8 in the `memory.x` file.");
+
/* # Position checks */
/* ## .vector_table */