2 Default linker script for STM32F10x_512K_64K
\r
3 Copyright RAISONANCE S.A.S. 2008
\r
6 /* include the common STM32F10x sub-script */
\r
8 /* Common part of the linker scripts for STM32 devices*/
\r
11 /* default stack sizes.
\r
13 These are used by the startup in order to allocate stacks for the different modes.
\r
16 __Stack_Size = 1024 ;
\r
18 PROVIDE ( _Stack_Size = __Stack_Size ) ;
\r
20 __Stack_Init = _estack - __Stack_Size ;
\r
22 /*"PROVIDE" allows to easily override these values from an object file or the commmand line.*/
\r
23 PROVIDE ( _Stack_Init = __Stack_Init ) ;
\r
26 There will be a link error if there is not this amount of RAM free at the end.
\r
28 _Minimum_Stack_Size = 0x100 ;
\r
31 /* include the memory spaces definitions sub-script */
\r
33 Linker subscript for STM32F10x definitions with 512K Flash and 1024K RAM */
\r
35 ENTRY(Reset_Handler)
\r
37 /* Memory Spaces Definitions */
\r
41 /* ST32F103, 128K flash, 20K RAM */
\r
43 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
\r
44 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
\r
45 FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
\r
46 EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
\r
47 EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
\r
48 EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
\r
49 EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
\r
52 /* higher address of the user mode stack */
\r
53 _estack = 0x20005000;
\r
56 /* include the sections management sub-script for FLASH mode */
\r
58 /* Sections Definitions */
\r
62 /* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */
\r
66 KEEP(*(.isr_vector)) /* Startup code */
\r
70 /* for some STRx devices, the beginning of the startup code is stored in the .flashtext section, which goes to FLASH */
\r
74 *(.flashtext) /* Startup code */
\r
79 /* the program code is stored in the .text section, which goes to Flash */
\r
84 *(.text) /* remaining code */
\r
85 *(.text.*) /* remaining code */
\r
86 *(.rodata) /* read-only data (constants) */
\r
93 /* This is used by the startup in order to initialize the .data secion */
\r
99 /* Special sucky exception section */
\r
101 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
\r
106 /* This is the initialized data section
\r
107 The program executes knowing that the data is in the RAM
\r
108 but the loader puts the initial values in the FLASH (inidata).
\r
109 It is one task of the startup to copy the initial values from FLASH to RAM. */
\r
110 .data : AT ( _sidata )
\r
113 /* This is used by the startup in order to initialize the .data secion */
\r
118 *(.ARM.extab* .gnu.linkonce.armextab.*)
\r
120 /* This is used by the startup in order to initialize the .data secion */
\r
126 /* This is the uninitialized data section */
\r
130 /* This is used by the startup in order to initialize the .bss secion */
\r
138 /* This is used by the startup in order to initialize the .bss secion */
\r
142 PROVIDE ( end = _ebss );
\r
143 PROVIDE ( _end = _ebss );
\r
145 /* This is the user stack section
\r
146 This is just to check that there is enough RAM left for the User mode stack
\r
147 It should generate an error if it's full.
\r
154 . = . + _Minimum_Stack_Size ;
\r
162 /* this is the FLASH Bank1 */
\r
163 /* the C or assembly source must explicitly place the code or data there
\r
164 using the "section" attribute */
\r
167 *(.b1text) /* remaining code */
\r
168 *(.b1rodata) /* read-only data (constants) */
\r
172 /* this is the EXTMEM */
\r
173 /* the C or assembly source must explicitly place the code or data there
\r
174 using the "section" attribute */
\r
179 *(.eb0text) /* remaining code */
\r
180 *(.eb0rodata) /* read-only data (constants) */
\r
187 *(.eb1text) /* remaining code */
\r
188 *(.eb1rodata) /* read-only data (constants) */
\r
195 *(.eb2text) /* remaining code */
\r
196 *(.eb2rodata) /* read-only data (constants) */
\r
203 *(.eb3text) /* remaining code */
\r
204 *(.eb3rodata) /* read-only data (constants) */
\r
210 /* after that it's only debugging information. */
\r
212 /* remove the debugging information from the standard libraries */
\r
221 /* Stabs debugging sections. */
\r
222 .stab 0 : { *(.stab) }
\r
223 .stabstr 0 : { *(.stabstr) }
\r
224 .stab.excl 0 : { *(.stab.excl) }
\r
225 .stab.exclstr 0 : { *(.stab.exclstr) }
\r
226 .stab.index 0 : { *(.stab.index) }
\r
227 .stab.indexstr 0 : { *(.stab.indexstr) }
\r
228 .comment 0 : { *(.comment) }
\r
229 /* DWARF debug sections.
\r
230 Symbols in the DWARF debugging sections are relative to the beginning
\r
231 of the section so we begin them at 0. */
\r
233 .debug 0 : { *(.debug) }
\r
234 .line 0 : { *(.line) }
\r
235 /* GNU DWARF 1 extensions */
\r
236 .debug_srcinfo 0 : { *(.debug_srcinfo) }
\r
237 .debug_sfnames 0 : { *(.debug_sfnames) }
\r
238 /* DWARF 1.1 and DWARF 2 */
\r
239 .debug_aranges 0 : { *(.debug_aranges) }
\r
240 .debug_pubnames 0 : { *(.debug_pubnames) }
\r
242 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
\r
243 .debug_abbrev 0 : { *(.debug_abbrev) }
\r
244 .debug_line 0 : { *(.debug_line) }
\r
245 .debug_frame 0 : { *(.debug_frame) }
\r
246 .debug_str 0 : { *(.debug_str) }
\r
247 .debug_loc 0 : { *(.debug_loc) }
\r
248 .debug_macinfo 0 : { *(.debug_macinfo) }
\r
249 /* SGI/MIPS DWARF 2 extensions */
\r
250 .debug_weaknames 0 : { *(.debug_weaknames) }
\r
251 .debug_funcnames 0 : { *(.debug_funcnames) }
\r
252 .debug_typenames 0 : { *(.debug_typenames) }
\r
253 .debug_varnames 0 : { *(.debug_varnames) }
\r