2 *****************************************************************************
4 ** File : stm32_flash_h750_exst.ld
6 ** Abstract : Linker script for STM32H750xB 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, main RAM
24 0x24000000 to 0x2404FFFF 320K AXI SRAM, D1 domain
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 0x0801FFFF 128K isr vector, startup code, firmware, no config! // FLASH_Sector_0
35 For H7 EXFL (External Flash) targets a binary is built that is placed on an external device.
36 The bootloader will enable the memory mapped mode on the CPU which allows code to run directly from
37 the external flash device.
39 The bootloader then executes code at the CODE_RAM address. The address of CODE_RAM is fixed to 0x90010000
40 and must not be changed.
42 The initial CODE_RAM is sized at 1MB.
46 /* see .exst section below */
51 A section for custom defaults needs to exist for unified targets, however it is a hideous waste of precious RAM.
52 Using RAM will suffice until an alternative location for it can be made workable.
54 It would be much better to store the custom defaults on some spare flash pages on the external flash and have some
55 code to read them from external flash instead of a copy of them stored in precious RAM.
56 There are usually spare flash pages after the config page on the external flash, however current EXST bootloaders are
57 not 'custom defaults' aware. they only know about firmware partitions and config partitions. Using the spare sectors
58 in the config partition for custom defaults would work, but if users use the bootloader menus to erase their config
59 then the custom defaults would also be erased...
60 Also, it would need a change the packaging a distribution method of BF as there would be 2 non-contiguous files to
61 flash if they were separated, i.e. load firmware at flash address 'x' and load custom defaults at flash address 'y'.
65 _custom_defaults_size = 8K;
67 /* Specify the memory areas */
70 ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
71 DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
72 RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 128K + 192K /* 128K AXI SRAM + 192K ITCM & AXI = 320K */
74 D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 32K /* SRAM1 16K + SRAM2 16K */
75 D3_RAM (rwx) : ORIGIN = 0x38000000, LENGTH = 16K /* SRAM4 16K */
77 BACKUP_SRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K
79 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
81 OCTOSPI2 (rx) : ORIGIN = 0x70000000, LENGTH = 256M
82 OCTOSPI1 (rx) : ORIGIN = 0x90000000, LENGTH = 256M
83 OCTOSPI1_CODE (rx): ORIGIN = ORIGIN(OCTOSPI1) + 1M, LENGTH = 1M - _custom_defaults_size - _exst_hash_size /* hard coded start address, as required by SPRACINGH7 boot loader, don't change! */
84 CUSTOM_DEFAULTS (r) : ORIGIN = ORIGIN(OCTOSPI1_CODE) + LENGTH(OCTOSPI1_CODE), LENGTH = _custom_defaults_size
85 EXST_HASH (rx) : ORIGIN = ORIGIN(OCTOSPI1_CODE) + LENGTH(CUSTOM_DEFAULTS) + LENGTH(OCTOSPI1_CODE), LENGTH = _exst_hash_size
88 REGION_ALIAS("STACKRAM", DTCM_RAM)
89 REGION_ALIAS("FASTRAM", DTCM_RAM)
90 REGION_ALIAS("MAIN", OCTOSPI1_CODE)
92 REGION_ALIAS("VECTAB", MAIN)
94 INCLUDE "stm32_h730_common.ld"
98 /* used during startup to initialized dmaram_data */
99 _sdmaram_idata = LOADADDR(.dmaram_data);
104 PROVIDE(dmaram_start = .);
106 _dmaram_start__ = _sdmaram;
107 _sdmaram_data = .; /* create a global symbol at data start */
108 *(.dmaram_data) /* .data sections */
109 *(.dmaram_data*) /* .data* sections */
111 _edmaram_data = .; /* define a global symbol at data end */
115 .dmaram_bss (NOLOAD) :
118 __dmaram_bss_start__ = _sdmaram_bss;
120 *(SORT_BY_ALIGNMENT(.dmaram_bss*))
123 __dmaram_bss_end__ = _edmaram_bss;
130 PROVIDE(dmaram_end = .);
132 _dmaram_end__ = _edmaram;
135 .DMA_RW_D2 (NOLOAD) :
138 PROVIDE(dmarw_start = .);
140 _dmarw_start__ = _sdmarw;
142 PROVIDE(dmarw_end = .);
144 _dmarw_end__ = _edmarw;
147 .DMA_RW_AXI (NOLOAD) :
150 PROVIDE(dmarwaxi_start = .);
152 _dmarwaxi_start__ = _sdmarwaxi;
154 PROVIDE(dmarwaxi_end = .);
156 _dmarwaxi_end__ = _edmarwaxi;
160 INCLUDE "stm32_h730_common_post.ld"
161 INCLUDE "stm32_ram_h730_exst_post.ld"