2 ******************************************************************************
\r
3 File: Debug_STM32F100R8_FLASH.ld
\r
4 Info: Generated by Atollic TrueSTUDIO(R) 9.0.1 2019-02-15
\r
6 Abstract: Linker script for STM32F100R8 device
\r
7 Set heap size, stack size, stack location, memory areas and
\r
8 sections according to application requirements.
\r
10 The MIT License (MIT)
\r
11 Copyright (c) 2018 STMicroelectronics
\r
13 Permission is hereby granted, free of charge, to any person obtaining a copy
\r
14 of this software and associated documentation files (the "Software"), to deal
\r
15 in the Software without restriction, including without limitation the rights
\r
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
17 copies of the Software, and to permit persons to whom the Software is
\r
18 furnished to do so, subject to the following conditions:
\r
20 The above copyright notice and this permission notice shall be included in all
\r
21 copies or substantial portions of the Software.
\r
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
26 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
27 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
28 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
31 ******************************************************************************
\r
35 ENTRY(Reset_Handler)
\r
37 /* Highest address of the user mode stack */
\r
38 _estack = 0x20002000; /* end of 8K RAM */
\r
40 /* Generate a link error if heap and stack don't fit into RAM */
\r
41 _Min_Heap_Size = 0; /* required amount of heap */
\r
42 _Min_Stack_Size = 0x80; /* required amount of stack */
\r
44 /* Specify the memory areas */
\r
47 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
\r
48 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
\r
49 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
\r
52 /* Define output sections */
\r
55 /* The startup code goes first into FLASH */
\r
59 KEEP(*(.isr_vector)) /* Startup code */
\r
63 /* The program code and other data goes into FLASH */
\r
67 *(.text) /* .text sections (code) */
\r
68 *(.text*) /* .text* sections (code) */
\r
69 *(.glue_7) /* glue arm to thumb code */
\r
70 *(.glue_7t) /* glue thumb to arm code */
\r
77 _etext = .; /* define a global symbols at end of code */
\r
80 /* Constant data goes into FLASH */
\r
84 *(.rodata) /* .rodata sections (constants, strings, etc.) */
\r
85 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
\r
89 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
\r
98 PROVIDE_HIDDEN (__preinit_array_start = .);
\r
99 KEEP (*(.preinit_array*))
\r
100 PROVIDE_HIDDEN (__preinit_array_end = .);
\r
104 PROVIDE_HIDDEN (__init_array_start = .);
\r
105 KEEP (*(SORT(.init_array.*)))
\r
106 KEEP (*(.init_array*))
\r
107 PROVIDE_HIDDEN (__init_array_end = .);
\r
111 PROVIDE_HIDDEN (__fini_array_start = .);
\r
112 KEEP (*(SORT(.fini_array.*)))
\r
113 KEEP (*(.fini_array*))
\r
114 PROVIDE_HIDDEN (__fini_array_end = .);
\r
117 /* used by the startup to initialize data */
\r
118 _sidata = LOADADDR(.data);
\r
120 /* Initialized data sections goes into RAM, load LMA copy after code */
\r
124 _sdata = .; /* create a global symbol at data start */
\r
125 *(.data) /* .data sections */
\r
126 *(.data*) /* .data* sections */
\r
129 _edata = .; /* define a global symbol at data end */
\r
132 /* Uninitialized data section */
\r
136 /* This is used by the startup in order to initialize the .bss secion */
\r
137 _sbss = .; /* define a global symbol at bss start */
\r
138 __bss_start__ = _sbss;
\r
144 _ebss = .; /* define a global symbol at bss end */
\r
145 __bss_end__ = _ebss;
\r
148 /* User_heap_stack section, used to check that there is enough RAM left */
\r
149 ._user_heap_stack :
\r
152 PROVIDE ( end = . );
\r
153 PROVIDE ( _end = . );
\r
154 . = . + _Min_Heap_Size;
\r
155 . = . + _Min_Stack_Size;
\r
159 /* MEMORY_bank1 section, code must be located here explicitly */
\r
160 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
\r
163 *(.mb1text) /* .mb1text sections (code) */
\r
164 *(.mb1text*) /* .mb1text* sections (code) */
\r
165 *(.mb1rodata) /* read-only data (constants) */
\r
169 /* Remove information from the standard libraries */
\r
177 .ARM.attributes 0 : { *(.ARM.attributes) }
\r