From 272982ee5417ea6bdd5873e36717ba9ae9a59ee4 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 19 Feb 2023 23:00:16 +0100 Subject: [PATCH] examples/stm32wb: fix linker script. cortex-m-rt 0.7.2 now enforces the stack is 8-byte aligned. Stack is placed at `ORIGIN(RAM) + LENGTH(RAM)` by default, which wasn't 8-byte-aligned. See https://github.com/rust-embedded/cortex-m/discussions/469 ST trims 8 bytes from start of RAM, and uses the whole 192kb, so let's just copy that: https://github.com/STMicroelectronics/STM32CubeWB/blob/bceb1dae09f912eae47fba059251d499ba32f4ca/Drivers/CMSIS/Device/ST/STM32WBxx/Source/Templates/gcc/linker/stm32wb55xx_flash_cm4.ld#L48 --- examples/stm32wb/memory.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/stm32wb/memory.x b/examples/stm32wb/memory.x index 2b4dcce34..ae14e5a12 100644 --- a/examples/stm32wb/memory.x +++ b/examples/stm32wb/memory.x @@ -6,7 +6,7 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 256K - RAM (xrw) : ORIGIN = 0x20000004, LENGTH = 191K + RAM (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K }