2 *****************************************************************************
4 ** File : stm32_flashboot.ld
6 ** Abstract : Linker script for STM32F205 Device with
7 ** 0.5MByte FLASH, 128KByte SRAM
9 ** Set heap size, stack size and stack location according
10 ** to application requirements.
12 ** Set memory bank area and size if external memory is used.
14 ** Target : STMicroelectronics STM32
16 *****************************************************************************
22 /* Highest address of the user mode stack */
23 _estack = 0x20020000; /* end of 128K SRAM */
25 /* Generate a link error if heap and stack don't fit into RAM */
26 _Min_Heap_Size = 0; /* required amount of heap */
27 _Main_Stack_Size = 1024; /* required amount of stack for interrupt stack (Main stack) */
30 _main_stack_start = _estack - _Main_Stack_Size;
32 /* Specify the memory areas */
35 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
36 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
37 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
40 /* Define output sections */
43 /* The startup code goes first into FLASH */
45 /* The program code and other data goes into FLASH */
49 KEEP(*(.isr_vector)) /* Startup code */
51 KEEP(*(.bootversiondata))
52 . = ALIGN(4); /* Align the start of the text part */
53 *(.text) /* .text sections (code) */
54 *(.text*) /* .text* sections (code) */
55 *(.rodata) /* .rodata sections (constants, strings, etc.) */
56 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
57 *(.glue_7) /* glue arm to thumb code */
58 *(.glue_7t) /* glue thumb to arm code */
65 _etext = .; /* define a global symbols at end of code */
69 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
78 PROVIDE_HIDDEN (__preinit_array_start = .);
79 KEEP (*(.preinit_array*))
80 PROVIDE_HIDDEN (__preinit_array_end = .);
84 PROVIDE_HIDDEN (__init_array_start = .);
85 KEEP (*(SORT(.init_array.*)))
86 KEEP (*(.init_array*))
87 PROVIDE_HIDDEN (__init_array_end = .);
91 PROVIDE_HIDDEN (__fini_array_start = .);
92 KEEP (*(.fini_array*))
93 KEEP (*(SORT(.fini_array.*)))
94 PROVIDE_HIDDEN (__fini_array_end = .);
97 /* used by the startup to initialize data */
100 /* Initialized data sections goes into RAM, load LMA copy after code */
101 .data : AT ( _sidata )
104 _sdata = .; /* create a global symbol at data start */
105 *(.data) /* .data sections */
106 *(.data*) /* .data* sections */
109 _edata = .; /* define a global symbol at data end */
112 /* Uninitialized data section */
116 /* This is used by the startup in order to initialize the .bss secion */
117 _sbss = .; /* define a global symbol at bss start */
118 __bss_start__ = _sbss;
124 _ebss = .; /* define a global symbol at bss end */
128 PROVIDE ( end = _ebss );
129 PROVIDE ( _end = _ebss );
131 /* User_heap_stack section, used to check that there is enough RAM left */
135 . = . + _Min_Heap_Size;
136 . = . + _Main_Stack_Size;
140 /* MEMORY_bank1 section, code must be located here explicitly */
141 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
144 *(.mb1text) /* .mb1text sections (code) */
145 *(.mb1text*) /* .mb1text* sections (code) */
146 *(.mb1rodata) /* read-only data (constants) */
150 /* Remove information from the standard libraries */
158 .ARM.attributes 0 : { *(.ARM.attributes) }