From 9fc9e766442532c6a67188d5830e207b7bf4a7a1 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 23 Feb 2021 19:30:53 +0200 Subject: [PATCH] Fix linker script stack alignment for boards with SRAM stack. * The stack pointer needs to be aligned to 8 bytes to conform with EABI, most of the boards are configured to use ITCM for stack, which starts at 0 and are Not affected by the linker script alignment. This patch fixes the issue with boards that use SRAM for stack which can get misaligned. --- src/omv/ports/stm32/stm32fxxx.ld.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/omv/ports/stm32/stm32fxxx.ld.S b/src/omv/ports/stm32/stm32fxxx.ld.S index 8ef281f58..840a0689c 100755 --- a/src/omv/ports/stm32/stm32fxxx.ld.S +++ b/src/omv/ports/stm32/stm32fxxx.ld.S @@ -208,11 +208,11 @@ SECTIONS /* Make sure there is enough ram for the stack */ ._stack (NOLOAD) : { - . = ALIGN(4); + . = ALIGN(8); _sstack = .; . = . + _stack_size; - . = ALIGN(4); + . = ALIGN(8); _estack = .; } >OMV_STACK_MEMORY