summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-30 17:47:11 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-30 17:47:11 +1100
commit6b12934fecdf531f9199b835cff1c2dd501d149b (patch)
tree86eff11866c78d162c6497ccd1b82c84fe6abf7f
parenta52635245491214a6fe92dc357ff214bd6ff8892 (diff)
downloadmicropython-6b12934fecdf531f9199b835cff1c2dd501d149b.tar.gz
micropython-6b12934fecdf531f9199b835cff1c2dd501d149b.zip
stmhal: Fix stack pointer initialisation for F411 and F429 boards.
The stack pointer should start pointing 1 byte past the top of the end of RAM.
-rw-r--r--stmhal/boards/stm32f411.ld8
-rw-r--r--stmhal/boards/stm32f429.ld8
2 files changed, 8 insertions, 8 deletions
diff --git a/stmhal/boards/stm32f411.ld b/stmhal/boards/stm32f411.ld
index 823b5f56ad..0b7bcb553c 100644
--- a/stmhal/boards/stm32f411.ld
+++ b/stmhal/boards/stm32f411.ld
@@ -16,10 +16,10 @@ MEMORY
_minimum_stack_size = 2K;
_minimum_heap_size = 16K;
-/* top end of the stack */
-
-/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/
-_estack = ORIGIN(RAM) + LENGTH(RAM) - 1;
+/* Define tho top end of the stack. The stack is full descending so begins just
+ above last byte of RAM. Note that EABI requires the stack to be 8-byte
+ aligned for a call. */
+_estack = ORIGIN(RAM) + LENGTH(RAM);
/* define common sections and symbols */
INCLUDE common.ld
diff --git a/stmhal/boards/stm32f429.ld b/stmhal/boards/stm32f429.ld
index d199f45508..0feb5bd621 100644
--- a/stmhal/boards/stm32f429.ld
+++ b/stmhal/boards/stm32f429.ld
@@ -16,10 +16,10 @@ MEMORY
_minimum_stack_size = 2K;
_minimum_heap_size = 16K;
-/* top end of the stack */
-
-/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/
-_estack = ORIGIN(RAM) + LENGTH(RAM) - 1;
+/* Define tho top end of the stack. The stack is full descending so begins just
+ above last byte of RAM. Note that EABI requires the stack to be 8-byte
+ aligned for a call. */
+_estack = ORIGIN(RAM) + LENGTH(RAM);
/* define common sections and symbols */
INCLUDE common.ld