Skip to content

Commit faa50df

Browse files
authored
Merge pull request #2817 from jepler/stm-linker-scripts
Standardize on FLASH_FIRMWARE section name in linker scripts
2 parents 2b1d3c2 + 7f0f0b3 commit faa50df

19 files changed

+132
-133
lines changed

ports/litex/boards/fomu/fomu-spi.ld

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ ENTRY(_start)
77
/* Specify the memory areas */
88
MEMORY
99
{
10-
FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */
11-
RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */
10+
FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */
11+
FLASH_FIRMWARE (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */
12+
RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */
1213
}
1314

1415
/* top end of the stack */
@@ -19,7 +20,7 @@ SECTIONS
1920
{
2021
/* This is the initialized data section
2122
The program executes knowing that the data is in the RAM
22-
but the loader puts the initial values in the FLASH (inidata).
23+
but the loader puts the initial values in the FLASH_FIRMWARE (inidata).
2324
It is one task of the startup to copy the initial values from FLASH to RAM. */
2425
.data : AT ( _sidata )
2526
{
@@ -73,7 +74,7 @@ SECTIONS
7374
_edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
7475
} >RAM
7576

76-
/* The program code and other data goes into FLASH */
77+
/* The program code and other data goes into FLASH_FIRMWARE */
7778
.text :
7879
{
7980
. = ALIGN(4);
@@ -88,7 +89,7 @@ SECTIONS
8889
. = ALIGN(4);
8990
_etext = .; /* define a global symbol at end of code */
9091
_sidata = _etext; /* This is used by the startup in order to initialize the .data secion */
91-
} >FLASH
92+
} >FLASH_FIRMWARE
9293

9394
/* Uninitialized data section */
9495
.bss :

ports/mimxrt10xx/linking/common.ld

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ MEMORY
2121
/* This can't move because the bootrom looks at this address. */
2222
FLASH_IVT (rx) : ORIGIN = 0x60001000, LENGTH = 4K
2323
/* Place the ISRs 48k in to leave room for the bootloader when it is available. */
24-
FLASH_TEXT (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K
24+
FLASH_FIRMWARE (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K
2525
FLASH_FATFS (r) : ORIGIN = 0x60100000, LENGTH = _ld_flash_size - code_size - _ld_reserved_flash_size
2626
/* Teensy uses the last bit of flash for recovery. */
2727
RESERVED_FLASH : ORIGIN = 0x60100000 + _ld_flash_size - _ld_reserved_flash_size, LENGTH = _ld_reserved_flash_size
@@ -67,15 +67,15 @@ SECTIONS
6767
) .text*) /* .text* sections (code) */
6868
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
6969
. = ALIGN(4);
70-
} > FLASH_TEXT
70+
} > FLASH_FIRMWARE
7171

7272
.ARM.exidx :
7373
{
7474
*(.ARM.exidx*)
7575
*(.gnu.linkonce.armexidx.*)
7676
_etext = .; /* define a global symbol at end of code */
7777
__etext = .; /* define a global symbol at end of code */
78-
} > FLASH_TEXT
78+
} > FLASH_FIRMWARE
7979

8080
_ld_filesystem_start = ORIGIN(FLASH_FATFS);
8181
_ld_filesystem_end = _ld_filesystem_start + LENGTH(FLASH_FATFS);
@@ -87,7 +87,7 @@ SECTIONS
8787
*flexspi_nor_flash_ops.o(.text*)
8888
*fsl_flexspi.o(.text*)
8989
. = ALIGN(4);
90-
} > OCRAM AT> FLASH_TEXT
90+
} > OCRAM AT> FLASH_FIRMWARE
9191
_ld_ocram_data_destination = ADDR(.data);
9292
_ld_ocram_data_flash_copy = LOADADDR(.data);
9393
_ld_ocram_data_size = SIZEOF(.data);
@@ -114,7 +114,7 @@ SECTIONS
114114
*(.itcm.*)
115115

116116
. = ALIGN(4);
117-
} > ITCM AT> FLASH_TEXT
117+
} > ITCM AT> FLASH_FIRMWARE
118118
_ld_itcm_destination = ADDR(.itcm);
119119
_ld_itcm_flash_copy = LOADADDR(.itcm);
120120
_ld_itcm_size = SIZEOF(.itcm);
@@ -126,7 +126,7 @@ SECTIONS
126126
*(.dtcm_data.*)
127127

128128
. = ALIGN(4);
129-
} > DTCM AT> FLASH_TEXT
129+
} > DTCM AT> FLASH_FIRMWARE
130130
_ld_dtcm_data_destination = ADDR(.dtcm_data);
131131
_ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data);
132132
_ld_dtcm_data_size = SIZEOF(.dtcm_data);

ports/stm/boards/STM32F401xd_fs.ld

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10-
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11-
FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10+
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
1313
}
1414

1515
/* produce a link error if there is not this amount of RAM for these sections */

ports/stm/boards/STM32F401xe_boot.ld

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */
9-
FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */
10-
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */
11-
RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194
8+
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */
9+
FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */
10+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */
11+
RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194
1212
}
1313

1414
/* produce a link error if there is not this amount of RAM for these sections */

ports/stm/boards/STM32F401xe_fs.ld

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10-
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11-
FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10+
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
1313
}
1414

1515
/* produce a link error if there is not this amount of RAM for these sections */

ports/stm/boards/STM32F405_boot.ld

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */
9-
FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */
10-
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */
11-
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
12-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
8+
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */
9+
FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */
10+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */
11+
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
12+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
1313
}
1414

1515
/* produce a link error if there is not this amount of RAM for these sections */

ports/stm/boards/STM32F405_default.ld

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10-
FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/
11-
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
12-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/
11+
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
12+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
1313
}
1414

1515
/* produce a link error if there is not this amount of RAM for these sections */

ports/stm/boards/STM32F405_fs.ld

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10-
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11-
FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12-
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
13-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10+
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12+
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
13+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
1414
}
1515

1616
/* produce a link error if there is not this amount of RAM for these sections */

ports/stm/boards/STM32F407_fs.ld

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10-
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11-
FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12-
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
13-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10+
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12+
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
13+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
1414
}
1515

1616
/* produce a link error if there is not this amount of RAM for these sections */

ports/stm/boards/STM32F411_fs.ld

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10-
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11-
FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10+
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */
12+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
1313
}
1414

1515
/* produce a link error if there is not this amount of RAM for these sections */

0 commit comments

Comments
 (0)