From 215138abcf29dd99fa4916c442a4626d3550777a Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 27 Feb 2016 16:22:37 +0000 Subject: Enhanced .ld files. Mass update of shell demos. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8963 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- .../startup/ARMCMx/compilers/GCC/ld/STM32F030x4.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F030x6.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F030x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F031x6.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F042x6.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F051x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F072xB.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F091xC.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F100xB.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F103x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F103xB.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F103xD.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F103xE.ld | 55 +++- .../GCC/ld/STM32F103xE_maplemini_bootloader.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F103xG.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F107xC.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F207xG.ld | 56 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F302x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F303x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F303xC.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F334x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F373xC.ld | 57 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F401xC.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F401xE.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F405xG.ld | 56 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F407xG.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F411xC.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F411xE.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F429xI.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32F746xG.ld | 93 +++++- .../ARMCMx/compilers/GCC/ld/STM32F746xG_ETH.ld | 92 +++++- .../ARMCMx/compilers/GCC/ld/STM32F746xG_MAX.ld | 93 +++++- .../startup/ARMCMx/compilers/GCC/ld/STM32L052x6.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32L052x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32L053x8.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32L151x6.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32L152xB.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32L152xE.ld | 55 +++- .../startup/ARMCMx/compilers/GCC/ld/STM32L476xG.ld | 57 +++- os/common/startup/ARMCMx/compilers/GCC/ld/rules.ld | 8 + .../startup/ARMCMx/compilers/GCC/ld/rules_code.ld | 77 +++++ .../startup/ARMCMx/compilers/GCC/ld/rules_data.ld | 273 ++++++++++++++++ .../ARMCMx/compilers/GCC/ld/rules_stacks.ld | 38 +++ os/common/startup/ARMCMx/compilers/GCC/rules.ld | 359 --------------------- os/common/startup/ARMCMx/compilers/GCC/rules.mk | 65 ++-- 45 files changed, 2295 insertions(+), 789 deletions(-) create mode 100644 os/common/startup/ARMCMx/compilers/GCC/ld/rules.ld create mode 100644 os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld create mode 100644 os/common/startup/ARMCMx/compilers/GCC/ld/rules_data.ld create mode 100644 os/common/startup/ARMCMx/compilers/GCC/ld/rules_stacks.ld delete mode 100644 os/common/startup/ARMCMx/compilers/GCC/rules.ld (limited to 'os/common/startup/ARMCMx/compilers/GCC') diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x4.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x4.ld index 568383a1c..668c344a1 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x4.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x4.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 16k - ram0 : org = 0x20000000, len = 4k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 16k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 4k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x6.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x6.ld index dd73fddb3..843ce263b 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x6.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x6.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 32k - ram0 : org = 0x20000000, len = 4k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 32k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 4k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x8.ld index 2fbc8bfe0..d34d170ea 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F030x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F031x6.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F031x6.ld index b0cd9c425..8ead605b0 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F031x6.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F031x6.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 32k - ram0 : org = 0x20000000, len = 4k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 32k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 4k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F042x6.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F042x6.ld index 7d463fd2a..c57b7a296 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F042x6.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F042x6.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 32k - ram0 : org = 0x20000000, len = 6k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 32k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 6k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F051x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F051x8.ld index 7d2b38b12..8498a427e 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F051x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F051x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F072xB.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F072xB.ld index 5f992f790..cc361dee1 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F072xB.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F072xB.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 128k - ram0 : org = 0x20000000, len = 16k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 128k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 16k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F091xC.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F091xC.ld index 29d424ca8..90f50b915 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F091xC.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F091xC.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 256k - ram0 : org = 0x20000000, len = 32k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 256k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 32k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F100xB.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F100xB.ld index 72bbcaa11..1186788d4 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F100xB.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F100xB.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 128k - ram0 : org = 0x20000000, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 128k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103x8.ld index a05c40fb1..51f988eda 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 20k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xB.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xB.ld index ec492e687..c1485b9d9 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xB.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xB.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 128k - ram0 : org = 0x20000000, len = 20k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 128k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xD.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xD.ld index 47b5d6658..47d751e1b 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xD.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xD.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 384k - ram0 : org = 0x20000000, len = 64k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 384k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 64k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE.ld index ea9e3beef..64bf698d0 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 512k - ram0 : org = 0x20000000, len = 64k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 512k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 64k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld index f201aeb83..9f8a28378 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld @@ -22,19 +22,52 @@ */ MEMORY { - flash : org = 0x08005000, len = 512k - 0x5000 - ram0 : org = 0x20000C00, len = 64k - 0xC00 - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08005000, len = 512k - 0x5000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000C00, len = 64k - 0xC00 + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -43,6 +76,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -50,4 +84,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xG.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xG.ld index 1099b293f..38eec85c0 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xG.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xG.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 1m - ram0 : org = 0x20000000, len = 96k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 96k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F107xC.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F107xC.ld index d622b31e9..37f938acf 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F107xC.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F107xC.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 256k - ram0 : org = 0x20000000, len = 64k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 256k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 64k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F207xG.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F207xG.ld index 7c57d1c34..65787532c 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F207xG.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F207xG.ld @@ -20,19 +20,51 @@ */ MEMORY { - flash : org = 0x08000000, len = 1M - ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */ - ram1 : org = 0x20000000, len = 112k /* SRAM1 */ - ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ - ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} + flash0 : org = 0x08000000, len = 1M + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */ + ram1 : org = 0x20000000, len = 112k /* SRAM1 */ + ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ + ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -41,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -48,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F302x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F302x8.ld index 79b703bae..c38e64b9e 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F302x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F302x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 16k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 16k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303x8.ld index 62bd4113d..feacf165c 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 12k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x10000000, len = 4k - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 12k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x10000000, len = 4k + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303xC.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303xC.ld index a6f0693c1..7365b2f0e 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303xC.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F303xC.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 256k - ram0 : org = 0x20000000, len = 40k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x10000000, len = 8k - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 256k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 40k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x10000000, len = 8k + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F334x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F334x8.ld index ebf04a772..59bda4a2e 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F334x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F334x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 12k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x10000000, len = 4k - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 12k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x10000000, len = 4k + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F373xC.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F373xC.ld index eba00f83f..a69a1dc63 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F373xC.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F373xC.ld @@ -15,23 +15,56 @@ */ /* - * STM32F373xC memory setup. + * STM32F303xC memory setup. */ MEMORY { - flash : org = 0x08000000, len = 256k - ram0 : org = 0x20000000, len = 32k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 256k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 32k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xC.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xC.ld index ffe31ff11..b3c82d99c 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xC.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xC.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 256k - ram0 : org = 0x20000000, len = 64k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 256k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 64k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xE.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xE.ld index fdf49531a..760275f17 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xE.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F401xE.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 512k - ram0 : org = 0x20000000, len = 96k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 512k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 96k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F405xG.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F405xG.ld index ca21b9fd4..9e490da67 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F405xG.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F405xG.ld @@ -16,22 +16,56 @@ /* * STM32F405xG memory setup. + * Note: Use of ram1 and ram2 is mutually exclusive with use of ram0. */ MEMORY { - flash : org = 0x08000000, len = 1M - ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */ - ram1 : org = 0x20000000, len = 112k /* SRAM1 */ - ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ - ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */ + ram1 : org = 0x20000000, len = 112k /* SRAM1 */ + ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ + ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +74,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +82,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F407xG.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F407xG.ld index 8b1cba60a..7d474b980 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F407xG.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F407xG.ld @@ -20,19 +20,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 1M - ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */ - ram1 : org = 0x20000000, len = 112k /* SRAM1 */ - ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ - ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */ + ram1 : org = 0x20000000, len = 112k /* SRAM1 */ + ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ + ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -41,6 +74,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -48,4 +82,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xC.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xC.ld index bcd3411fd..b16f55641 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xC.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xC.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 256k - ram0 : org = 0x20000000, len = 128k /* SRAM1 */ - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 256k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 128k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xE.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xE.ld index 2d323573f..bfeda639f 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xE.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F411xE.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 512k - ram0 : org = 0x20000000, len = 128k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 512k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 128k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F429xI.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F429xI.ld index 185784df7..2d399e9d0 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F429xI.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F429xI.ld @@ -20,19 +20,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 2M - ram0 : org = 0x20000000, len = 192k /* SRAM1 + SRAM2 + SRAM3 */ - ram1 : org = 0x20000000, len = 112k /* SRAM1 */ - ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ - ram3 : org = 0x20020000, len = 64k /* SRAM3 */ - ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ - ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 192k /* SRAM1 + SRAM2 + SRAM3 */ + ram1 : org = 0x20000000, len = 112k /* SRAM1 */ + ram2 : org = 0x2001C000, len = 16k /* SRAM2 */ + ram3 : org = 0x20020000, len = 64k /* SRAM3 */ + ram4 : org = 0x10000000, len = 64k /* CCM SRAM */ + ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -41,6 +74,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -48,4 +82,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG.ld index e10c6ce63..7e847b969 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG.ld @@ -25,20 +25,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 1M - flash_itcm : org = 0x00200000, len = 1M - ram0 : org = 0x20010000, len = 256k /* SRAM1 + SRAM2 */ - ram1 : org = 0x20010000, len = 240k /* SRAM1 */ - ram2 : org = 0x2004C000, len = 16k /* SRAM2 */ - ram3 : org = 0x20000000, len = 64k /* DTCM-RAM */ - ram4 : org = 0x00000000, len = 16k /* ITCM-RAM */ - ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M /* Flash as AXIM (writable) */ + flash1 : org = 0x00200000, len = 1M /* Flash as ITCM */ + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20010000, len = 256k /* SRAM1 + SRAM2 */ + ram1 : org = 0x20010000, len = 240k /* SRAM1 */ + ram2 : org = 0x2004C000, len = 16k /* SRAM2 */ + ram3 : org = 0x20000000, len = 64k /* DTCM-RAM */ + ram4 : org = 0x00000000, len = 16k /* ITCM-RAM */ + ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash1); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash1); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash1); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash1); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram3); /* RAM region to be used for the process stack. This is the stack used by @@ -47,6 +79,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram3); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram3); @@ -54,10 +87,46 @@ REGION_ALIAS("BSS_RAM", ram3); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Stack rules inclusion.*/ +INCLUDE rules_stacks.ld + +/*===========================================================================*/ +/* Custom sections for STM32F7xx. */ +/*===========================================================================*/ + /* RAM region to be used for nocache segment.*/ REGION_ALIAS("NOCACHE_RAM", ram3); /* RAM region to be used for eth segment.*/ REGION_ALIAS("ETH_RAM", ram3); -INCLUDE ld/rules_STM32F7xx.ld +SECTIONS +{ + /* Special section for non cache-able areas.*/ + .nocache (NOLOAD) : ALIGN(4) + { + __nocache_base__ = .; + *(.nocache) + *(.nocache.*) + *(.bss.__nocache_*) + . = ALIGN(4); + __nocache_end__ = .; + } > NOCACHE_RAM + + /* Special section for Ethernet DMA non cache-able areas.*/ + .eth (NOLOAD) : ALIGN(4) + { + __eth_base__ = .; + *(.eth) + *(.eth.*) + *(.bss.__eth_*) + . = ALIGN(4); + __eth_end__ = .; + } > ETH_RAM +} + +/* Code rules inclusion.*/ +INCLUDE rules_code.ld + +/* Data rules inclusion.*/ +INCLUDE rules_data.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_ETH.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_ETH.ld index 4154cee84..9a3e3ead6 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_ETH.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_ETH.ld @@ -26,19 +26,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 1M - ram0 : org = 0x20010000, len = 256k /* SRAM1 + SRAM2 */ - ram1 : org = 0x20010000, len = 240k /* SRAM1 */ - ram2 : org = 0x2004C000, len = 16k /* SRAM2 */ - ram3 : org = 0x20000000, len = 64k /* DTCM-RAM */ - ram4 : org = 0x00000000, len = 16k /* ITCM-RAM */ - ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M /* Flash as AXIM (writable) */ + flash1 : org = 0x00200000, len = 1M /* Flash as ITCM */ + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20010000, len = 256k /* SRAM1 + SRAM2 */ + ram1 : org = 0x20010000, len = 240k /* SRAM1 */ + ram2 : org = 0x2004C000, len = 16k /* SRAM2 */ + ram3 : org = 0x20000000, len = 64k /* DTCM-RAM */ + ram4 : org = 0x00000000, len = 16k /* ITCM-RAM */ + ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash1); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash1); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash1); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash1); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram3); /* RAM region to be used for the process stack. This is the stack used by @@ -47,6 +80,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram3); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram1); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram3); @@ -54,10 +88,46 @@ REGION_ALIAS("BSS_RAM", ram3); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram1); +/* Stack rules inclusion.*/ +INCLUDE rules_stacks.ld + +/*===========================================================================*/ +/* Custom sections for STM32F7xx. */ +/*===========================================================================*/ + /* RAM region to be used for nocache segment.*/ REGION_ALIAS("NOCACHE_RAM", ram3); /* RAM region to be used for eth segment.*/ REGION_ALIAS("ETH_RAM", ram2); -INCLUDE rules_dma.ld +SECTIONS +{ + /* Special section for non cache-able areas.*/ + .nocache (NOLOAD) : ALIGN(4) + { + __nocache_base__ = .; + *(.nocache) + *(.nocache.*) + *(.bss.__nocache_*) + . = ALIGN(4); + __nocache_end__ = .; + } > NOCACHE_RAM + + /* Special section for Ethernet DMA non cache-able areas.*/ + .eth (NOLOAD) : ALIGN(4) + { + __eth_base__ = .; + *(.eth) + *(.eth.*) + *(.bss.__eth_*) + . = ALIGN(4); + __eth_end__ = .; + } > ETH_RAM +} + +/* Code rules inclusion.*/ +INCLUDE rules_code.ld + +/* Data rules inclusion.*/ +INCLUDE rules_data.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_MAX.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_MAX.ld index 4ac7e301d..37a7b7764 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_MAX.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F746xG_MAX.ld @@ -27,20 +27,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 1M - flash_itcm : org = 0x00200000, len = 1M - ram0 : org = 0x20010000, len = 256k /* SRAM1 + SRAM2 */ - ram1 : org = 0x20010000, len = 240k /* SRAM1 */ - ram2 : org = 0x2004C000, len = 16k /* SRAM2 */ - ram3 : org = 0x20000000, len = 64k /* DTCM-RAM */ - ram4 : org = 0x00000000, len = 16k /* ITCM-RAM */ - ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M /* Flash as AXIM (writable) */ + flash1 : org = 0x00200000, len = 1M /* Flash as ITCM */ + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20010000, len = 256k /* SRAM1 + SRAM2 */ + ram1 : org = 0x20010000, len = 240k /* SRAM1 */ + ram2 : org = 0x2004C000, len = 16k /* SRAM2 */ + ram3 : org = 0x20000000, len = 64k /* DTCM-RAM */ + ram4 : org = 0x00000000, len = 16k /* ITCM-RAM */ + ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */ + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash1); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash1); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash1); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash1); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram3); /* RAM region to be used for the process stack. This is the stack used by @@ -49,6 +81,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram3); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -56,10 +89,46 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Stack rules inclusion.*/ +INCLUDE rules_stacks.ld + +/*===========================================================================*/ +/* Custom sections for STM32F7xx. */ +/*===========================================================================*/ + /* RAM region to be used for nocache segment.*/ REGION_ALIAS("NOCACHE_RAM", ram3); /* RAM region to be used for eth segment.*/ REGION_ALIAS("ETH_RAM", ram3); -INCLUDE ld/rules_STM32F7xx.ld +SECTIONS +{ + /* Special section for non cache-able areas.*/ + .nocache (NOLOAD) : ALIGN(4) + { + __nocache_base__ = .; + *(.nocache) + *(.nocache.*) + *(.bss.__nocache_*) + . = ALIGN(4); + __nocache_end__ = .; + } > NOCACHE_RAM + + /* Special section for Ethernet DMA non cache-able areas.*/ + .eth (NOLOAD) : ALIGN(4) + { + __eth_base__ = .; + *(.eth) + *(.eth.*) + *(.bss.__eth_*) + . = ALIGN(4); + __eth_end__ = .; + } > ETH_RAM +} + +/* Code rules inclusion.*/ +INCLUDE rules_code.ld + +/* Data rules inclusion.*/ +INCLUDE rules_data.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x6.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x6.ld index a846ee0cb..3b500c508 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x6.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x6.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 16k - ram0 : org = 0x20000000, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 16k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x8.ld index 34550f7be..fa77e2ce6 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L052x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L053x8.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L053x8.ld index c31599bd4..5514ee764 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L053x8.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L053x8.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 64k - ram0 : org = 0x20000000, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 64k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L151x6.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L151x6.ld index df6eac82f..6a7d7924f 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L151x6.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L151x6.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 32k - ram0 : org = 0x20000000, len = 10k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 32k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 10k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xB.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xB.ld index efee423cd..445da6586 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xB.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xB.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 128k - ram0 : org = 0x20000000, len = 16k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 128k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 16k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xE.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xE.ld index 3a3b3a89a..f19fd4bd4 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xE.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L152xE.ld @@ -19,19 +19,52 @@ */ MEMORY { - flash : org = 0x08000000, len = 512k - ram0 : org = 0x20000000, len = 80k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 512k + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 80k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L476xG.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L476xG.ld index 386612a2a..f223eb7ef 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L476xG.ld +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/STM32L476xG.ld @@ -15,23 +15,56 @@ */ /* - * STM32F303xC memory setup. + * STM32L476xG memory setup. */ MEMORY { - flash : org = 0x08000000, len = 1M - ram0 : org = 0x20000000, len = 96k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x10000000, len = 32k - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 + flash0 : org = 0x08000000, len = 1M + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 96k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x10000000, len = 32k + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 } +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + /* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts*/ + of all exceptions and interrupts.*/ REGION_ALIAS("MAIN_STACK_RAM", ram0); /* RAM region to be used for the process stack. This is the stack used by @@ -40,6 +73,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0); /* RAM region to be used for data segment.*/ REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); /* RAM region to be used for BSS segment.*/ REGION_ALIAS("BSS_RAM", ram0); @@ -47,4 +81,5 @@ REGION_ALIAS("BSS_RAM", ram0); /* RAM region to be used for the default heap.*/ REGION_ALIAS("HEAP_RAM", ram0); +/* Generic rules inclusion.*/ INCLUDE rules.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/rules.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/rules.ld new file mode 100644 index 000000000..f6af71f72 --- /dev/null +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/rules.ld @@ -0,0 +1,8 @@ +/* Stack rules inclusion.*/ +INCLUDE rules_stacks.ld + +/* Code rules inclusion.*/ +INCLUDE rules_code.ld + +/* Data rules inclusion.*/ +INCLUDE rules_data.ld diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld new file mode 100644 index 000000000..cb04522b1 --- /dev/null +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_code.ld @@ -0,0 +1,77 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +ENTRY(Reset_Handler) + +SECTIONS +{ + vectors : ALIGN(16) SUBALIGN(16) + { + KEEP(*(.vectors)) + } > VECTORS_FLASH AT > VECTORS_FLASH_LMA + + xtors : ALIGN(4) SUBALIGN(4) + { + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + __fini_array_start = .; + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + __fini_array_end = .; + } > XTORS_FLASH AT > XTORS_FLASH_LMA + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text) + *(.text.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > TEXT_FLASH AT > TEXT_FLASH_LMA + + .rodata : ALIGN(4) + { + . = ALIGN(4); + __rodata_base__ = .; + *(.rodata) + *(.rodata.*) + . = ALIGN(4); + __rodata_end__ = .; + } > RODATA_FLASH AT > RODATA_FLASH_LMA + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > VARIOUS_FLASH AT > VARIOUS_FLASH_LMA + + .ARM.exidx : { + __exidx_start = .; + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + __exidx_end = .; + } > VARIOUS_FLASH AT > VARIOUS_FLASH_LMA + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > VARIOUS_FLASH AT > VARIOUS_FLASH_LMA + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > VARIOUS_FLASH AT > VARIOUS_FLASH_LMA +} diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/rules_data.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_data.ld new file mode 100644 index 000000000..6b51940db --- /dev/null +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_data.ld @@ -0,0 +1,273 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +__ram0_start__ = ORIGIN(ram0); +__ram0_size__ = LENGTH(ram0); +__ram0_end__ = __ram0_start__ + __ram0_size__; +__ram1_start__ = ORIGIN(ram1); +__ram1_size__ = LENGTH(ram1); +__ram1_end__ = __ram1_start__ + __ram1_size__; +__ram2_start__ = ORIGIN(ram2); +__ram2_size__ = LENGTH(ram2); +__ram2_end__ = __ram2_start__ + __ram2_size__; +__ram3_start__ = ORIGIN(ram3); +__ram3_size__ = LENGTH(ram3); +__ram3_end__ = __ram3_start__ + __ram3_size__; +__ram4_start__ = ORIGIN(ram4); +__ram4_size__ = LENGTH(ram4); +__ram4_end__ = __ram4_start__ + __ram4_size__; +__ram5_start__ = ORIGIN(ram5); +__ram5_size__ = LENGTH(ram5); +__ram5_end__ = __ram5_start__ + __ram5_size__; +__ram6_start__ = ORIGIN(ram6); +__ram6_size__ = LENGTH(ram6); +__ram6_end__ = __ram6_start__ + __ram6_size__; +__ram7_start__ = ORIGIN(ram7); +__ram7_size__ = LENGTH(ram7); +__ram7_end__ = __ram7_start__ + __ram7_size__; + +ENTRY(Reset_Handler) + +SECTIONS +{ + .data : ALIGN(4) + { + . = ALIGN(4); + PROVIDE(_textdata = LOADADDR(.data)); + PROVIDE(_data = .); + _textdata_start = LOADADDR(.data); + _data_start = .; + *(.data) + *(.data.*) + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + _data_end = .; + } > DATA_RAM AT > DATA_RAM_LMA + + .bss (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + _bss_start = .; + *(.bss) + *(.bss.*) + *(COMMON) + . = ALIGN(4); + _bss_end = .; + PROVIDE(end = .); + } > BSS_RAM + + .ram0_init : ALIGN(4) + { + . = ALIGN(4); + __ram0_init_text__ = LOADADDR(.ram0_init); + __ram0_init__ = .; + *(.ram0_init) + *(.ram0_init.*) + . = ALIGN(4); + } > ram0 AT > RAM_INIT_FLASH_LMA + + .ram0 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram0_clear__ = .; + *(.ram0_clear) + *(.ram0_clear.*) + . = ALIGN(4); + __ram0_noinit__ = .; + *(.ram0) + *(.ram0.*) + . = ALIGN(4); + __ram0_free__ = .; + } > ram0 + + .ram1_init : ALIGN(4) + { + . = ALIGN(4); + __ram1_init_text__ = LOADADDR(.ram1_init); + __ram1_init__ = .; + *(.ram1_init) + *(.ram1_init.*) + . = ALIGN(4); + } > ram1 AT > RAM_INIT_FLASH_LMA + + .ram1 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram1_clear__ = .; + *(.ram1_clear) + *(.ram1_clear.*) + . = ALIGN(4); + __ram1_noinit__ = .; + *(.ram1) + *(.ram1.*) + . = ALIGN(4); + __ram1_free__ = .; + } > ram1 + + .ram2_init : ALIGN(4) + { + . = ALIGN(4); + __ram2_init_text__ = LOADADDR(.ram2_init); + __ram2_init__ = .; + *(.ram2_init) + *(.ram2_init.*) + . = ALIGN(4); + } > ram2 AT > RAM_INIT_FLASH_LMA + + .ram2 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram2_clear__ = .; + *(.ram2_clear) + *(.ram2_clear.*) + . = ALIGN(4); + __ram2_noinit__ = .; + *(.ram2) + *(.ram2.*) + . = ALIGN(4); + __ram2_free__ = .; + } > ram2 + + .ram3_init : ALIGN(4) + { + . = ALIGN(4); + __ram3_init_text__ = LOADADDR(.ram3_init); + __ram3_init__ = .; + *(.ram3_init) + *(.ram3_init.*) + . = ALIGN(4); + } > ram3 AT > RAM_INIT_FLASH_LMA + + .ram3 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram3_clear__ = .; + *(.ram3_clear) + *(.ram3_clear.*) + . = ALIGN(4); + __ram3_noinit__ = .; + *(.ram3) + *(.ram3.*) + . = ALIGN(4); + __ram3_free__ = .; + } > ram3 + + .ram4_init : ALIGN(4) + { + . = ALIGN(4); + __ram4_init_text__ = LOADADDR(.ram4_init); + __ram4_init__ = .; + *(.ram4_init) + *(.ram4_init.*) + . = ALIGN(4); + } > ram4 AT > RAM_INIT_FLASH_LMA + + .ram4 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram4_clear__ = .; + *(.ram4_clear) + *(.ram4_clear.*) + . = ALIGN(4); + __ram4_noinit__ = .; + *(.ram4) + *(.ram4.*) + . = ALIGN(4); + __ram4_free__ = .; + } > ram4 + + .ram5_init : ALIGN(4) + { + . = ALIGN(4); + __ram5_init_text__ = LOADADDR(.ram5_init); + __ram5_init__ = .; + *(.ram5_init) + *(.ram5_init.*) + . = ALIGN(4); + } > ram5 AT > RAM_INIT_FLASH_LMA + + .ram5 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram5_clear__ = .; + *(.ram5_clear) + *(.ram5_clear.*) + . = ALIGN(4); + __ram5_noinit__ = .; + *(.ram5) + *(.ram5.*) + . = ALIGN(4); + __ram5_free__ = .; + } > ram5 + + .ram6_init : ALIGN(4) + { + . = ALIGN(4); + __ram6_init_text__ = LOADADDR(.ram6_init); + __ram6_init__ = .; + *(.ram6_init) + *(.ram6_init.*) + . = ALIGN(4); + } > ram6 AT > RAM_INIT_FLASH_LMA + + .ram6 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram6_clear__ = .; + *(.ram6_clear) + *(.ram6_clear.*) + . = ALIGN(4); + __ram6_noinit__ = .; + *(.ram6) + *(.ram6.*) + . = ALIGN(4); + __ram6_free__ = .; + } > ram6 + + .ram7_init : ALIGN(4) + { + . = ALIGN(4); + __ram7_init_text__ = LOADADDR(.ram7_init); + __ram7_init__ = .; + *(.ram7_init) + *(.ram7_init.*) + . = ALIGN(4); + } > ram7 AT > RAM_INIT_FLASH_LMA + + .ram7 (NOLOAD) : ALIGN(4) + { + . = ALIGN(4); + __ram7_clear__ = .; + *(.ram7_clear) + *(.ram7_clear.*) + . = ALIGN(4); + __ram7_noinit__ = .; + *(.ram7) + *(.ram7.*) + . = ALIGN(4); + __ram7_free__ = .; + } > ram7 + + /* The default heap uses the (statically) unused part of a RAM section.*/ + .heap (NOLOAD) : + { + . = ALIGN(8); + __heap_base__ = .; + . = ORIGIN(HEAP_RAM) + LENGTH(HEAP_RAM); + __heap_end__ = .; + } > HEAP_RAM +} diff --git a/os/common/startup/ARMCMx/compilers/GCC/ld/rules_stacks.ld b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_stacks.ld new file mode 100644 index 000000000..c6aa6e048 --- /dev/null +++ b/os/common/startup/ARMCMx/compilers/GCC/ld/rules_stacks.ld @@ -0,0 +1,38 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +SECTIONS +{ + /* Special section for exceptions stack.*/ + .mstack : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + } > MAIN_STACK_RAM + + /* Special section for process stack.*/ + .pstack : + { + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > PROCESS_STACK_RAM +} diff --git a/os/common/startup/ARMCMx/compilers/GCC/rules.ld b/os/common/startup/ARMCMx/compilers/GCC/rules.ld deleted file mode 100644 index 7d395d827..000000000 --- a/os/common/startup/ARMCMx/compilers/GCC/rules.ld +++ /dev/null @@ -1,359 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -__ram0_start__ = ORIGIN(ram0); -__ram0_size__ = LENGTH(ram0); -__ram0_end__ = __ram0_start__ + __ram0_size__; -__ram1_start__ = ORIGIN(ram1); -__ram1_size__ = LENGTH(ram1); -__ram1_end__ = __ram1_start__ + __ram1_size__; -__ram2_start__ = ORIGIN(ram2); -__ram2_size__ = LENGTH(ram2); -__ram2_end__ = __ram2_start__ + __ram2_size__; -__ram3_start__ = ORIGIN(ram3); -__ram3_size__ = LENGTH(ram3); -__ram3_end__ = __ram3_start__ + __ram3_size__; -__ram4_start__ = ORIGIN(ram4); -__ram4_size__ = LENGTH(ram4); -__ram4_end__ = __ram4_start__ + __ram4_size__; -__ram5_start__ = ORIGIN(ram5); -__ram5_size__ = LENGTH(ram5); -__ram5_end__ = __ram5_start__ + __ram5_size__; -__ram6_start__ = ORIGIN(ram6); -__ram6_size__ = LENGTH(ram6); -__ram6_end__ = __ram6_start__ + __ram6_size__; -__ram7_start__ = ORIGIN(ram7); -__ram7_size__ = LENGTH(ram7); -__ram7_end__ = __ram7_start__ + __ram7_size__; - -ENTRY(Reset_Handler) - -SECTIONS -{ - . = 0; - _text = .; - - startup : ALIGN(16) SUBALIGN(16) - { - KEEP(*(.vectors)) - } > flash - - constructors : ALIGN(4) SUBALIGN(4) - { - __init_array_start = .; - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - __init_array_end = .; - } > flash - - destructors : ALIGN(4) SUBALIGN(4) - { - __fini_array_start = .; - KEEP(*(.fini_array)) - KEEP(*(SORT(.fini_array.*))) - __fini_array_end = .; - } > flash - - .text : ALIGN(16) SUBALIGN(16) - { - *(.text) - *(.text.*) - *(.rodata) - *(.rodata.*) - *(.glue_7t) - *(.glue_7) - *(.gcc*) - } > flash - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > flash - - .ARM.exidx : { - __exidx_start = .; - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - __exidx_end = .; - } > flash - - .eh_frame_hdr : - { - *(.eh_frame_hdr) - } > flash - - .eh_frame : ONLY_IF_RO - { - *(.eh_frame) - } > flash - - .textalign : ONLY_IF_RO - { - . = ALIGN(8); - } > flash - - /* Legacy symbol, not used anywhere.*/ - . = ALIGN(4); - PROVIDE(_etext = .); - - /* Special section for exceptions stack.*/ - .mstack : - { - . = ALIGN(8); - __main_stack_base__ = .; - . += __main_stack_size__; - . = ALIGN(8); - __main_stack_end__ = .; - } > MAIN_STACK_RAM - - /* Special section for process stack.*/ - .pstack : - { - __process_stack_base__ = .; - __main_thread_stack_base__ = .; - . += __process_stack_size__; - . = ALIGN(8); - __process_stack_end__ = .; - __main_thread_stack_end__ = .; - } > PROCESS_STACK_RAM - - .data : ALIGN(4) - { - . = ALIGN(4); - PROVIDE(_textdata = LOADADDR(.data)); - PROVIDE(_data = .); - _textdata_start = LOADADDR(.data); - _data_start = .; - *(.data) - *(.data.*) - *(.ramtext) - . = ALIGN(4); - PROVIDE(_edata = .); - _data_end = .; - } > DATA_RAM AT > flash - - .bss (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - _bss_start = .; - *(.bss) - *(.bss.*) - *(COMMON) - . = ALIGN(4); - _bss_end = .; - PROVIDE(end = .); - } > BSS_RAM - - .ram0_init : ALIGN(4) - { - . = ALIGN(4); - __ram0_init_text__ = LOADADDR(.ram0_init); - __ram0_init__ = .; - *(.ram0_init) - *(.ram0_init.*) - . = ALIGN(4); - } > ram0 AT > flash - - .ram0 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram0_clear__ = .; - *(.ram0_clear) - *(.ram0_clear.*) - . = ALIGN(4); - __ram0_noinit__ = .; - *(.ram0) - *(.ram0.*) - . = ALIGN(4); - __ram0_free__ = .; - } > ram0 - - .ram1_init : ALIGN(4) - { - . = ALIGN(4); - __ram1_init_text__ = LOADADDR(.ram1_init); - __ram1_init__ = .; - *(.ram1_init) - *(.ram1_init.*) - . = ALIGN(4); - } > ram1 AT > flash - - .ram1 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram1_clear__ = .; - *(.ram1_clear) - *(.ram1_clear.*) - . = ALIGN(4); - __ram1_noinit__ = .; - *(.ram1) - *(.ram1.*) - . = ALIGN(4); - __ram1_free__ = .; - } > ram1 - - .ram2_init : ALIGN(4) - { - . = ALIGN(4); - __ram2_init_text__ = LOADADDR(.ram2_init); - __ram2_init__ = .; - *(.ram2_init) - *(.ram2_init.*) - . = ALIGN(4); - } > ram2 AT > flash - - .ram2 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram2_clear__ = .; - *(.ram2_clear) - *(.ram2_clear.*) - . = ALIGN(4); - __ram2_noinit__ = .; - *(.ram2) - *(.ram2.*) - . = ALIGN(4); - __ram2_free__ = .; - } > ram2 - - .ram3_init : ALIGN(4) - { - . = ALIGN(4); - __ram3_init_text__ = LOADADDR(.ram3_init); - __ram3_init__ = .; - *(.ram3_init) - *(.ram3_init.*) - . = ALIGN(4); - } > ram3 AT > flash - - .ram3 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram3_clear__ = .; - *(.ram3_clear) - *(.ram3_clear.*) - . = ALIGN(4); - __ram3_noinit__ = .; - *(.ram3) - *(.ram3.*) - . = ALIGN(4); - __ram3_free__ = .; - } > ram3 - - .ram4_init : ALIGN(4) - { - . = ALIGN(4); - __ram4_init_text__ = LOADADDR(.ram4_init); - __ram4_init__ = .; - *(.ram4_init) - *(.ram4_init.*) - . = ALIGN(4); - } > ram4 AT > flash - - .ram4 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram4_clear__ = .; - *(.ram4_clear) - *(.ram4_clear.*) - . = ALIGN(4); - __ram4_noinit__ = .; - *(.ram4) - *(.ram4.*) - . = ALIGN(4); - __ram4_free__ = .; - } > ram4 - - .ram5_init : ALIGN(4) - { - . = ALIGN(4); - __ram5_init_text__ = LOADADDR(.ram5_init); - __ram5_init__ = .; - *(.ram5_init) - *(.ram5_init.*) - . = ALIGN(4); - } > ram5 AT > flash - - .ram5 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram5_clear__ = .; - *(.ram5_clear) - *(.ram5_clear.*) - . = ALIGN(4); - __ram5_noinit__ = .; - *(.ram5) - *(.ram5.*) - . = ALIGN(4); - __ram5_free__ = .; - } > ram5 - - .ram6_init : ALIGN(4) - { - . = ALIGN(4); - __ram6_init_text__ = LOADADDR(.ram6_init); - __ram6_init__ = .; - *(.ram6_init) - *(.ram6_init.*) - . = ALIGN(4); - } > ram6 AT > flash - - .ram6 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram6_clear__ = .; - *(.ram6_clear) - *(.ram6_clear.*) - . = ALIGN(4); - __ram6_noinit__ = .; - *(.ram6) - *(.ram6.*) - . = ALIGN(4); - __ram6_free__ = .; - } > ram6 - - .ram7_init : ALIGN(4) - { - . = ALIGN(4); - __ram7_init_text__ = LOADADDR(.ram7_init); - __ram7_init__ = .; - *(.ram7_init) - *(.ram7_init.*) - . = ALIGN(4); - } > ram7 AT > flash - - .ram7 (NOLOAD) : ALIGN(4) - { - . = ALIGN(4); - __ram7_clear__ = .; - *(.ram7_clear) - *(.ram7_clear.*) - . = ALIGN(4); - __ram7_noinit__ = .; - *(.ram7) - *(.ram7.*) - . = ALIGN(4); - __ram7_free__ = .; - } > ram7 - - /* The default heap uses the (statically) unused part of a RAM section.*/ - .heap (NOLOAD) : - { - . = ALIGN(8); - __heap_base__ = .; - . = ORIGIN(HEAP_RAM) + LENGTH(HEAP_RAM); - __heap_end__ = .; - } > HEAP_RAM -} diff --git a/os/common/startup/ARMCMx/compilers/GCC/rules.mk b/os/common/startup/ARMCMx/compilers/GCC/rules.mk index 2434be9cd..5d64ec915 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/rules.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/rules.mk @@ -5,13 +5,13 @@ # # Compiler options -OPT = $(USE_OPT) -COPT = $(USE_COPT) -CPPOPT = $(USE_CPPOPT) +OPT := $(USE_OPT) +COPT := $(USE_COPT) +CPPOPT := $(USE_CPPOPT) # Garbage collection ifeq ($(USE_LINK_GC),yes) - OPT += -ffunction-sections -fdata-sections -fno-common + OPT += -ffunction-sections -fdata-sections -fno-common LDOPT := ,--gc-sections else LDOPT := @@ -32,11 +32,11 @@ ifeq ($(USE_FPU),) USE_FPU = no endif ifneq ($(USE_FPU),no) - OPT += -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant - DDEFS += -DCORTEX_USE_FPU=TRUE + OPT += -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant + DDEFS += -DCORTEX_USE_FPU=TRUE DADEFS += -DCORTEX_USE_FPU=TRUE else - DDEFS += -DCORTEX_USE_FPU=FALSE + DDEFS += -DCORTEX_USE_FPU=FALSE DADEFS += -DCORTEX_USE_FPU=FALSE endif @@ -61,11 +61,11 @@ endif ifeq ($(BUILDDIR),.) BUILDDIR = build endif -OUTFILES = $(BUILDDIR)/$(PROJECT).elf \ - $(BUILDDIR)/$(PROJECT).hex \ - $(BUILDDIR)/$(PROJECT).bin \ - $(BUILDDIR)/$(PROJECT).dmp \ - $(BUILDDIR)/$(PROJECT).list +OUTFILES := $(BUILDDIR)/$(PROJECT).elf \ + $(BUILDDIR)/$(PROJECT).hex \ + $(BUILDDIR)/$(PROJECT).bin \ + $(BUILDDIR)/$(PROJECT).dmp \ + $(BUILDDIR)/$(PROJECT).list ifdef SREC OUTFILES += $(BUILDDIR)/$(PROJECT).srec @@ -73,42 +73,43 @@ endif # Source files groups and paths ifeq ($(USE_THUMB),yes) - TCSRC += $(CSRC) + TCSRC += $(CSRC) TCPPSRC += $(CPPSRC) else - ACSRC += $(CSRC) + ACSRC += $(CSRC) ACPPSRC += $(CPPSRC) endif -ASRC = $(ACSRC)$(ACPPSRC) -TSRC = $(TCSRC)$(TCPPSRC) -SRCPATHS = $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(ASRC)) $(dir $(TSRC))) +ASRC := $(ACSRC)$(ACPPSRC) +TSRC := $(TCSRC)$(TCPPSRC) +SRCPATHS := $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(ASRC)) $(dir $(TSRC))) # Various directories -OBJDIR = $(BUILDDIR)/obj -LSTDIR = $(BUILDDIR)/lst +OBJDIR := $(BUILDDIR)/obj +LSTDIR := $(BUILDDIR)/lst # Object files groups -ACOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACSRC:.c=.o))) -ACPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACPPSRC:.cpp=.o))) -TCOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCSRC:.c=.o))) -TCPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCPPSRC:.cpp=.o))) -ASMOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMSRC:.s=.o))) -ASMXOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMXSRC:.S=.o))) -OBJS = $(ASMXOBJS) $(ASMOBJS) $(ACOBJS) $(TCOBJS) $(ACPPOBJS) $(TCPPOBJS) +ACOBJS := $(addprefix $(OBJDIR)/, $(notdir $(ACSRC:.c=.o))) +ACPPOBJS := $(addprefix $(OBJDIR)/, $(notdir $(ACPPSRC:.cpp=.o))) +TCOBJS := $(addprefix $(OBJDIR)/, $(notdir $(TCSRC:.c=.o))) +TCPPOBJS := $(addprefix $(OBJDIR)/, $(notdir $(TCPPSRC:.cpp=.o))) +ASMOBJS := $(addprefix $(OBJDIR)/, $(notdir $(ASMSRC:.s=.o))) +ASMXOBJS := $(addprefix $(OBJDIR)/, $(notdir $(ASMXSRC:.S=.o))) +OBJS := $(ASMXOBJS) $(ASMOBJS) $(ACOBJS) $(TCOBJS) $(ACPPOBJS) $(TCPPOBJS) # Paths -IINCDIR = $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR)) -LLIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR)) +IINCDIR := $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR)) +LLIBDIR := $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR)) +LLIBDIR += -L$(dir $(LDSCRIPT)) # Macros -DEFS = $(DDEFS) $(UDEFS) -ADEFS = $(DADEFS) $(UADEFS) +DEFS := $(DDEFS) $(UDEFS) +ADEFS := $(DADEFS) $(UADEFS) # Libs -LIBS = $(DLIBS) $(ULIBS) +LIBS := $(DLIBS) $(ULIBS) # Various settings -MCFLAGS = -mcpu=$(MCU) +MCFLAGS := -mcpu=$(MCU) ODFLAGS = -x --syms ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS) ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS) -- cgit v1.2.3