Skip to content
Permalink
Browse files

Fix the alignment of the stm32g4 stack

The stack was mis-aligned by 4 bytes, which caused things like passing
doubles through a variadic function call (say snprintf) to fail.
  • Loading branch information
jpieper committed Dec 6, 2019
1 parent c79bb81 commit 9a0b14e59f3e07dd3cfe0dee4cb04faa335711a2
Showing with 2 additions and 2 deletions.
  1. +2 −2 tools/workspace/mbed/stm32g4.patch
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --unidirectional-new-file -ru mbed-os-mbed-os-5.13.4-orig/targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G474xE/device/TOOLCHAIN_GCC_ARM/STM32G474XE.ld mbed-os-mbed-os-5.13.4/targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G474xE/device/TOOLCHAIN_GCC_ARM/STM32G474XE.ld
--- mbed-os-mbed-os-5.13.4-orig/targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G474xE/device/TOOLCHAIN_GCC_ARM/STM32G474XE.ld 1969-12-31 19:00:00.000000000 -0500
+++ mbed-os-mbed-os-5.13.4/targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G474xE/device/TOOLCHAIN_GCC_ARM/STM32G474XE.ld 2019-09-25 07:55:31.851277037 -0400
+++ mbed-os-mbed-os-5.13.4/targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G474xE/device/TOOLCHAIN_GCC_ARM/STM32G474XE.ld 2019-12-06 11:24:48.406234366 -0500
@@ -0,0 +1,169 @@
+#if !defined(MBED_APP_START)
+ #define MBED_APP_START 0x08000000
+MEMORY
+{
+ FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
+ RAM (rwx) : ORIGIN = 0x20000200, LENGTH = 128k - (0x200+0x4)
+ RAM (rwx) : ORIGIN = 0x20000200, LENGTH = 128k - (0x200+0x0)
+}
+
+/* Linker script to place sections and symbol values. Should be used together

0 comments on commit 9a0b14e

Please sign in to comment.
You can’t perform that action at this time.