Revert "Fix missing CUSTOM_DEFAULTS for H730/H750 targets. (#12261)" (#12333)
[betaflight.git] / src / link / stm32_h750_common.ld
blobb69eb91b3f7c45ba687d2b77ec45c1ee3dccd869
2 /* Entry Point */
3 ENTRY(Reset_Handler)
5 /* Highest address of the user mode stack */
6 _estack = ORIGIN(STACKRAM) + LENGTH(STACKRAM);    /* end of RAM */
8 /* Base address where the quad spi. */
9 __quad_spi_start = ORIGIN(QUADSPI);
11 /* Generate a link error if heap and stack don't fit into RAM */
12 _Min_Heap_Size = 0;      /* required amount of heap  */
13 _Min_Stack_Size = 0x800; /* required amount of stack */
15 /* Define output sections */
16 SECTIONS
18   /* The vector table goes first into MAIN */
19   .isr_vector :
20   {
21     . = ALIGN(512);
22     PROVIDE (isr_vector_table_base = .);
23     KEEP(*(.isr_vector)) /* Startup code */
24     . = ALIGN(4);
25   } >MAIN
27   /* The program code and other data goes into MAIN */
28   .text :
29   {
30     . = ALIGN(4);
31     *(.text)           /* .text sections (code) */
32     *(.text*)          /* .text* sections (code) */
33     *(.rodata)         /* .rodata sections (constants, strings, etc.) */
34     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
35     *(.glue_7)         /* glue arm to thumb code */
36     *(.glue_7t)        /* glue thumb to arm code */
37     *(.eh_frame)
39     KEEP (*(.init))
40     KEEP (*(.fini))
42     . = ALIGN(4);
43     _etext = .;        /* define a global symbols at end of code */
44   } >MAIN
46   /* Critical program code goes into ITCM RAM */
47   /* Copy specific fast-executing code to ITCM RAM */ 
48   tcm_code = LOADADDR(.tcm_code); 
49   .tcm_code :
50   {
51     . = ALIGN(4);
52     tcm_code_start = .; 
53     *(.tcm_code)
54     *(.tcm_code*)
55     . = ALIGN(4);
56     tcm_code_end = .; 
57   } >ITCM_RAM AT >MAIN
59   .ARM.extab   : 
60   { 
61     *(.ARM.extab* .gnu.linkonce.armextab.*) 
62   } >MAIN
63   
64   .ARM : 
65   {
66     __exidx_start = .;
67     *(.ARM.exidx*) __exidx_end = .;
68   } >MAIN
70   .pg_registry :
71   {
72     PROVIDE_HIDDEN (__pg_registry_start = .);
73     KEEP (*(.pg_registry))
74     KEEP (*(SORT(.pg_registry.*)))
75     PROVIDE_HIDDEN (__pg_registry_end = .);
76   } >MAIN
77   
78   .pg_resetdata :
79   {
80     PROVIDE_HIDDEN (__pg_resetdata_start = .);
81     KEEP (*(.pg_resetdata))
82     PROVIDE_HIDDEN (__pg_resetdata_end = .);
83   } >MAIN
85   /* used by the startup to initialize data */
86   _sidata = LOADADDR(.data);
88   /* Initialized data sections goes into RAM, load LMA copy after code */
89   .data :
90   {
91     . = ALIGN(4);
92     _sdata = .;        /* create a global symbol at data start */
93     *(.data)           /* .data sections */
94     *(.data*)          /* .data* sections */
96     . = ALIGN(4);
97     _edata = .;        /* define a global symbol at data end */
98   } >DTCM_RAM AT >MAIN
100   /* Uninitialized data section */
101   . = ALIGN(4);
102   .bss (NOLOAD) :
103   {
104     /* This is used by the startup in order to initialize the .bss secion */
105     _sbss = .;         /* define a global symbol at bss start */
106     __bss_start__ = _sbss;
107     *(.bss)
108     *(SORT_BY_ALIGNMENT(.bss*))
109     *(COMMON)
111     . = ALIGN(4);
112     _ebss = .;         /* define a global symbol at bss end */
113     __bss_end__ = _ebss;
114   } >DTCM_RAM
116   /* Uninitialized data section */
117   . = ALIGN(4);
118   .sram2 (NOLOAD) :
119   {
120     /* This is used by the startup in order to initialize the .sram2 secion */
121     _ssram2 = .;         /* define a global symbol at sram2 start */
122     __sram2_start__ = _ssram2;
123     *(.sram2)
124     *(SORT_BY_ALIGNMENT(.sram2*))
126     . = ALIGN(4);
127     _esram2 = .;         /* define a global symbol at sram2 end */
128     __sram2_end__ = _esram2;
129   } >RAM
131   /* used during startup to initialized fastram_data */
132   _sfastram_idata = LOADADDR(.fastram_data);
134   /* Initialized FAST_DATA section for unsuspecting developers */
135   .fastram_data :
136   {
137     . = ALIGN(4);
138     _sfastram_data = .;        /* create a global symbol at data start */
139     *(.fastram_data)           /* .data sections */
140     *(.fastram_data*)          /* .data* sections */
142     . = ALIGN(4);
143     _efastram_data = .;        /* define a global symbol at data end */
144   } >FASTRAM AT >MAIN
146   . = ALIGN(4);
147   .fastram_bss (NOLOAD) :
148   {
149     _sfastram_bss = .;
150     __fastram_bss_start__ = _sfastram_bss;
151     *(.fastram_bss)
152     *(SORT_BY_ALIGNMENT(.fastram_bss*))
154     . = ALIGN(4);
155     _efastram_bss = .;
156     __fastram_bss_end__ = _efastram_bss;
157   } >FASTRAM