Revert "Fix missing CUSTOM_DEFAULTS for H730/H750 targets. (#12261)" (#12333)
[betaflight.git] / src / link / stm32_ram_h730_exst.ld
blob46669d27fa012dba5532ad4587547dac8094e15f
1 /*
2 *****************************************************************************
3 **
4 **  File        : stm32_flash_h750_exst.ld
5 **
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
12 **                 64K ITCM
13 **                128K DTCM
15 *****************************************************************************
18 /* Entry Point */
19 ENTRY(Reset_Handler)
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
33 /* 
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 */
47 _exst_hash_size = 64;
49 /* Specify the memory areas */
50 MEMORY
52     ITCM_RAM (rwx)    : ORIGIN = 0x00000000, LENGTH = 64K
53     DTCM_RAM (rwx)    : ORIGIN = 0x20000000, LENGTH = 128K
54     RAM (rwx)         : ORIGIN = 0x24000000, LENGTH = 128K + 192K /* 128K AXI SRAM + 192K ITCM & AXI = 320K */
56     D2_RAM (rwx)      : ORIGIN = 0x30000000, LENGTH = 32K /* SRAM1 16K + SRAM2 16K */
57     D3_RAM (rwx)      : ORIGIN = 0x38000000, LENGTH = 16K /* SRAM4 16K */
59     BACKUP_SRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K
61     MEMORY_B1 (rx)    : ORIGIN = 0x60000000, LENGTH = 0K
63     OCTOSPI2 (rx)     : ORIGIN = 0x70000000, LENGTH = 256M
64     OCTOSPI1 (rx)     : ORIGIN = 0x90000000, LENGTH = 256M 
65     OCTOSPI1_CODE (rx): ORIGIN = ORIGIN(OCTOSPI1) + 1M, LENGTH = 1M - _exst_hash_size /* hard coded start address, as required by SPRACINGH7 boot loader, don't change! */
66     EXST_HASH (rx)    : ORIGIN = ORIGIN(OCTOSPI1_CODE) + LENGTH(OCTOSPI1_CODE), LENGTH = _exst_hash_size
69 REGION_ALIAS("STACKRAM", DTCM_RAM)
70 REGION_ALIAS("FASTRAM", DTCM_RAM)
71 REGION_ALIAS("MAIN", OCTOSPI1_CODE)
73 REGION_ALIAS("VECTAB", MAIN)
75 INCLUDE "stm32_h730_common.ld"
77 SECTIONS
79   /* used during startup to initialized dmaram_data */
80   _sdmaram_idata = LOADADDR(.dmaram_data);
82   . = ALIGN(32);
83   .dmaram_data :
84   {
85     PROVIDE(dmaram_start = .);
86     _sdmaram = .;
87     _dmaram_start__ = _sdmaram;
88     _sdmaram_data = .;        /* create a global symbol at data start */
89     *(.dmaram_data)           /* .data sections */
90     *(.dmaram_data*)          /* .data* sections */
91     . = ALIGN(32);
92     _edmaram_data = .;        /* define a global symbol at data end */
93   } >RAM AT >MAIN
95   . = ALIGN(32);
96   .dmaram_bss (NOLOAD) :
97   {
98     _sdmaram_bss = .;
99     __dmaram_bss_start__ = _sdmaram_bss;
100     *(.dmaram_bss)
101     *(SORT_BY_ALIGNMENT(.dmaram_bss*))
102     . = ALIGN(32);
103     _edmaram_bss = .;
104     __dmaram_bss_end__ = _edmaram_bss;
105   } >RAM
107   . = ALIGN(32);
108   .DMA_RAM (NOLOAD) :
109   {
110     KEEP(*(.DMA_RAM))
111     PROVIDE(dmaram_end = .);
112     _edmaram = .;
113     _dmaram_end__ = _edmaram;
114   } >RAM
115   
116   .DMA_RW_D2 (NOLOAD) :
117   {
118     . = ALIGN(32);
119     PROVIDE(dmarw_start = .);
120     _sdmarw = .;
121     _dmarw_start__ = _sdmarw;
122     KEEP(*(.DMA_RW))
123     PROVIDE(dmarw_end = .);
124     _edmarw = .;
125     _dmarw_end__ = _edmarw;
126   } >D2_RAM
128   .DMA_RW_AXI (NOLOAD) :
129   {
130     . = ALIGN(32);
131     PROVIDE(dmarwaxi_start = .);
132     _sdmarwaxi = .;
133     _dmarwaxi_start__ = _sdmarwaxi;
134     KEEP(*(.DMA_RW_AXI))
135     PROVIDE(dmarwaxi_end = .);
136     _edmarwaxi = .;
137     _dmarwaxi_end__ = _edmarwaxi;
138   } >RAM
141 INCLUDE "stm32_h730_common_post.ld"
142 INCLUDE "stm32_ram_h730_exst_post.ld"