Skip to content

Commit a4db9e7

Browse files
committed
Some linker script has the stack pointer __NOT__ 8-byte aligned
Ex: 0x20001FFF is the last valid byte address of RAM for NUCLEO_L053R8, but the error is that it is not aligned and there is no reason to put this value as stack pointer. When Cortex-M push something in the stack, it first decrement the stack pointer and then writes at the new address. So using initial value 0x20002000 is ok. The first word will be at address _estack-4, in RAM Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 47e9def commit a4db9e7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

variants/NUCLEO_F091RC/ldscript.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
ENTRY(Reset_Handler)
4747

4848
/* Highest address of the user mode stack */
49-
_estack = 0x20007FFF; /* end of RAM */
49+
_estack = 0x20008000; /* end of RAM */
5050
/* Generate a link error if heap and stack don't fit into RAM */
5151
_Min_Heap_Size = 0x200;; /* required amount of heap */
5252
_Min_Stack_Size = 0x400;; /* required amount of stack */

variants/NUCLEO_F303RE/ldscript.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
ENTRY(Reset_Handler)
4747

4848
/* Highest address of the user mode stack */
49-
_estack = 0x2000FFFF; /* end of RAM */
49+
_estack = 0x20010000; /* end of RAM */
5050
/* Generate a link error if heap and stack don't fit into RAM */
5151
_Min_Heap_Size = 0x200;; /* required amount of heap */
5252
_Min_Stack_Size = 0x400;; /* required amount of stack */

variants/NUCLEO_L053R8/ldscript.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
ENTRY(Reset_Handler)
4747

4848
/* Highest address of the user mode stack */
49-
_estack = 0x20001FFF; /* end of RAM */
49+
_estack = 0x20002000; /* end of RAM */
5050
/* Generate a link error if heap and stack don't fit into RAM */
5151
_Min_Heap_Size = 0x200;; /* required amount of heap */
5252
_Min_Stack_Size = 0x400;; /* required amount of stack */

variants/NUCLEO_L476RG/ldscript.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
ENTRY(Reset_Handler)
4747

4848
/* Highest address of the user mode stack */
49-
_estack = 0x20017FFF; /* end of RAM */
49+
_estack = 0x20018000; /* end of RAM */
5050
/* Generate a link error if heap and stack don't fit into RAM */
5151
_Min_Heap_Size = 0x200;; /* required amount of heap */
5252
_Min_Stack_Size = 0x400;; /* required amount of stack */

0 commit comments

Comments
 (0)