Merge pull request #11664 from SteveCEvans/add_ICM426xx
[betaflight.git] / src / link / stm32_h730_common.ld
bloba485128aa8b092cd33683613f591b41ac9639b0d
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 __octospi1_start = ORIGIN(OCTOSPI1);
10 __octospi2_start = ORIGIN(OCTOSPI2);
12 /* Generate a link error if heap and stack don't fit into RAM */
13 _Min_Heap_Size = 0;      /* required amount of heap  */
14 _Min_Stack_Size = 0x800; /* required amount of stack */
16 /* Define output sections */
17 SECTIONS
19   _isr_vector_table_flash_base = LOADADDR(.isr_vector);
20   PROVIDE (isr_vector_table_flash_base = _isr_vector_table_flash_base);
22   .isr_vector :
23   {
24     . = ALIGN(512);
25     PROVIDE (isr_vector_table_base = .);
26     KEEP(*(.isr_vector)) /* Startup code */
27     . = ALIGN(4);
28     PROVIDE (isr_vector_table_end = .);
29   } >VECTAB AT> MAIN
31   _ram_isr_vector_table_base = LOADADDR(.ram_isr_vector);
32   PROVIDE (ram_isr_vector_table_base = _ram_isr_vector_table_base);
34   .ram_isr_vector (NOLOAD) :
35   {
36     . = ALIGN(512); /* Vector table offset must be multiple of 0x200 */
37     PROVIDE (ram_isr_vector_table_base = .);
38     . += (isr_vector_table_end - isr_vector_table_base);
39     . = ALIGN(4);    
40     PROVIDE (ram_isr_vector_table_end = .);
41   } >DTCM_RAM
43   /* The program code and other data goes into MAIN */
44   .text :
45   {
46     . = ALIGN(4);
47     *(.text)           /* .text sections (code) */
48     *(.text*)          /* .text* sections (code) */
49     *(.rodata)         /* .rodata sections (constants, strings, etc.) */
50     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
51     *(.glue_7)         /* glue arm to thumb code */
52     *(.glue_7t)        /* glue thumb to arm code */
53     *(.eh_frame)
55     KEEP (*(.init))
56     KEEP (*(.fini))
58     . = ALIGN(4);
59     _etext = .;        /* define a global symbols at end of code */
60   } >MAIN
62   /* Critical program code goes into ITCM RAM */
63   /* Copy specific fast-executing code to ITCM RAM */ 
64   tcm_code = LOADADDR(.tcm_code); 
65   .tcm_code :
66   {
67     . = ALIGN(4);
68     tcm_code_start = .; 
69     *(.tcm_code)
70     *(.tcm_code*)
71     . = ALIGN(4);
72     tcm_code_end = .; 
73   } >ITCM_RAM AT >MAIN
75   .ARM.extab   : 
76   { 
77     *(.ARM.extab* .gnu.linkonce.armextab.*) 
78   } >MAIN
79   
80   .ARM : 
81   {
82     __exidx_start = .;
83     *(.ARM.exidx*) __exidx_end = .;
84   } >MAIN
86   .pg_registry :
87   {
88     PROVIDE_HIDDEN (__pg_registry_start = .);
89     KEEP (*(.pg_registry))
90     KEEP (*(SORT(.pg_registry.*)))
91     PROVIDE_HIDDEN (__pg_registry_end = .);
92   } >MAIN
93   
94   .pg_resetdata :
95   {
96     PROVIDE_HIDDEN (__pg_resetdata_start = .);
97     KEEP (*(.pg_resetdata))
98     PROVIDE_HIDDEN (__pg_resetdata_end = .);
99   } >MAIN
101   /* used by the startup to initialize data */
102   _sidata = LOADADDR(.data);
104   /* Initialized data sections goes into RAM, load LMA copy after code */
105   .data :
106   {
107     . = ALIGN(4);
108     _sdata = .;        /* create a global symbol at data start */
109     *(.data)           /* .data sections */
110     *(.data*)          /* .data* sections */
112     . = ALIGN(4);
113     _edata = .;        /* define a global symbol at data end */
114   } >DTCM_RAM AT >MAIN
116   /* Uninitialized data section */
117   . = ALIGN(4);
118   .bss (NOLOAD) :
119   {
120     /* This is used by the startup in order to initialize the .bss secion */
121     _sbss = .;         /* define a global symbol at bss start */
122     __bss_start__ = _sbss;
123     *(.bss)
124     *(SORT_BY_ALIGNMENT(.bss*))
125     *(COMMON)
127     . = ALIGN(4);
128     _ebss = .;         /* define a global symbol at bss end */
129     __bss_end__ = _ebss;
130   } >RAM
132   /* Uninitialized data section */
133   . = ALIGN(4);
134   .sram2 (NOLOAD) :
135   {
136     /* This is used by the startup in order to initialize the .sram2 secion */
137     _ssram2 = .;         /* define a global symbol at sram2 start */
138     __sram2_start__ = _ssram2;
139     *(.sram2)
140     *(SORT_BY_ALIGNMENT(.sram2*))
142     . = ALIGN(4);
143     _esram2 = .;         /* define a global symbol at sram2 end */
144     __sram2_end__ = _esram2;
145   } >RAM
147   /* used during startup to initialized fastram_data */
148   _sfastram_idata = LOADADDR(.fastram_data);
150   /* Initialized FAST_DATA section for unsuspecting developers */
151   .fastram_data :
152   {
153     . = ALIGN(4);
154     _sfastram_data = .;        /* create a global symbol at data start */
155     *(.fastram_data)           /* .data sections */
156     *(.fastram_data*)          /* .data* sections */
158     . = ALIGN(4);
159     _efastram_data = .;        /* define a global symbol at data end */
160   } >FASTRAM AT >MAIN
162   . = ALIGN(4);
163   .fastram_bss (NOLOAD) :
164   {
165     _sfastram_bss = .;
166     __fastram_bss_start__ = _sfastram_bss;
167     *(.fastram_bss)
168     *(SORT_BY_ALIGNMENT(.fastram_bss*))
170     . = ALIGN(4);
171     _efastram_bss = .;
172     __fastram_bss_end__ = _efastram_bss;
173   } >FASTRAM