2 *****************************************************************************
4 ** File : stm32_flash_h7a3_2m.ld
6 ** Abstract : Linker script for STM32H743xI Device with
9 ** Flash sector (erase unit) is 8KB
11 *****************************************************************************
18 0x00000000 to 0x0000FFFF 64K ITCM
19 0x20000000 to 0x2001FFFF 128K DTCM
20 0x24000000 to 0x2403FFFF 256K AXI SRAM1, CD domain, main RAM
21 0x24040000 to 0x2409FFFF 384K AXI SRAM2, CD domain, main RAM
22 0x240A0000 to 0x240FFFFF 384K AXI SRAM3, CD domain, main RAM
23 0x30000000 to 0x3000FFFF 64K AHB_SRAM1, CD domain, unused
24 0x30010000 to 0x3001FFFF 64K AHB_SRAM2, CD domain, unused
25 0x38000000 to 0x3800FFFF 32K SRD_SRAM, SRD domain, unused
26 0x38800000 to 0x38800FFF 4K BKP_SRAM, Backup domain, unused
28 0x08000000 to 0x081FFFFF 2048K full flash,
29 0x08000000 to 0x0801FFFF 128K isr vector, startup code,
30 0x08020000 to 0x0803FFFF 128K config, // FLASH_Sector_1
31 0x08040000 to 0x081FFFFF 1792K firmware,
34 /* Specify the memory areas */
37 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* 2 sectors */
38 FLASH_CONFIG (r) : ORIGIN = 0x08020000, LENGTH = 16K /* 2 sectors */
39 FLASH1 (rx) : ORIGIN = 0x08040000, LENGTH = 2016K
41 ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
42 DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
43 RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 1024K
45 D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* AHB_SRAM1 + AHB_SRAM2 */
47 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
50 REGION_ALIAS("STACKRAM", DTCM_RAM)
51 REGION_ALIAS("FASTRAM", DTCM_RAM)
56 /* Highest address of the user mode stack */
57 _estack = ORIGIN(STACKRAM) + LENGTH(STACKRAM) - 8; /* Reserve 2 x 4bytes for info across reset */
59 /* Base address where the config is stored. */
60 __config_start = ORIGIN(FLASH_CONFIG);
61 __config_end = ORIGIN(FLASH_CONFIG) + LENGTH(FLASH_CONFIG);
63 /* Generate a link error if heap and stack don't fit into RAM */
64 _Min_Heap_Size = 0; /* required amount of heap */
65 _Min_Stack_Size = 0x800; /* required amount of stack */
67 /* Define output sections */
70 /* The startup code goes first into FLASH */
74 PROVIDE (isr_vector_table_base = .);
75 KEEP(*(.isr_vector)) /* Startup code */
79 /* The program code and other data goes into FLASH */
83 *(.text) /* .text sections (code) */
84 *(.text*) /* .text* sections (code) */
85 *(.rodata) /* .rodata sections (constants, strings, etc.) */
86 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
87 *(.glue_7) /* glue arm to thumb code */
88 *(.glue_7t) /* glue thumb to arm code */
95 _etext = .; /* define a global symbols at end of code */
98 /* Critical program code goes into ITCM RAM */
99 /* Copy specific fast-executing code to ITCM RAM */
100 tcm_code = LOADADDR(.tcm_code);
109 } >ITCM_RAM AT >FLASH1
113 *(.ARM.extab* .gnu.linkonce.armextab.*)
119 *(.ARM.exidx*) __exidx_end = .;
124 PROVIDE_HIDDEN (__pg_registry_start = .);
125 KEEP (*(.pg_registry))
126 KEEP (*(SORT(.pg_registry.*)))
127 PROVIDE_HIDDEN (__pg_registry_end = .);
132 PROVIDE_HIDDEN (__pg_resetdata_start = .);
133 KEEP (*(.pg_resetdata))
134 PROVIDE_HIDDEN (__pg_resetdata_end = .);
137 /* used by the startup to initialize data */
138 _sidata = LOADADDR(.data);
140 /* Initialized data sections goes into RAM, load LMA copy after code */
144 _sdata = .; /* create a global symbol at data start */
145 *(.data) /* .data sections */
146 *(.data*) /* .data* sections */
149 _edata = .; /* define a global symbol at data end */
152 /* Uninitialized data section */
156 /* This is used by the startup in order to initialize the .bss secion */
157 _sbss = .; /* define a global symbol at bss start */
158 __bss_start__ = _sbss;
160 *(SORT_BY_ALIGNMENT(.bss*))
164 _ebss = .; /* define a global symbol at bss end */
168 /* Uninitialized data section */
172 /* This is used by the startup in order to initialize the .sram2 secion */
173 _ssram2 = .; /* define a global symbol at sram2 start */
174 __sram2_start__ = _ssram2;
176 *(SORT_BY_ALIGNMENT(.sram2*))
179 _esram2 = .; /* define a global symbol at sram2 end */
180 __sram2_end__ = _esram2;
183 /* used during startup to initialized fastram_data */
184 _sfastram_idata = LOADADDR(.fastram_data);
186 /* Initialized FAST_RAM section for unsuspecting developers */
190 _sfastram_data = .; /* create a global symbol at data start */
191 *(.fastram_data) /* .data sections */
192 *(.fastram_data*) /* .data* sections */
195 _efastram_data = .; /* define a global symbol at data end */
199 .fastram_bss (NOLOAD) :
202 __fastram_bss_start__ = _sfastram_bss;
204 *(SORT_BY_ALIGNMENT(.fastram_bss*))
208 __fastram_bss_end__ = _efastram_bss;
211 /* used during startup to initialized dmaram_data */
212 _sdmaram_idata = LOADADDR(.dmaram_data);
217 PROVIDE(dmaram_start = .);
219 _dmaram_start__ = _sdmaram;
220 _sdmaram_data = .; /* create a global symbol at data start */
221 *(.dmaram_data) /* .data sections */
222 *(.dmaram_data*) /* .data* sections */
224 _edmaram_data = .; /* define a global symbol at data end */
228 .dmaram_bss (NOLOAD) :
231 __dmaram_bss_start__ = _sdmaram_bss;
233 *(SORT_BY_ALIGNMENT(.dmaram_bss*))
236 __dmaram_bss_end__ = _edmaram_bss;
243 PROVIDE(dmaram_end = .);
245 _dmaram_end__ = _edmaram;
248 .DMA_RW_D2 (NOLOAD) :
251 PROVIDE(dmarw_start = .);
253 _dmarw_start__ = _sdmarw;
255 PROVIDE(dmarw_end = .);
257 _dmarw_end__ = _edmarw;
260 .DMA_RW_AXI (NOLOAD) :
263 PROVIDE(dmarwaxi_start = .);
265 _dmarwaxi_start__ = _sdmarwaxi;
267 PROVIDE(dmarwaxi_end = .);
269 _dmarwaxi_end__ = _edmarwaxi;
272 .persistent_data (NOLOAD) :
274 __persistent_data_start__ = .;
277 __persistent_data_end__ = .;
281 /* User_heap_stack section, used to check that there is enough RAM left */
282 _heap_stack_end = ORIGIN(STACKRAM)+LENGTH(STACKRAM) - 8; /* 8 bytes to allow for alignment */
283 _heap_stack_begin = _heap_stack_end - _Min_Stack_Size - _Min_Heap_Size;
284 . = _heap_stack_begin;
289 PROVIDE ( _end = . );
290 . = . + _Min_Heap_Size;
291 . = . + _Min_Stack_Size;
295 /* MEMORY_bank1 section, code must be located here explicitly */
296 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
299 *(.mb1text) /* .mb1text sections (code) */
300 *(.mb1text*) /* .mb1text* sections (code) */
301 *(.mb1rodata) /* read-only data (constants) */
305 /* Remove information from the standard libraries */
313 .ARM.attributes 0 : { *(.ARM.attributes) }