2 *****************************************************************************
4 ** File : stm32_flash_h723_1m.ld
6 ** Abstract : Linker script for STM32H723xG and STM32H725xG Device with
7 ** 320K AXI-SRAM mapped onto AXI bus on D1 domain
8 (Shared AXI/I-TCM 192KB is all configured as AXI-SRAM)
9 ** 16K SRAM1 mapped on D2 domain
10 ** 16K SRAM2 mapped on D2 domain
11 ** 16K SRAM mapped on D3 domain
15 *****************************************************************************
22 0x00000000 to 0x0000FFFF 64K ITCM
23 0x20000000 to 0x2001FFFF 128K DTCM
24 0x24000000 to 0x2404FFFF 320K AXI SRAM, D1 domain, main RAM
25 0x30000000 to 0x30003FFF 16K SRAM1, D2 domain
26 0x30004000 to 0x30007FFF 16K SRAM2, D2 domain
27 0x38000000 to 0x38003FFF 16K SRAM4, D3 domain, unused
28 0x38800000 to 0x38800FFF 4K BACKUP SRAM, Backup domain, unused
30 0x08000000 to 0x080FFFFF 1024K full flash
31 0x08000000 to 0x0801FFFF 128K isr vector, startup code
32 0x08020000 to 0x0803FFFF 128K config
33 0x08040000 to 0x080FFFFF 768K firmware
36 /* Specify the memory areas */
39 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 10K
40 FLASH_CUSTOM_DEFAULTS (r) : ORIGIN = 0x08002800, LENGTH = 10K
41 FLASH_UNUSED (r) : ORIGIN = 0x08005000, LENGTH = 108K
43 FLASH_CONFIG (r) : ORIGIN = 0x08020000, LENGTH = 128K
44 FLASH1 (rx) : ORIGIN = 0x08040000, LENGTH = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 640K : 768K
45 FLASH_CUSTOM_DEFAULTS_EXTENDED (r): ORIGIN = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 0x081E0000 : 0x08200000, LENGTH = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 128K : 0K
47 ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
48 DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
49 RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 320K
51 D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 32K /* SRAM1 + SRAM2 */
52 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
55 REGION_ALIAS("STACKRAM", DTCM_RAM)
56 REGION_ALIAS("FASTRAM", DTCM_RAM)
61 /* Highest address of the user mode stack */
62 _estack = ORIGIN(STACKRAM) + LENGTH(STACKRAM) - 8; /* Reserve 2 x 4bytes for info across reset */
64 /* Base address where the config is stored. */
65 __config_start = ORIGIN(FLASH_CONFIG);
66 __config_end = ORIGIN(FLASH_CONFIG) + LENGTH(FLASH_CONFIG);
68 /* Generate a link error if heap and stack don't fit into RAM */
69 _Min_Heap_Size = 0; /* required amount of heap */
70 _Min_Stack_Size = 0x400; /* required amount of stack */
72 /* Define output sections */
75 /* The startup code goes first into FLASH */
79 PROVIDE (isr_vector_table_base = .);
80 KEEP(*(.isr_vector)) /* Startup code */
84 /* The program code and other data goes into FLASH */
88 *(.text) /* .text sections (code) */
89 *(.text*) /* .text* sections (code) */
90 *(.rodata) /* .rodata sections (constants, strings, etc.) */
91 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
92 *(.glue_7) /* glue arm to thumb code */
93 *(.glue_7t) /* glue thumb to arm code */
100 _etext = .; /* define a global symbols at end of code */
103 /* Critical program code goes into ITCM RAM */
104 /* Copy specific fast-executing code to ITCM RAM */
105 tcm_code = LOADADDR(.tcm_code);
114 } >ITCM_RAM AT >FLASH1
118 *(.ARM.extab* .gnu.linkonce.armextab.*)
124 *(.ARM.exidx*) __exidx_end = .;
129 PROVIDE_HIDDEN (__pg_registry_start = .);
130 KEEP (*(.pg_registry))
131 KEEP (*(SORT(.pg_registry.*)))
132 PROVIDE_HIDDEN (__pg_registry_end = .);
137 PROVIDE_HIDDEN (__pg_resetdata_start = .);
138 KEEP (*(.pg_resetdata))
139 PROVIDE_HIDDEN (__pg_resetdata_end = .);
142 /* Storage for the address for the configuration section so we can grab it out of the hex file */
146 KEEP (*(.custom_defaults_start_address))
148 KEEP (*(.custom_defaults_end_address))
150 __custom_defaults_internal_start = .;
152 } >FLASH_CUSTOM_DEFAULTS
154 PROVIDE_HIDDEN (__custom_defaults_start = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) : __custom_defaults_internal_start);
155 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));
157 /* used by the startup to initialize data */
158 _sidata = LOADADDR(.data);
160 /* Initialized data sections goes into RAM, load LMA copy after code */
164 _sdata = .; /* create a global symbol at data start */
165 *(.data) /* .data sections */
166 *(.data*) /* .data* sections */
169 _edata = .; /* define a global symbol at data end */
172 /* Uninitialized data section */
176 /* This is used by the startup in order to initialize the .bss secion */
177 _sbss = .; /* define a global symbol at bss start */
178 __bss_start__ = _sbss;
180 *(SORT_BY_ALIGNMENT(.bss*))
184 _ebss = .; /* define a global symbol at bss end */
188 /* Uninitialized data section */
192 /* This is used by the startup in order to initialize the .sram2 secion */
193 _ssram2 = .; /* define a global symbol at sram2 start */
194 __sram2_start__ = _ssram2;
196 *(SORT_BY_ALIGNMENT(.sram2*))
199 _esram2 = .; /* define a global symbol at sram2 end */
200 __sram2_end__ = _esram2;
203 /* used during startup to initialized fastram_data */
204 _sfastram_idata = LOADADDR(.fastram_data);
206 /* Initialized FAST_DATA section for unsuspecting developers */
210 _sfastram_data = .; /* create a global symbol at data start */
211 *(.fastram_data) /* .data sections */
212 *(.fastram_data*) /* .data* sections */
215 _efastram_data = .; /* define a global symbol at data end */
216 } >FASTRAM AT >FLASH1
219 .fastram_bss (NOLOAD) :
222 __fastram_bss_start__ = _sfastram_bss;
224 *(SORT_BY_ALIGNMENT(.fastram_bss*))
228 __fastram_bss_end__ = _efastram_bss;
231 /* used during startup to initialized dmaram_data */
232 _sdmaram_idata = LOADADDR(.dmaram_data);
237 PROVIDE(dmaram_start = .);
239 _dmaram_start__ = _sdmaram;
240 _sdmaram_data = .; /* create a global symbol at data start */
241 *(.dmaram_data) /* .data sections */
242 *(.dmaram_data*) /* .data* sections */
244 _edmaram_data = .; /* define a global symbol at data end */
248 .dmaram_bss (NOLOAD) :
251 __dmaram_bss_start__ = _sdmaram_bss;
253 *(SORT_BY_ALIGNMENT(.dmaram_bss*))
256 __dmaram_bss_end__ = _edmaram_bss;
263 PROVIDE(dmaram_end = .);
265 _dmaram_end__ = _edmaram;
268 .DMA_RW_D2 (NOLOAD) :
271 PROVIDE(dmarw_start = .);
273 _dmarw_start__ = _sdmarw;
275 PROVIDE(dmarw_end = .);
277 _dmarw_end__ = _edmarw;
280 .DMA_RW_AXI (NOLOAD) :
283 PROVIDE(dmarwaxi_start = .);
285 _dmarwaxi_start__ = _sdmarwaxi;
287 PROVIDE(dmarwaxi_end = .);
289 _dmarwaxi_end__ = _edmarwaxi;
292 .persistent_data (NOLOAD) :
294 __persistent_data_start__ = .;
297 __persistent_data_end__ = .;
301 /* User_heap_stack section, used to check that there is enough RAM left */
302 _heap_stack_end = ORIGIN(STACKRAM)+LENGTH(STACKRAM) - 8; /* 8 bytes to allow for alignment */
303 _heap_stack_begin = _heap_stack_end - _Min_Stack_Size - _Min_Heap_Size;
304 . = _heap_stack_begin;
309 PROVIDE ( _end = . );
310 . = . + _Min_Heap_Size;
311 . = . + _Min_Stack_Size;
315 /* MEMORY_bank1 section, code must be located here explicitly */
316 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
319 *(.mb1text) /* .mb1text sections (code) */
320 *(.mb1text*) /* .mb1text* sections (code) */
321 *(.mb1rodata) /* read-only data (constants) */
325 /* Remove information from the standard libraries */
333 .ARM.attributes 0 : { *(.ARM.attributes) }