From 4990a4e03d386a9aeb9c06a8f05d8242bff0ddc9 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 21 Mar 2015 13:42:46 +0000 Subject: [PATCH] Enhanced GCC LD files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7787 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- .../ARMCMx/compilers/GCC/ld/STM32F030x8.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F051x8.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F072xB.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F100xB.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F103xB.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F103xD.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F103xE.ld | 23 +++- .../ld/STM32F103xE_maplemini_bootloader.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F103xG.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F107xC.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F303xC.ld | 24 +++- .../ARMCMx/compilers/GCC/ld/STM32F334x8.ld | 24 +++- .../ARMCMx/compilers/GCC/ld/STM32F373xC.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F401xC.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F401xE.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F405xG.ld | 25 +++- .../ARMCMx/compilers/GCC/ld/STM32F407xG.ld | 26 +++- .../ARMCMx/compilers/GCC/ld/STM32F411xC.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F411xE.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32F429xI.ld | 11 +- .../ARMCMx/compilers/GCC/ld/STM32L052x6.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32L052x8.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32L152xB.ld | 23 +++- .../ARMCMx/compilers/GCC/ld/STM32L152xE.ld | 23 +++- os/common/ports/ARMCMx/compilers/GCC/rules.ld | 125 ++++++++++++++++-- 25 files changed, 627 insertions(+), 45 deletions(-) diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F030x8.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F030x8.ld index a65d22a40..24b8f0d6c 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F030x8.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F030x8.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 64k - ram : org = 0x20000000, len = 8k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld index 69789fbe8..55ea322a8 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F051x8.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 64k - ram : org = 0x20000000, len = 8k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F072xB.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F072xB.ld index 29a8dcf00..5c75b2399 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F072xB.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F072xB.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 128k - ram : org = 0x20000000, len = 16k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F100xB.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F100xB.ld index 63934dbf5..304ab77c4 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F100xB.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F100xB.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 128k - ram : org = 0x20000000, len = 8k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xB.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xB.ld index 1950bea07..99653d259 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xB.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xB.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 128k - ram : org = 0x20000000, len = 20k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xD.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xD.ld index 7969afa7a..4f1409332 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xD.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xD.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 384k - ram : org = 0x20000000, len = 64k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE.ld index 6982853f0..a8f249632 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 512k - ram : org = 0x20000000, len = 64k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld index 3fdf2ff0d..64895a4ba 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld @@ -26,7 +26,28 @@ MEMORY { flash : org = 0x08005000, len = 512k - 0x5000 - ram : org = 0x20000C00, len = 64k - 0xC00 + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xG.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xG.ld index 8c91d830c..bf795887e 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xG.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xG.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 1m - ram : org = 0x20000000, len = 96k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F107xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F107xC.ld index 15165fc99..6d382f617 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F107xC.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F107xC.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 64k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld index 483e2457e..d01491695 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F303xC.ld @@ -23,8 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 40k - ccmram : org = 0x10000000, len = 8k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F334x8.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F334x8.ld index 419faef80..0121c5b67 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F334x8.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F334x8.ld @@ -23,8 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 64k - ram : org = 0x20000000, len = 12k - ccmram : org = 0x10000000, len = 4k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld index 168a71a25..1e6a22f23 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F373xC.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 32k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xC.ld index af2f2ed97..3b78c3e27 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xC.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xC.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 64k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xE.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xE.ld index c5728d269..7feed0a6c 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xE.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F401xE.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 512k - ram : org = 0x20000000, len = 96k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld index f822a2a7e..e061f7dcb 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F405xG.ld @@ -23,9 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 1M - ram : org = 0x20000000, len = 112k - ethram : org = 0x2001C000, len = 16k - ccmram : org = 0x10000000, len = 64k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld index 17eb0dae6..291eaf00e 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld @@ -19,13 +19,33 @@ /* * STM32F407xG memory setup. + * Note: Use of ram1 and ram2 is mutually exclusive with use of ram0. */ MEMORY { flash : org = 0x08000000, len = 1M - ram : org = 0x20000000, len = 112k - ethram : org = 0x2001C000, len = 16k - ccmram : org = 0x10000000, len = 64k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xC.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xC.ld index fa1fa8131..794070294 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xC.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xC.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 256k - ram : org = 0x20000000, len = 128k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xE.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xE.ld index 116b65ea3..14e191a31 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xE.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F411xE.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 512k - ram : org = 0x20000000, len = 128k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F429xI.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F429xI.ld index 47c11eeef..6a6f99181 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F429xI.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F429xI.ld @@ -19,12 +19,19 @@ /* * ST32F429xI memory setup. + * Note: Use of ram1, ram2 and ram3 is mutually exclusive with use of ram0. */ MEMORY { flash : org = 0x08000000, len = 2M - ram : org = 0x20000000, len = 192k - ccmram : org = 0x10000000, len = 64k + 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 } INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x6.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x6.ld index 575523e56..4655e3fbe 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x6.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x6.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 16k - ram : org = 0x20000000, len = 8k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x8.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x8.ld index 4fac81ef1..417adf567 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x8.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L052x8.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 64k - ram : org = 0x20000000, len = 8k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xB.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xB.ld index d97776f0c..334075283 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xB.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xB.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 128k - ram : org = 0x20000000, len = 16k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xE.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xE.ld index 769df65c6..e2e89310c 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xE.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32L152xE.ld @@ -23,7 +23,28 @@ MEMORY { flash : org = 0x08000000, len = 512k - ram : org = 0x20000000, len = 80k + 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 } +/* RAM region to be used for Main stack. This stack accommodates the processing + 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 + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + INCLUDE rules.ld diff --git a/os/common/ports/ARMCMx/compilers/GCC/rules.ld b/os/common/ports/ARMCMx/compilers/GCC/rules.ld index f7c1d6e7d..818c55122 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/rules.ld +++ b/os/common/ports/ARMCMx/compilers/GCC/rules.ld @@ -17,9 +17,30 @@ along with this program. If not, see . */ -__ram_start__ = ORIGIN(ram); -__ram_size__ = LENGTH(ram); -__ram_end__ = __ram_start__ + __ram_size__; +__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) @@ -91,22 +112,26 @@ SECTIONS _etext = .; _textdata = _etext; - .stacks : + .mstack : { . = ALIGN(8); __main_stack_base__ = .; . += __main_stack_size__; . = ALIGN(8); __main_stack_end__ = .; + } > MAIN_STACK_RAM + + .pstack : + { __process_stack_base__ = .; __main_thread_stack_base__ = .; . += __process_stack_size__; . = ALIGN(8); __process_stack_end__ = .; __main_thread_stack_end__ = .; - } > ram + } > PROCESS_STACK_RAM - .data ALIGN(4) : ALIGN(4) + .data : ALIGN(4) { . = ALIGN(4); PROVIDE(_data = .); @@ -115,9 +140,9 @@ SECTIONS *(.ramtext) . = ALIGN(4); PROVIDE(_edata = .); - } > ram AT > flash + } > DATA_RAM AT > flash - .bss ALIGN(4) : ALIGN(4) + .bss : ALIGN(4) { . = ALIGN(4); PROVIDE(_bss_start = .); @@ -126,11 +151,83 @@ SECTIONS *(COMMON) . = ALIGN(4); PROVIDE(_bss_end = .); - } > ram + PROVIDE(end = .); + } > BSS_RAM + + .ram0 : ALIGN(4) + { + . = ALIGN(4); + *(.ram0) + *(.ram0.*) + . = ALIGN(4); + __ram0_free__ = .; + } > ram0 + + .ram1 : ALIGN(4) + { + . = ALIGN(4); + *(.ram1) + *(.ram1.*) + . = ALIGN(4); + __ram1_free__ = .; + } > ram1 + + .ram2 : ALIGN(4) + { + . = ALIGN(4); + *(.ram2) + *(.ram2.*) + . = ALIGN(4); + __ram2_free__ = .; + } > ram2 + + .ram3 : ALIGN(4) + { + . = ALIGN(4); + *(.ram3) + *(.ram3.*) + . = ALIGN(4); + __ram3_free__ = .; + } > ram3 + + .ram4 : ALIGN(4) + { + . = ALIGN(4); + *(.ram4) + *(.ram4.*) + . = ALIGN(4); + __ram4_free__ = .; + } > ram4 + + .ram5 : ALIGN(4) + { + . = ALIGN(4); + *(.ram5) + *(.ram5.*) + . = ALIGN(4); + __ram5_free__ = .; + } > ram5 + + .ram6 : ALIGN(4) + { + . = ALIGN(4); + *(.ram6) + *(.ram6.*) + . = ALIGN(4); + __ram6_free__ = .; + } > ram6 + + .ram7 : ALIGN(4) + { + . = ALIGN(4); + *(.ram7) + *(.ram7.*) + . = ALIGN(4); + __ram7_free__ = .; + } > ram7 } -PROVIDE(end = .); -_end = .; - -__heap_base__ = _end; -__heap_end__ = __ram_end__; +/* Heap default boundaries, it is defaulted to be the non-used part + of ram0 region.*/ +__heap_base__ = __ram0_free__; +__heap_end__ = __ram0_end__;