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 XXX TODO join isr vector, startup and firmware to save some space
31 0x08000000 to 0x080FFFFF 1024K full flash,
32 0x08000000 to 0x0801FFFF 128K isr vector, startup code
33 0x08020000 to 0x080DFFFF 768K firmware
34 0x080E0000 to 0x080FFFFF 128K config
38 /* Specify the memory areas */
41 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
42 FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K
43 FLASH1 (rx) : ORIGIN = 0x08020000, LENGTH = 768K
45 ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
46 DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
47 RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 320K
49 D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 32K /* SRAM1 + SRAM2 */
51 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
54 REGION_ALIAS("STACKRAM", DTCM_RAM)
55 REGION_ALIAS("FASTRAM", DTCM_RAM)
57 /* INCLUDE "stm32_flash_f7_split.ld" */
59 *****************************************************************************
61 ** File : stm32_flash_f7_split.ld
63 ** Abstract : Common linker script for STM32 devices.
65 *****************************************************************************
71 /* Highest address of the user mode stack */
72 _estack = ORIGIN(STACKRAM) + LENGTH(STACKRAM) - 8; /* Reserve 2 x 4bytes for info across reset */
74 /* Base address where the config is stored. */
75 __config_start = ORIGIN(FLASH_CONFIG);
76 __config_end = ORIGIN(FLASH_CONFIG) + LENGTH(FLASH_CONFIG);
78 /* Generate a link error if heap and stack don't fit into RAM */
79 _Min_Heap_Size = 0; /* required amount of heap */
80 _Min_Stack_Size = 0x800; /* required amount of stack */
82 /* Define output sections */
85 /* The startup code goes first into FLASH */
89 PROVIDE (isr_vector_table_base = .);
90 KEEP(*(.isr_vector)) /* Startup code */
94 /* The program code and other data goes into FLASH */
98 *(.text) /* .text sections (code) */
99 *(.text*) /* .text* sections (code) */
100 *(.rodata) /* .rodata sections (constants, strings, etc.) */
101 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
102 *(.glue_7) /* glue arm to thumb code */
103 *(.glue_7t) /* glue thumb to arm code */
110 _etext = .; /* define a global symbols at end of code */
113 /* Critical program code goes into ITCM RAM */
114 /* Copy specific fast-executing code to ITCM RAM */
115 tcm_code = LOADADDR(.tcm_code);
124 } >ITCM_RAM AT >FLASH1
128 *(.ARM.extab* .gnu.linkonce.armextab.*)
134 *(.ARM.exidx*) __exidx_end = .;
139 PROVIDE_HIDDEN (__pg_registry_start = .);
140 KEEP (*(.pg_registry))
141 KEEP (*(SORT(.pg_registry.*)))
142 PROVIDE_HIDDEN (__pg_registry_end = .);
147 PROVIDE_HIDDEN (__pg_resetdata_start = .);
148 KEEP (*(.pg_resetdata))
149 PROVIDE_HIDDEN (__pg_resetdata_end = .);
152 /* used by the startup to initialize data */
153 _sidata = LOADADDR(.data);
155 /* Initialized data sections goes into RAM, load LMA copy after code */
159 _sdata = .; /* create a global symbol at data start */
160 *(.data) /* .data sections */
161 *(.data*) /* .data* sections */
164 _edata = .; /* define a global symbol at data end */
167 /* Uninitialized data section */
171 /* This is used by the startup in order to initialize the .bss secion */
172 _sbss = .; /* define a global symbol at bss start */
173 __bss_start__ = _sbss;
175 *(SORT_BY_ALIGNMENT(.bss*))
179 _ebss = .; /* define a global symbol at bss end */
183 /* Uninitialized data section */
187 /* This is used by the startup in order to initialize the .sram2 secion */
188 _ssram2 = .; /* define a global symbol at sram2 start */
189 __sram2_start__ = _ssram2;
191 *(SORT_BY_ALIGNMENT(.sram2*))
194 _esram2 = .; /* define a global symbol at sram2 end */
195 __sram2_end__ = _esram2;
198 /* used during startup to initialized fastram_data */
199 _sfastram_idata = LOADADDR(.fastram_data);
201 /* Initialized FAST_DATA section for unsuspecting developers */
205 _sfastram_data = .; /* create a global symbol at data start */
206 *(.fastram_data) /* .data sections */
207 *(.fastram_data*) /* .data* sections */
210 _efastram_data = .; /* define a global symbol at data end */
214 .fastram_bss (NOLOAD) :
217 __fastram_bss_start__ = _sfastram_bss;
219 *(SORT_BY_ALIGNMENT(.fastram_bss*))
223 __fastram_bss_end__ = _efastram_bss;
226 /* used during startup to initialized dmaram_data */
227 _sdmaram_idata = LOADADDR(.dmaram_data);
232 PROVIDE(dmaram_start = .);
234 _dmaram_start__ = _sdmaram;
235 _sdmaram_data = .; /* create a global symbol at data start */
236 *(.dmaram_data) /* .data sections */
237 *(.dmaram_data*) /* .data* sections */
239 _edmaram_data = .; /* define a global symbol at data end */
243 .dmaram_bss (NOLOAD) :
246 __dmaram_bss_start__ = _sdmaram_bss;
248 *(SORT_BY_ALIGNMENT(.dmaram_bss*))
251 __dmaram_bss_end__ = _edmaram_bss;
258 PROVIDE(dmaram_end = .);
260 _dmaram_end__ = _edmaram;
263 .DMA_RW_D2 (NOLOAD) :
266 PROVIDE(dmarw_start = .);
268 _dmarw_start__ = _sdmarw;
270 PROVIDE(dmarw_end = .);
272 _dmarw_end__ = _edmarw;
275 .DMA_RW_AXI (NOLOAD) :
278 PROVIDE(dmarwaxi_start = .);
280 _dmarwaxi_start__ = _sdmarwaxi;
282 PROVIDE(dmarwaxi_end = .);
284 _dmarwaxi_end__ = _edmarwaxi;
287 .persistent_data (NOLOAD) :
289 __persistent_data_start__ = .;
292 __persistent_data_end__ = .;
296 /* User_heap_stack section, used to check that there is enough RAM left */
297 _heap_stack_end = ORIGIN(STACKRAM)+LENGTH(STACKRAM) - 8; /* 8 bytes to allow for alignment */
298 _heap_stack_begin = _heap_stack_end - _Min_Stack_Size - _Min_Heap_Size;
299 . = _heap_stack_begin;
304 PROVIDE ( _end = . );
305 . = . + _Min_Heap_Size;
306 . = . + _Min_Stack_Size;
310 /* MEMORY_bank1 section, code must be located here explicitly */
311 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
314 *(.mb1text) /* .mb1text sections (code) */
315 *(.mb1text*) /* .mb1text* sections (code) */
316 *(.mb1rodata) /* read-only data (constants) */
320 /* Remove information from the standard libraries */
328 .ARM.attributes 0 : { *(.ARM.attributes) }