2 *****************************************************************************
4 ** File : STM32F101X6_FLASH.ld
6 ** Abstract : Linker script for STM32F101x6 Device with
7 ** 32KByte FLASH, 6KByte RAM
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 ** Environment : Atollic TrueSTUDIO(R)
18 ** Distribution: The file is distributed “as is,” without any warranty
21 ** (c)Copyright Atollic AB.
22 ** You may use this file as-is or modify it according to the needs of your
23 ** project. This file may only be built (assembled or compiled and linked)
24 ** using the Atollic TrueSTUDIO(R) product. The use of this file together
25 ** with other tools than Atollic TrueSTUDIO(R) is not permitted.
27 *****************************************************************************
33 /* Highest address of the user mode stack */
34 _estack = 0x200017FF; /* end of RAM */
36 /* Generate a link error if heap and stack don't fit into RAM */
37 _Min_Heap_Size = 0x200; /* required amount of heap */
38 _Min_Stack_Size = 0x400; /* required amount of stack */
40 /* Specify the memory areas */
43 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K
44 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 6K
47 /* Define output sections */
50 /* The startup code goes first into FLASH */
54 KEEP(*(.isr_vector)) /* Startup code */
58 /* The program code and other data goes into FLASH */
62 *(.text) /* .text sections (code) */
63 *(.text*) /* .text* sections (code) */
64 *(.glue_7) /* glue arm to thumb code */
65 *(.glue_7t) /* glue thumb to arm code */
72 _etext = .; /* define a global symbols at end of code */
75 /* Constant data goes into FLASH */
79 *(.rodata) /* .rodata sections (constants, strings, etc.) */
80 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
84 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
93 PROVIDE_HIDDEN (__preinit_array_start = .);
94 KEEP (*(.preinit_array*))
95 PROVIDE_HIDDEN (__preinit_array_end = .);
99 PROVIDE_HIDDEN (__init_array_start = .);
100 KEEP (*(SORT(.init_array.*)))
101 KEEP (*(.init_array*))
102 PROVIDE_HIDDEN (__init_array_end = .);
106 PROVIDE_HIDDEN (__fini_array_start = .);
107 KEEP (*(SORT(.fini_array.*)))
108 KEEP (*(.fini_array*))
109 PROVIDE_HIDDEN (__fini_array_end = .);
112 /* used by the startup to initialize data */
113 _sidata = LOADADDR(.data);
115 /* Initialized data sections goes into RAM, load LMA copy after code */
119 _sdata = .; /* create a global symbol at data start */
120 *(.data) /* .data sections */
121 *(.data*) /* .data* sections */
124 _edata = .; /* define a global symbol at data end */
128 /* Uninitialized data section */
132 /* This is used by the startup in order to initialize the .bss secion */
133 _sbss = .; /* define a global symbol at bss start */
134 __bss_start__ = _sbss;
140 _ebss = .; /* define a global symbol at bss end */
144 /* User_heap_stack section, used to check that there is enough RAM left */
149 PROVIDE ( _end = . );
150 . = . + _Min_Heap_Size;
151 . = . + _Min_Stack_Size;
157 /* Remove information from the standard libraries */
165 .ARM.attributes 0 : { *(.ARM.attributes) }