From 3f884d501bc7f511a167a282a3c147e893a36304 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 27 Jul 2024 08:11:48 +1000 Subject: [PATCH] linker: ensure all sections align to 4 bytes --- Mcu/e230/GD32E230K8_FLASH.ld | 4 +++- Mcu/f031/STM32F031C6TX_FLASH.ld | 4 +++- Mcu/f051/STM32F051K6TX_FLASH.ld | 4 +++- Mcu/f415/AT32F415x8_FLASH.ld | 4 +++- Mcu/f421/AT32F421x6_FLASH.ld | 4 +++- Mcu/g071/STM32G071GBUX_FLASH.ld | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Mcu/e230/GD32E230K8_FLASH.ld b/Mcu/e230/GD32E230K8_FLASH.ld index 6ec5ad32f..dbc25809c 100644 --- a/Mcu/e230/GD32E230K8_FLASH.ld +++ b/Mcu/e230/GD32E230K8_FLASH.ld @@ -12,7 +12,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { FLASH (rx) : ORIGIN = 0x08001000, LENGTH = 27K -FLASH_VERSION (rx) : ORIGIN = 0x08007C00 - 48, LENGTH = 14 +FLASH_VERSION (rx) : ORIGIN = 0x08007C00 - 48, LENGTH = 16 FILE_NAME (rx) : ORIGIN = 0x08007C00 - 32, LENGTH = 32 EEPROM (rx) : ORIGIN = 0x08007C00, LENGTH = 1K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K @@ -88,6 +88,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.firmware_info)) + . = ALIGN(4); } >FLASH_VERSION /* The file name */ @@ -95,6 +96,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.file_name)) + . = ALIGN(4); } >FILE_NAME diff --git a/Mcu/f031/STM32F031C6TX_FLASH.ld b/Mcu/f031/STM32F031C6TX_FLASH.ld index 6031fc975..340cc4472 100644 --- a/Mcu/f031/STM32F031C6TX_FLASH.ld +++ b/Mcu/f031/STM32F031C6TX_FLASH.ld @@ -39,7 +39,7 @@ MEMORY SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192 RAM (xrw) : ORIGIN = 0x200000C0, LENGTH = 4K - 192 FLASH_VECTAB (rx) : ORIGIN = 0x08001000, LENGTH = 192 - FLASH_VERSION (rx) : ORIGIN = 0x080010C0, LENGTH = 14 + FLASH_VERSION (rx) : ORIGIN = 0x080010C0, LENGTH = 16 FLASH (rx) : ORIGIN = ORIGIN(FLASH_VERSION) + LENGTH(FLASH_VERSION), LENGTH = 27K - 32 -(LENGTH(FLASH_VECTAB) + LENGTH(FLASH_VERSION)) FILE_NAME (rx) : ORIGIN = 0x08007C00 - 32, LENGTH = 32 EEPROM (rx) : ORIGIN = 0x080007C00, LENGTH = 1K @@ -62,6 +62,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.firmware_info)) + . = ALIGN(4); } >FLASH_VERSION @@ -140,6 +141,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.file_name)) + . = ALIGN(4); } >FILE_NAME /* Used by the startup to initialize data */ diff --git a/Mcu/f051/STM32F051K6TX_FLASH.ld b/Mcu/f051/STM32F051K6TX_FLASH.ld index 7f6900380..fb4daf342 100644 --- a/Mcu/f051/STM32F051K6TX_FLASH.ld +++ b/Mcu/f051/STM32F051K6TX_FLASH.ld @@ -40,7 +40,7 @@ MEMORY SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192 RAM (xrw) : ORIGIN = 0x200000C0, LENGTH = 8K - 192 FLASH_VECTAB (rx) : ORIGIN = 0x08001000, LENGTH = 192 - FLASH_VERSION (rx) : ORIGIN = 0x080010C0, LENGTH = 14 + FLASH_VERSION (rx) : ORIGIN = 0x080010C0, LENGTH = 16 FLASH (rx) : ORIGIN = ORIGIN(FLASH_VERSION) + LENGTH(FLASH_VERSION), LENGTH = 27K - 32 - (LENGTH(FLASH_VECTAB) + LENGTH(FLASH_VERSION)) FILE_NAME (rx) : ORIGIN = 0x08007C00 - 32, LENGTH = 32 EEPROM (rx) : ORIGIN = 0x08007C00, LENGTH = 1K @@ -62,6 +62,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.firmware_info)) + . = ALIGN(4); } >FLASH_VERSION /* The program code and other data into "FLASH" Rom type memory */ @@ -136,6 +137,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.file_name)) + . = ALIGN(4); } >FILE_NAME diff --git a/Mcu/f415/AT32F415x8_FLASH.ld b/Mcu/f415/AT32F415x8_FLASH.ld index c2cb55c4f..6dabc92e4 100644 --- a/Mcu/f415/AT32F415x8_FLASH.ld +++ b/Mcu/f415/AT32F415x8_FLASH.ld @@ -32,7 +32,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { FLASH (rx) : ORIGIN = 0x08001000, LENGTH = 27K -FLASH_VERSION (rx) : ORIGIN = 0x08007C00 - 48, LENGTH = 14 +FLASH_VERSION (rx) : ORIGIN = 0x08007C00 - 48, LENGTH = 16 FILE_NAME (rx) : ORIGIN = 0x08007C00 - 32, LENGTH = 32 EEPROM (rx) : ORIGIN = 0x08007C00, LENGTH = 1K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K @@ -107,6 +107,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.firmware_info)) + . = ALIGN(4); } >FLASH_VERSION @@ -115,6 +116,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.file_name)) + . = ALIGN(4); } >FILE_NAME /* used by the startup to initialize data */ diff --git a/Mcu/f421/AT32F421x6_FLASH.ld b/Mcu/f421/AT32F421x6_FLASH.ld index f8c07c8d6..cd4f2433b 100644 --- a/Mcu/f421/AT32F421x6_FLASH.ld +++ b/Mcu/f421/AT32F421x6_FLASH.ld @@ -31,7 +31,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { FLASH (rx) : ORIGIN = 0x08001000, LENGTH = 27K -FLASH_VERSION (rx) : ORIGIN = 0x08007C00 - 48, LENGTH = 14 +FLASH_VERSION (rx) : ORIGIN = 0x08007C00 - 48, LENGTH = 16 FILE_NAME (rx) : ORIGIN = 0x08007C00 - 32, LENGTH = 32 EEPROM (rx) : ORIGIN = 0x08007C00, LENGTH = 1K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K @@ -107,6 +107,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.firmware_info)) + . = ALIGN(4); } >FLASH_VERSION /* The file name */ @@ -114,6 +115,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.file_name)) + . = ALIGN(4); } >FILE_NAME diff --git a/Mcu/g071/STM32G071GBUX_FLASH.ld b/Mcu/g071/STM32G071GBUX_FLASH.ld index a995fdf23..e4ab7737b 100644 --- a/Mcu/g071/STM32G071GBUX_FLASH.ld +++ b/Mcu/g071/STM32G071GBUX_FLASH.ld @@ -41,7 +41,7 @@ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 36K FLASH_VECTAB (rx) : ORIGIN = 0x08001000, LENGTH = 192 - FLASH_VERSION (rx) : ORIGIN = 0x080010C0, LENGTH = 14 + FLASH_VERSION (rx) : ORIGIN = 0x080010C0, LENGTH = 16 FLASH (rx) : ORIGIN = ORIGIN(FLASH_VERSION) + LENGTH(FLASH_VERSION), LENGTH = 62K - 32 - (LENGTH(FLASH_VECTAB) + LENGTH(FLASH_VERSION)) FILE_NAME (rx) : ORIGIN = 0x0800F800 - 32, LENGTH = 32 EEPROM (rx) : ORIGIN = 0x0800F800, LENGTH = 2K @@ -63,6 +63,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.firmware_info)) + . = ALIGN(4); } >FLASH_VERSION /* The program code and other data into "FLASH" Rom type memory */ @@ -139,6 +140,7 @@ SECTIONS { . = ALIGN(4); KEEP (*(.file_name)) + . = ALIGN(4); } >FILE_NAME /* Used by the startup to initialize data */