2 *****************************************************************************
4 ** File : stm32_flash_h7x3_2m.ld
6 ** Abstract : Linker script for STM32H743xI Device with
7 ** 512K AXI-RAM mapped onto AXI bus on D1 domain
8 ** 128K SRAM1 mapped on D2 domain
9 ** 128K SRAM2 mapped on D2 domain
10 ** 32K SRAM3 mapped on D2 domain
11 ** 64K SRAM4 mapped on D3 domain
15 *****************************************************************************
22 0x00000000 to 0x0000FFFF 64K ITCM
23 0x20000000 to 0x2001FFFF 128K DTCM
24 0x24000000 to 0x2407FFFF 512K AXI SRAM, D1 domain, main RAM
25 0x30000000 to 0x3001FFFF 128K SRAM1, D2 domain
26 0x30020000 to 0x3003FFFF 128K SRAM2, D2 domain
27 0x30040000 to 0x30047FFF 32K SRAM3, D2 domain, unused
28 0x38000000 to 0x3800FFFF 64K SRAM4, D3 domain, unused
29 0x38800000 to 0x38800FFF 4K BACKUP SRAM, Backup domain, unused
31 0x08000000 to 0x081FFFFF 2048K full flash,
32 0x08000000 to 0x0801FFFF 128K isr vector, startup code,
33 0x08020000 to 0x0803FFFF 128K config, // FLASH_Sector_1
34 0x08040000 to 0x081FFFFF 1792K firmware,
37 /* Specify the memory areas */
40 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 10K
41 FLASH_CUSTOM_DEFAULTS (r) : ORIGIN = 0x08002800, LENGTH = 118K
42 FLASH_CONFIG (r) : ORIGIN = 0x08020000, LENGTH = 128K
43 FLASH1 (rx) : ORIGIN = 0x08040000, LENGTH = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 1664K : 1792K
44 FLASH_CUSTOM_DEFAULTS_EXTENDED (r): ORIGIN = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 0x081E0000 : 0x08200000, LENGTH = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 128K : 0K
46 ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
47 DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
48 RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K
50 D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 256K /* SRAM1 + SRAM2 */
52 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
55 REGION_ALIAS("STACKRAM", DTCM_RAM)
56 REGION_ALIAS("FASTRAM", DTCM_RAM)
58 /* INCLUDE "stm32_flash_f7_split.ld" */
60 *****************************************************************************
62 ** File : stm32_flash_f7_split.ld
64 ** Abstract : Common linker script for STM32 devices.
66 *****************************************************************************
72 /* Highest address of the user mode stack */
73 _estack = ORIGIN(STACKRAM) + LENGTH(STACKRAM) - 8; /* Reserve 2 x 4bytes for info across reset */
75 /* Base address where the config is stored. */
76 __config_start = ORIGIN(FLASH_CONFIG);
77 __config_end = ORIGIN(FLASH_CONFIG) + LENGTH(FLASH_CONFIG);
79 /* Generate a link error if heap and stack don't fit into RAM */
80 _Min_Heap_Size = 0; /* required amount of heap */
81 _Min_Stack_Size = 0x800; /* required amount of stack */
83 /* Define output sections */
86 /* The startup code goes first into FLASH */
90 PROVIDE (isr_vector_table_base = .);
91 KEEP(*(.isr_vector)) /* Startup code */
95 /* The program code and other data goes into FLASH */
99 *(.text) /* .text sections (code) */
100 *(.text*) /* .text* sections (code) */
101 *(.rodata) /* .rodata sections (constants, strings, etc.) */
102 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
103 *(.glue_7) /* glue arm to thumb code */
104 *(.glue_7t) /* glue thumb to arm code */
111 _etext = .; /* define a global symbols at end of code */
114 /* Critical program code goes into ITCM RAM */
115 /* Copy specific fast-executing code to ITCM RAM */
116 tcm_code = LOADADDR(.tcm_code);
125 } >ITCM_RAM AT >FLASH1
129 *(.ARM.extab* .gnu.linkonce.armextab.*)
135 *(.ARM.exidx*) __exidx_end = .;
140 PROVIDE_HIDDEN (__pg_registry_start = .);
141 KEEP (*(.pg_registry))
142 KEEP (*(SORT(.pg_registry.*)))
143 PROVIDE_HIDDEN (__pg_registry_end = .);
148 PROVIDE_HIDDEN (__pg_resetdata_start = .);
149 KEEP (*(.pg_resetdata))
150 PROVIDE_HIDDEN (__pg_resetdata_end = .);
153 /* Storage for the address for the configuration section so we can grab it out of the hex file */
157 KEEP (*(.custom_defaults_start_address))
159 KEEP (*(.custom_defaults_end_address))
161 __custom_defaults_internal_start = .;
163 } >FLASH_CUSTOM_DEFAULTS
165 PROVIDE_HIDDEN (__custom_defaults_start = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) : __custom_defaults_internal_start);
166 PROVIDE_HIDDEN (__custom_defaults_end = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) + LENGTH(FLASH_CUSTOM_DEFAULTS_EXTENDED) : ORIGIN(FLASH_CUSTOM_DEFAULTS) + LENGTH(FLASH_CUSTOM_DEFAULTS));
168 /* used by the startup to initialize data */
169 _sidata = LOADADDR(.data);
171 /* Initialized data sections goes into RAM, load LMA copy after code */
175 _sdata = .; /* create a global symbol at data start */
176 *(.data) /* .data sections */
177 *(.data*) /* .data* sections */
180 _edata = .; /* define a global symbol at data end */
183 /* Uninitialized data section */
187 /* This is used by the startup in order to initialize the .bss secion */
188 _sbss = .; /* define a global symbol at bss start */
189 __bss_start__ = _sbss;
191 *(SORT_BY_ALIGNMENT(.bss*))
195 _ebss = .; /* define a global symbol at bss end */
199 /* Uninitialized data section */
203 /* This is used by the startup in order to initialize the .sram2 secion */
204 _ssram2 = .; /* define a global symbol at sram2 start */
205 __sram2_start__ = _ssram2;
207 *(SORT_BY_ALIGNMENT(.sram2*))
210 _esram2 = .; /* define a global symbol at sram2 end */
211 __sram2_end__ = _esram2;
214 /* used during startup to initialized fastram_data */
215 _sfastram_idata = LOADADDR(.fastram_data);
217 /* Initialized FAST_DATA section for unsuspecting developers */
221 _sfastram_data = .; /* create a global symbol at data start */
222 *(.fastram_data) /* .data sections */
223 *(.fastram_data*) /* .data* sections */
226 _efastram_data = .; /* define a global symbol at data end */
230 .fastram_bss (NOLOAD) :
233 __fastram_bss_start__ = _sfastram_bss;
235 *(SORT_BY_ALIGNMENT(.fastram_bss*))
239 __fastram_bss_end__ = _efastram_bss;
242 /* used during startup to initialized dmaram_data */
243 _sdmaram_idata = LOADADDR(.dmaram_data);
248 PROVIDE(dmaram_start = .);
250 _dmaram_start__ = _sdmaram;
251 _sdmaram_data = .; /* create a global symbol at data start */
252 *(.dmaram_data) /* .data sections */
253 *(.dmaram_data*) /* .data* sections */
255 _edmaram_data = .; /* define a global symbol at data end */
259 .dmaram_bss (NOLOAD) :
262 __dmaram_bss_start__ = _sdmaram_bss;
264 *(SORT_BY_ALIGNMENT(.dmaram_bss*))
267 __dmaram_bss_end__ = _edmaram_bss;
274 PROVIDE(dmaram_end = .);
276 _dmaram_end__ = _edmaram;
279 .DMA_RW_D2 (NOLOAD) :
282 PROVIDE(dmarw_start = .);
284 _dmarw_start__ = _sdmarw;
286 PROVIDE(dmarw_end = .);
288 _dmarw_end__ = _edmarw;
291 .DMA_RW_AXI (NOLOAD) :
294 PROVIDE(dmarwaxi_start = .);
296 _dmarwaxi_start__ = _sdmarwaxi;
298 PROVIDE(dmarwaxi_end = .);
300 _dmarwaxi_end__ = _edmarwaxi;
303 .persistent_data (NOLOAD) :
305 __persistent_data_start__ = .;
308 __persistent_data_end__ = .;
312 /* User_heap_stack section, used to check that there is enough RAM left */
313 _heap_stack_end = ORIGIN(STACKRAM)+LENGTH(STACKRAM) - 8; /* 8 bytes to allow for alignment */
314 _heap_stack_begin = _heap_stack_end - _Min_Stack_Size - _Min_Heap_Size;
315 . = _heap_stack_begin;
320 PROVIDE ( _end = . );
321 . = . + _Min_Heap_Size;
322 . = . + _Min_Stack_Size;
326 /* MEMORY_bank1 section, code must be located here explicitly */
327 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
330 *(.mb1text) /* .mb1text sections (code) */
331 *(.mb1text*) /* .mb1text* sections (code) */
332 *(.mb1rodata) /* read-only data (constants) */
336 /* Remove information from the standard libraries */
344 .ARM.attributes 0 : { *(.ARM.attributes) }