2 *****************************************************************************
4 ** File : stm32_ram_h743.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 ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
41 DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
42 RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K
44 D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 256K /* SRAM1 + SRAM2 */
46 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
49 REGION_ALIAS("STACKRAM", DTCM_RAM)
50 REGION_ALIAS("FASTRAM", DTCM_RAM)
52 /* INCLUDE "stm32_flash_f7_split.ld" */
54 *****************************************************************************
56 ** File : stm32_flash_f7_split.ld
58 ** Abstract : Common linker script for STM32 devices.
60 *****************************************************************************
66 /* Highest address of the user mode stack */
67 _estack = ORIGIN(STACKRAM) + LENGTH(STACKRAM) - 8; /* Reserve 2 x 4bytes for info across reset */
69 /* Generate a link error if heap and stack don't fit into RAM */
70 _Min_Heap_Size = 0; /* required amount of heap */
71 _Min_Stack_Size = 0x800; /* required amount of stack */
73 /* Define output sections */
76 /* The startup code goes first into FLASH */
80 PROVIDE (isr_vector_table_base = .);
81 KEEP(*(.isr_vector)) /* Startup code */
85 /* The program code and other data goes into FLASH */
89 *(.text) /* .text sections (code) */
90 *(.text*) /* .text* sections (code) */
91 *(.rodata) /* .rodata sections (constants, strings, etc.) */
92 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
93 *(.glue_7) /* glue arm to thumb code */
94 *(.glue_7t) /* glue thumb to arm code */
101 _etext = .; /* define a global symbols at end of code */
104 /* Critical program code goes into ITCM RAM */
105 /* Copy specific fast-executing code to ITCM RAM */
106 tcm_code = LOADADDR(.tcm_code);
119 *(.ARM.extab* .gnu.linkonce.armextab.*)
125 *(.ARM.exidx*) __exidx_end = .;
130 PROVIDE_HIDDEN (__pg_registry_start = .);
131 KEEP (*(.pg_registry))
132 KEEP (*(SORT(.pg_registry.*)))
133 PROVIDE_HIDDEN (__pg_registry_end = .);
138 PROVIDE_HIDDEN (__pg_resetdata_start = .);
139 KEEP (*(.pg_resetdata))
140 PROVIDE_HIDDEN (__pg_resetdata_end = .);
143 /* used by the startup to initialize data */
144 _sidata = LOADADDR(.data);
146 /* Initialized data sections goes into RAM, load LMA copy after code */
150 _sdata = .; /* create a global symbol at data start */
151 *(.data) /* .data sections */
152 *(.data*) /* .data* sections */
155 _edata = .; /* define a global symbol at data end */
158 /* Uninitialized data section */
162 /* This is used by the startup in order to initialize the .bss secion */
163 _sbss = .; /* define a global symbol at bss start */
164 __bss_start__ = _sbss;
166 *(SORT_BY_ALIGNMENT(.bss*))
170 _ebss = .; /* define a global symbol at bss end */
174 /* Uninitialized data section */
178 /* This is used by the startup in order to initialize the .sram2 secion */
179 _ssram2 = .; /* define a global symbol at sram2 start */
180 __sram2_start__ = _ssram2;
182 *(SORT_BY_ALIGNMENT(.sram2*))
185 _esram2 = .; /* define a global symbol at sram2 end */
186 __sram2_end__ = _esram2;
189 /* used during startup to initialized fastram_data */
190 _sfastram_idata = LOADADDR(.fastram_data);
192 /* Initialized FAST_DATA section for unsuspecting developers */
196 _sfastram_data = .; /* create a global symbol at data start */
197 *(.fastram_data) /* .data sections */
198 *(.fastram_data*) /* .data* sections */
201 _efastram_data = .; /* define a global symbol at data end */
205 .fastram_bss (NOLOAD) :
208 __fastram_bss_start__ = _sfastram_bss;
210 *(SORT_BY_ALIGNMENT(.fastram_bss*))
214 __fastram_bss_end__ = _efastram_bss;
217 /* used during startup to initialized dmaram_data */
218 _sdmaram_idata = LOADADDR(.dmaram_data);
223 PROVIDE(dmaram_start = .);
225 _dmaram_start__ = _sdmaram;
226 _sdmaram_data = .; /* create a global symbol at data start */
227 *(.dmaram_data) /* .data sections */
228 *(.dmaram_data*) /* .data* sections */
230 _edmaram_data = .; /* define a global symbol at data end */
234 .dmaram_bss (NOLOAD) :
237 __dmaram_bss_start__ = _sdmaram_bss;
239 *(SORT_BY_ALIGNMENT(.dmaram_bss*))
242 __dmaram_bss_end__ = _edmaram_bss;
249 PROVIDE(dmaram_end = .);
251 _dmaram_end__ = _edmaram;
254 .DMA_RW_D2 (NOLOAD) :
257 PROVIDE(dmarw_start = .);
259 _dmarw_start__ = _sdmarw;
261 PROVIDE(dmarw_end = .);
263 _dmarw_end__ = _edmarw;
266 .DMA_RW_AXI (NOLOAD) :
269 PROVIDE(dmarwaxi_start = .);
271 _dmarwaxi_start__ = _sdmarwaxi;
273 PROVIDE(dmarwaxi_end = .);
275 _dmarwaxi_end__ = _edmarwaxi;
278 .persistent_data (NOLOAD) :
280 __persistent_data_start__ = .;
283 __persistent_data_end__ = .;
287 /* User_heap_stack section, used to check that there is enough RAM left */
288 _heap_stack_end = ORIGIN(STACKRAM)+LENGTH(STACKRAM) - 8; /* 8 bytes to allow for alignment */
289 _heap_stack_begin = _heap_stack_end - _Min_Stack_Size - _Min_Heap_Size;
290 . = _heap_stack_begin;
295 PROVIDE ( _end = . );
296 . = . + _Min_Heap_Size;
297 . = . + _Min_Stack_Size;
301 /* MEMORY_bank1 section, code must be located here explicitly */
302 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
305 *(.mb1text) /* .mb1text sections (code) */
306 *(.mb1text*) /* .mb1text* sections (code) */
307 *(.mb1rodata) /* read-only data (constants) */
311 /* Remove information from the standard libraries */
319 .ARM.attributes 0 : { *(.ARM.attributes) }