From 4b0326b1c874c790dd99102819529a69407e489a Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Thu, 11 Aug 2022 09:26:11 +0200 Subject: [PATCH] Fixed missing NOLOAD directive in STM32F405 linker scripts causing the linker to emit initialisation data for the BSS section at address 0x2000 0000 and, consequently, making the flasher to wipe up the settings region in MCU's internal flash. --- platform/mcu/STM32F4xx/linker_script_MDx.ld | 4 +++- platform/mcu/STM32F4xx/linker_script_Mod17.ld | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/mcu/STM32F4xx/linker_script_MDx.ld b/platform/mcu/STM32F4xx/linker_script_MDx.ld index 59ba6655..87dd7ff4 100644 --- a/platform/mcu/STM32F4xx/linker_script_MDx.ld +++ b/platform/mcu/STM32F4xx/linker_script_MDx.ld @@ -175,7 +175,9 @@ SECTIONS } > smallram _bss_end = .; - .bss2 : + /* Second BSS section located in the "large" RAM, explicitly request to not + initialize it */ + .bss2 (NOLOAD) : { *(.bss2) . = ALIGN(8); diff --git a/platform/mcu/STM32F4xx/linker_script_Mod17.ld b/platform/mcu/STM32F4xx/linker_script_Mod17.ld index 9070a814..7e229086 100644 --- a/platform/mcu/STM32F4xx/linker_script_Mod17.ld +++ b/platform/mcu/STM32F4xx/linker_script_Mod17.ld @@ -174,7 +174,9 @@ SECTIONS } > smallram _bss_end = .; - .bss2 : + /* Second BSS section located in the "large" RAM, explicitly request to not + initialize it */ + .bss2 (NOLOAD) : { *(.bss2) . = ALIGN(8);