summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/boards/PYBD_SF2/f722_qspi.ld37
-rw-r--r--ports/stm32/boards/PYBD_SF6/f767.ld36
-rw-r--r--ports/stm32/boards/STM32F769DISC/f769_qspi.ld41
-rw-r--r--ports/stm32/boards/common_basic.ld48
-rw-r--r--ports/stm32/boards/common_bl.ld48
-rw-r--r--ports/stm32/boards/common_blifs.ld48
-rw-r--r--ports/stm32/boards/common_bss_heap_stack.ld28
-rw-r--r--ports/stm32/boards/common_extratext_data_in_flash.ld14
-rw-r--r--ports/stm32/boards/common_extratext_data_in_flash_app.ld14
-rw-r--r--ports/stm32/boards/common_extratext_data_in_flash_text.ld14
-rw-r--r--ports/stm32/boards/common_ifs.ld48
11 files changed, 84 insertions, 292 deletions
diff --git a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
index 3b2e45d9b6..c9199b341b 100644
--- a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
+++ b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
@@ -72,39 +72,6 @@ SECTIONS
_etext = .;
} >FLASH_APP
- _sidata = LOADADDR(.data);
-
- .data :
- {
- . = ALIGN(4);
- _sdata = .;
- *(.data*)
-
- . = ALIGN(4);
- _edata = .;
- } >RAM AT> FLASH_APP
-
- .bss :
- {
- . = ALIGN(4);
- _sbss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = .;
- } >RAM
-
- .heap :
- {
- . = ALIGN(4);
- . = . + _minimum_heap_size;
- . = ALIGN(4);
- } >RAM
-
- .stack :
- {
- . = ALIGN(4);
- . = . + _minimum_stack_size;
- . = ALIGN(4);
- } >RAM
+ INCLUDE common_extratext_data_in_flash_app.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 1dd4c11ed9..5866f0b5cc 100644
--- a/ports/stm32/boards/PYBD_SF6/f767.ld
+++ b/ports/stm32/boards/PYBD_SF6/f767.ld
@@ -62,38 +62,6 @@ SECTIONS
_etext = .;
} >FLASH_APP
- _sidata = LOADADDR(.data);
-
- .data :
- {
- . = ALIGN(4);
- _sdata = .;
- *(.data*)
- . = ALIGN(4);
- _edata = .;
- } >RAM AT> FLASH_APP
-
- .bss :
- {
- . = ALIGN(4);
- _sbss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = .;
- } >RAM
-
- .heap :
- {
- . = ALIGN(4);
- . = . + _minimum_heap_size;
- . = ALIGN(4);
- } >RAM
-
- .stack :
- {
- . = ALIGN(4);
- . = . + _minimum_stack_size;
- . = ALIGN(4);
- } >RAM
+ INCLUDE common_extratext_data_in_flash_app.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 5f920b417f..b6957a3213 100644
--- a/ports/stm32/boards/STM32F769DISC/f769_qspi.ld
+++ b/ports/stm32/boards/STM32F769DISC/f769_qspi.ld
@@ -68,43 +68,6 @@ SECTIONS
_etext = .;
} >FLASH_APP
- /* Used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* The initialized data section */
- .data :
- {
- . = ALIGN(4);
- _sdata = .;
- *(.data*)
- . = ALIGN(4);
- _edata = .;
- } >RAM AT> FLASH_APP
-
- /* The uninitialized (zeroed) data section */
- .bss :
- {
- . = ALIGN(4);
- _sbss = .;
- *(.bss*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = .;
- } >RAM
-
- /* Define the start of the heap, and make sure we have a minimum size */
- .heap :
- {
- . = ALIGN(4);
- . = . + _minimum_heap_size;
- . = ALIGN(4);
- } >RAM
-
- /* Just checks there is enough RAM for the stack */
- .stack :
- {
- . = ALIGN(4);
- . = . + _minimum_stack_size;
- . = ALIGN(4);
- } >RAM
+ INCLUDE common_extratext_data_in_flash_app.ld
+ INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_basic.ld b/ports/stm32/boards/common_basic.ld
index 2e428aa62c..dbda1b8b68 100644
--- a/ports/stm32/boards/common_basic.ld
+++ b/ports/stm32/boards/common_basic.ld
@@ -37,50 +37,6 @@ SECTIONS
_etext = .; /* define a global symbol at end of code */
} >FLASH
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* This is the initialized data section
- The program executes knowing that the data is in the RAM
- but the loader puts the initial values in the FLASH (inidata).
- It is one task of the startup to copy the initial values from FLASH to RAM. */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
- } >RAM AT> FLASH
-
- /* Uninitialized data section */
- .bss :
- {
- . = ALIGN(4);
- _sbss = .; /* define a global symbol at bss start; used by startup code */
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end; used by startup code and GC */
- } >RAM
-
- /* this is to define the start of the heap, and make sure we have a minimum size */
- .heap :
- {
- . = ALIGN(4);
- . = . + _minimum_heap_size;
- . = ALIGN(4);
- } >RAM
-
- /* this just checks there is enough RAM for the stack */
- .stack :
- {
- . = ALIGN(4);
- . = . + _minimum_stack_size;
- . = ALIGN(4);
- } >RAM
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
+ 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 52b2a677d7..21d809a3d2 100644
--- a/ports/stm32/boards/common_bl.ld
+++ b/ports/stm32/boards/common_bl.ld
@@ -37,50 +37,6 @@ SECTIONS
_etext = .; /* define a global symbol at end of code */
} >FLASH_APP
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* This is the initialized data section
- The program executes knowing that the data is in the RAM
- but the loader puts the initial values in the FLASH (inidata).
- It is one task of the startup to copy the initial values from FLASH to RAM. */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
- } >RAM AT> FLASH_APP
-
- /* Uninitialized data section */
- .bss :
- {
- . = ALIGN(4);
- _sbss = .; /* define a global symbol at bss start; used by startup code */
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end; used by startup code and GC */
- } >RAM
-
- /* this is to define the start of the heap, and make sure we have a minimum size */
- .heap :
- {
- . = ALIGN(4);
- . = . + _minimum_heap_size;
- . = ALIGN(4);
- } >RAM
-
- /* this just checks there is enough RAM for the stack */
- .stack :
- {
- . = ALIGN(4);
- . = . + _minimum_stack_size;
- . = ALIGN(4);
- } >RAM
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
+ INCLUDE common_extratext_data_in_flash_app.ld
+ INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_blifs.ld b/ports/stm32/boards/common_blifs.ld
index 65722f2e57..5517a2d09c 100644
--- a/ports/stm32/boards/common_blifs.ld
+++ b/ports/stm32/boards/common_blifs.ld
@@ -37,50 +37,6 @@ SECTIONS
_etext = .; /* define a global symbol at end of code */
} >FLASH_TEXT
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* This is the initialized data section
- The program executes knowing that the data is in the RAM
- but the loader puts the initial values in the FLASH (inidata).
- It is one task of the startup to copy the initial values from FLASH to RAM. */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
- } >RAM AT> FLASH_TEXT
-
- /* Uninitialized data section */
- .bss :
- {
- . = ALIGN(4);
- _sbss = .; /* define a global symbol at bss start; used by startup code */
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end; used by startup code and GC */
- } >RAM
-
- /* this is to define the start of the heap, and make sure we have a minimum size */
- .heap :
- {
- . = ALIGN(4);
- . = . + _minimum_heap_size;
- . = ALIGN(4);
- } >RAM
-
- /* this just checks there is enough RAM for the stack */
- .stack :
- {
- . = ALIGN(4);
- . = . + _minimum_stack_size;
- . = ALIGN(4);
- } >RAM
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
+ INCLUDE common_extratext_data_in_flash_text.ld
+ INCLUDE common_bss_heap_stack.ld
}
diff --git a/ports/stm32/boards/common_bss_heap_stack.ld b/ports/stm32/boards/common_bss_heap_stack.ld
new file mode 100644
index 0000000000..1bb2249e96
--- /dev/null
+++ b/ports/stm32/boards/common_bss_heap_stack.ld
@@ -0,0 +1,28 @@
+/* This linker script fragment is intended to be included in SECTIONS. */
+
+/* Zeroed-out data section */
+.bss :
+{
+ . = ALIGN(4);
+ _sbss = .;
+ *(.bss*)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = .;
+} >RAM
+
+/* This is to define the start of the heap, and make sure there is a minimum size */
+.heap :
+{
+ . = ALIGN(4);
+ . = . + _minimum_heap_size;
+ . = ALIGN(4);
+} >RAM
+
+/* This checks there is enough RAM for the stack */
+.stack :
+{
+ . = ALIGN(4);
+ . = . + _minimum_stack_size;
+ . = ALIGN(4);
+} >RAM
diff --git a/ports/stm32/boards/common_extratext_data_in_flash.ld b/ports/stm32/boards/common_extratext_data_in_flash.ld
new file mode 100644
index 0000000000..e5f25a3c6f
--- /dev/null
+++ b/ports/stm32/boards/common_extratext_data_in_flash.ld
@@ -0,0 +1,14 @@
+/* This linker script fragment is intended to be included in SECTIONS. */
+
+/* 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
diff --git a/ports/stm32/boards/common_extratext_data_in_flash_app.ld b/ports/stm32/boards/common_extratext_data_in_flash_app.ld
new file mode 100644
index 0000000000..8230f8f9b2
--- /dev/null
+++ b/ports/stm32/boards/common_extratext_data_in_flash_app.ld
@@ -0,0 +1,14 @@
+/* This linker script fragment is intended to be included in SECTIONS. */
+
+/* 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
new file mode 100644
index 0000000000..526d2519f7
--- /dev/null
+++ b/ports/stm32/boards/common_extratext_data_in_flash_text.ld
@@ -0,0 +1,14 @@
+/* This linker script fragment is intended to be included in SECTIONS. */
+
+/* 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 74b2ffb419..733ca12f67 100644
--- a/ports/stm32/boards/common_ifs.ld
+++ b/ports/stm32/boards/common_ifs.ld
@@ -54,50 +54,6 @@ SECTIONS
_etext = .; /* define a global symbol at end of code */
} >FLASH_TEXT
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* This is the initialized data section
- The program executes knowing that the data is in the RAM
- but the loader puts the initial values in the FLASH (inidata).
- It is one task of the startup to copy the initial values from FLASH to RAM. */
- .data :
- {
- . = ALIGN(4);
- _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
- *(.data*) /* .data* sections */
-
- . = ALIGN(4);
- _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
- } >RAM AT> FLASH_TEXT
-
- /* Uninitialized data section */
- .bss :
- {
- . = ALIGN(4);
- _sbss = .; /* define a global symbol at bss start; used by startup code */
- *(.bss*)
- *(COMMON)
-
- . = ALIGN(4);
- _ebss = .; /* define a global symbol at bss end; used by startup code and GC */
- } >RAM
-
- /* this is to define the start of the heap, and make sure we have a minimum size */
- .heap :
- {
- . = ALIGN(4);
- . = . + _minimum_heap_size;
- . = ALIGN(4);
- } >RAM
-
- /* this just checks there is enough RAM for the stack */
- .stack :
- {
- . = ALIGN(4);
- . = . + _minimum_stack_size;
- . = ALIGN(4);
- } >RAM
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
+ INCLUDE common_extratext_data_in_flash_text.ld
+ INCLUDE common_bss_heap_stack.ld
}