summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/boards/ARDUINO_PORTENTA_H7/stm32h747.ld11
-rw-r--r--ports/stm32/boards/PYBD_SF2/f722_qspi.ld22
-rw-r--r--ports/stm32/boards/PYBD_SF6/f767.ld11
-rw-r--r--ports/stm32/boards/STM32F769DISC/f769_qspi.ld24
-rw-r--r--ports/stm32/boards/common_basic.ld26
-rw-r--r--ports/stm32/boards/common_bl.ld28
-rw-r--r--ports/stm32/boards/common_blifs.ld28
-rw-r--r--ports/stm32/boards/common_extratext_data_in_flash.ld4
-rw-r--r--ports/stm32/boards/common_extratext_data_in_flash_app.ld22
-rw-r--r--ports/stm32/boards/common_extratext_data_in_flash_text.ld22
-rw-r--r--ports/stm32/boards/common_ifs.ld18
-rw-r--r--ports/stm32/boards/common_isr.ld9
-rw-r--r--ports/stm32/boards/common_text.ld14
13 files changed, 61 insertions, 178 deletions
diff --git a/ports/stm32/boards/ARDUINO_PORTENTA_H7/stm32h747.ld b/ports/stm32/boards/ARDUINO_PORTENTA_H7/stm32h747.ld
index 650756a19..7a973289c 100644
--- a/ports/stm32/boards/ARDUINO_PORTENTA_H7/stm32h747.ld
+++ b/ports/stm32/boards/ARDUINO_PORTENTA_H7/stm32h747.ld
@@ -44,15 +44,12 @@ _micropy_hw_internal_flash_storage_ram_cache_end = ORIGIN(DTCM) + LENGTH(DTCM);
_micropy_hw_internal_flash_storage_start = ORIGIN(FLASH_FS);
_micropy_hw_internal_flash_storage_end = ORIGIN(FLASH_FS) + LENGTH(FLASH_FS);
+REGION_ALIAS("FLASH_COMMON", FLASH_TEXT);
+
/* define output sections */
SECTIONS
{
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector))
- . = ALIGN(4);
- } >FLASH_TEXT
+ INCLUDE common_isr.ld
.text :
{
@@ -65,6 +62,6 @@ SECTIONS
_etext = .;
} >FLASH_TEXT
- INCLUDE common_extratext_data_in_flash_text.ld
+ INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
index c9199b341..85145b22a 100644
--- a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
+++ b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
@@ -42,6 +42,8 @@ _heap_end = _sstack;
ENTRY(Reset_Handler)
+REGION_ALIAS("FLASH_COMMON", FLASH_APP);
+
/* Define output sections */
SECTIONS
{
@@ -56,22 +58,8 @@ SECTIONS
. = ALIGN(4);
} >FLASH_EXT
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector))
- . = ALIGN(4);
- } >FLASH_APP
-
- .text :
- {
- . = ALIGN(4);
- *(.text*)
- *(.rodata*)
- . = ALIGN(4);
- _etext = .;
- } >FLASH_APP
-
- INCLUDE common_extratext_data_in_flash_app.ld
+ INCLUDE common_isr.ld
+ INCLUDE common_text.ld
+ INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/PYBD_SF6/f767.ld b/ports/stm32/boards/PYBD_SF6/f767.ld
index 5866f0b5c..cbe74696e 100644
--- a/ports/stm32/boards/PYBD_SF6/f767.ld
+++ b/ports/stm32/boards/PYBD_SF6/f767.ld
@@ -41,15 +41,12 @@ _heap_end = _sstack;
ENTRY(Reset_Handler)
+REGION_ALIAS("FLASH_COMMON", FLASH_APP);
+
/* Define output sections */
SECTIONS
{
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector))
- . = ALIGN(4);
- } >FLASH_APP
+ INCLUDE common_isr.ld
.text :
{
@@ -62,6 +59,6 @@ SECTIONS
_etext = .;
} >FLASH_APP
- INCLUDE common_extratext_data_in_flash_app.ld
+ INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/STM32F769DISC/f769_qspi.ld b/ports/stm32/boards/STM32F769DISC/f769_qspi.ld
index b6957a321..b6515b066 100644
--- a/ports/stm32/boards/STM32F769DISC/f769_qspi.ld
+++ b/ports/stm32/boards/STM32F769DISC/f769_qspi.ld
@@ -40,6 +40,8 @@ _heap_end = _sstack;
ENTRY(Reset_Handler)
+REGION_ALIAS("FLASH_COMMON", FLASH_APP);
+
SECTIONS
{
/* Define the code that goes in QSPI flash */
@@ -50,24 +52,8 @@ SECTIONS
. = ALIGN(4);
} >FLASH_QSPI
- /* The startup code goes first into main flash */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector))
- . = ALIGN(4);
- } >FLASH_APP
-
- /* The program code and other data goes into flash */
- .text :
- {
- . = ALIGN(4);
- *(.text*)
- *(.rodata*)
- . = ALIGN(4);
- _etext = .;
- } >FLASH_APP
-
- INCLUDE common_extratext_data_in_flash_app.ld
+ INCLUDE common_isr.ld
+ INCLUDE common_text.ld
+ INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_basic.ld b/ports/stm32/boards/common_basic.ld
index dbda1b8b6..9916a4c25 100644
--- a/ports/stm32/boards/common_basic.ld
+++ b/ports/stm32/boards/common_basic.ld
@@ -12,31 +12,13 @@
ENTRY(Reset_Handler)
+REGION_ALIAS("FLASH_COMMON", FLASH);
+
/* define output sections */
SECTIONS
{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
-
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text*) /* .text* sections (code) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- /* *(.glue_7) */ /* glue arm to thumb code */
- /* *(.glue_7t) */ /* glue thumb to arm code */
-
- . = ALIGN(4);
- _etext = .; /* define a global symbol at end of code */
- } >FLASH
-
+ INCLUDE common_isr.ld
+ INCLUDE common_text.ld
INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_bl.ld b/ports/stm32/boards/common_bl.ld
index 21d809a3d..b17fe9874 100644
--- a/ports/stm32/boards/common_bl.ld
+++ b/ports/stm32/boards/common_bl.ld
@@ -12,31 +12,13 @@
ENTRY(Reset_Handler)
+REGION_ALIAS("FLASH_COMMON", FLASH_APP);
+
/* define output sections */
SECTIONS
{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
-
- . = ALIGN(4);
- } >FLASH_APP
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text*) /* .text* sections (code) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- /* *(.glue_7) */ /* glue arm to thumb code */
- /* *(.glue_7t) */ /* glue thumb to arm code */
-
- . = ALIGN(4);
- _etext = .; /* define a global symbol at end of code */
- } >FLASH_APP
-
- INCLUDE common_extratext_data_in_flash_app.ld
+ INCLUDE common_isr.ld
+ INCLUDE common_text.ld
+ INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_blifs.ld b/ports/stm32/boards/common_blifs.ld
index 5517a2d09..51969e1f9 100644
--- a/ports/stm32/boards/common_blifs.ld
+++ b/ports/stm32/boards/common_blifs.ld
@@ -12,31 +12,13 @@
ENTRY(Reset_Handler)
+REGION_ALIAS("FLASH_COMMON", FLASH_TEXT);
+
/* define output sections */
SECTIONS
{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
-
- . = ALIGN(4);
- } >FLASH_TEXT
-
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text*) /* .text* sections (code) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- /* *(.glue_7) */ /* glue arm to thumb code */
- /* *(.glue_7t) */ /* glue thumb to arm code */
-
- . = ALIGN(4);
- _etext = .; /* define a global symbol at end of code */
- } >FLASH_TEXT
-
- INCLUDE common_extratext_data_in_flash_text.ld
+ INCLUDE common_isr.ld
+ INCLUDE common_text.ld
+ INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_extratext_data_in_flash.ld b/ports/stm32/boards/common_extratext_data_in_flash.ld
index eb9b86f49..db4306641 100644
--- a/ports/stm32/boards/common_extratext_data_in_flash.ld
+++ b/ports/stm32/boards/common_extratext_data_in_flash.ld
@@ -6,7 +6,7 @@
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
-} >FLASH
+} >FLASH_COMMON
/* Used by the start-up code to initialise data */
_sidata = LOADADDR(.data);
@@ -19,4 +19,4 @@ _sidata = LOADADDR(.data);
*(.data*)
. = ALIGN(4);
_edata = .;
-} >RAM AT> FLASH
+} >RAM AT> FLASH_COMMON
diff --git a/ports/stm32/boards/common_extratext_data_in_flash_app.ld b/ports/stm32/boards/common_extratext_data_in_flash_app.ld
deleted file mode 100644
index aba6bf57c..000000000
--- a/ports/stm32/boards/common_extratext_data_in_flash_app.ld
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This linker script fragment is intended to be included in SECTIONS. */
-
-/* For C++ exception handling */
-.ARM :
-{
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
-} >FLASH_APP
-
-/* Used by the start-up code to initialise data */
-_sidata = LOADADDR(.data);
-
-/* Initialised data section, start-up code will copy it from flash to RAM */
-.data :
-{
- . = ALIGN(4);
- _sdata = .;
- *(.data*)
- . = ALIGN(4);
- _edata = .;
-} >RAM AT> FLASH_APP
diff --git a/ports/stm32/boards/common_extratext_data_in_flash_text.ld b/ports/stm32/boards/common_extratext_data_in_flash_text.ld
deleted file mode 100644
index 5a29e4730..000000000
--- a/ports/stm32/boards/common_extratext_data_in_flash_text.ld
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This linker script fragment is intended to be included in SECTIONS. */
-
-/* For C++ exception handling */
-.ARM :
-{
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
-} >FLASH_TEXT
-
-/* Used by the start-up code to initialise data */
-_sidata = LOADADDR(.data);
-
-/* Initialised data section, start-up code will copy it from flash to RAM */
-.data :
-{
- . = ALIGN(4);
- _sdata = .;
- *(.data*)
- . = ALIGN(4);
- _edata = .;
-} >RAM AT> FLASH_TEXT
diff --git a/ports/stm32/boards/common_ifs.ld b/ports/stm32/boards/common_ifs.ld
index 733ca12f6..1876e4156 100644
--- a/ports/stm32/boards/common_ifs.ld
+++ b/ports/stm32/boards/common_ifs.ld
@@ -13,6 +13,8 @@
ENTRY(Reset_Handler)
+REGION_ALIAS("FLASH_COMMON", FLASH_TEXT);
+
/* define output sections */
SECTIONS
{
@@ -41,19 +43,7 @@ SECTIONS
. = ALIGN(4);
} >FLASH_ISR
- /* The program code and other data goes into FLASH */
- .text :
- {
- . = ALIGN(4);
- *(.text*) /* .text* sections (code) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- /* *(.glue_7) */ /* glue arm to thumb code */
- /* *(.glue_7t) */ /* glue thumb to arm code */
-
- . = ALIGN(4);
- _etext = .; /* define a global symbol at end of code */
- } >FLASH_TEXT
-
- INCLUDE common_extratext_data_in_flash_text.ld
+ INCLUDE common_text.ld
+ INCLUDE common_extratext_data_in_flash.ld
INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_isr.ld b/ports/stm32/boards/common_isr.ld
new file mode 100644
index 000000000..0f9b8bcaa
--- /dev/null
+++ b/ports/stm32/boards/common_isr.ld
@@ -0,0 +1,9 @@
+/* This linker script fragment is intended to be included in SECTIONS. */
+
+/* The startup code goes first into FLASH */
+.isr_vector :
+{
+ . = ALIGN(4);
+ KEEP(*(.isr_vector)) /* Startup code */
+ . = ALIGN(4);
+} >FLASH_COMMON
diff --git a/ports/stm32/boards/common_text.ld b/ports/stm32/boards/common_text.ld
new file mode 100644
index 000000000..16eea43ba
--- /dev/null
+++ b/ports/stm32/boards/common_text.ld
@@ -0,0 +1,14 @@
+/* This linker script fragment is intended to be included in SECTIONS. */
+
+/* The program code and other data goes into FLASH */
+.text :
+{
+ . = ALIGN(4);
+ *(.text*) /* .text* sections (code) */
+ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
+/* *(.glue_7) */ /* glue arm to thumb code */
+/* *(.glue_7t) */ /* glue thumb to arm code */
+
+ . = ALIGN(4);
+ _etext = .; /* define a global symbol at end of code */
+} >FLASH_COMMON