2 *****************************************************************************
\r
5 ** File : LinkerScript.ld
\r
7 ** Abstract : Linker script for STM32F030R8Tx Device with
\r
8 ** 64KByte FLASH, 8KByte RAM
\r
10 ** Set heap size, stack size and stack location according
\r
11 ** to application requirements.
\r
13 ** Set memory bank area and size if external memory is used.
\r
15 ** Target : STMicroelectronics STM32
\r
18 ** Distribution: The file is distributed as is, without any warranty
\r
21 ** (c)Copyright Ac6.
\r
22 ** You may use this file as-is or modify it according to the needs of your
\r
23 ** project. Distribution of this file (unmodified or modified) is not
\r
24 ** permitted. Ac6 permit registered System Workbench for MCU users the
\r
25 ** rights to distribute the assembled, compiled & linked contents of this
\r
26 ** file as part of an application binary file, provided that it is built
\r
27 ** using the System Workbench for MCU toolchain.
\r
29 *****************************************************************************
\r
33 ENTRY(Reset_Handler)
\r
35 /* Highest address of the user mode stack */
\r
36 _estack = 0x20002000; /* end of RAM */
\r
37 /* Generate a link error if heap and stack don't fit into RAM */
\r
38 _Min_Heap_Size = 0x200; /* required amount of heap */
\r
39 _Min_Stack_Size = 0x400; /* required amount of stack */
\r
41 /* Specify the memory areas */
\r
44 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
\r
45 FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 64K
\r
48 /* Define output sections */
\r
51 /* The startup code goes first into FLASH */
\r
55 KEEP(*(.isr_vector)) /* Startup code */
\r
59 /* The program code and other data goes into FLASH */
\r
63 *(.text) /* .text sections (code) */
\r
64 *(.text*) /* .text* sections (code) */
\r
65 *(.glue_7) /* glue arm to thumb code */
\r
66 *(.glue_7t) /* glue thumb to arm code */
\r
73 _etext = .; /* define a global symbols at end of code */
\r
76 /* Constant data goes into FLASH */
\r
80 *(.rodata) /* .rodata sections (constants, strings, etc.) */
\r
81 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
\r
85 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
\r
94 PROVIDE_HIDDEN (__preinit_array_start = .);
\r
95 KEEP (*(.preinit_array*))
\r
96 PROVIDE_HIDDEN (__preinit_array_end = .);
\r
100 PROVIDE_HIDDEN (__init_array_start = .);
\r
101 KEEP (*(SORT(.init_array.*)))
\r
102 KEEP (*(.init_array*))
\r
103 PROVIDE_HIDDEN (__init_array_end = .);
\r
107 PROVIDE_HIDDEN (__fini_array_start = .);
\r
108 KEEP (*(SORT(.fini_array.*)))
\r
109 KEEP (*(.fini_array*))
\r
110 PROVIDE_HIDDEN (__fini_array_end = .);
\r
113 /* used by the startup to initialize data */
\r
114 _sidata = LOADADDR(.data);
\r
116 /* Initialized data sections goes into RAM, load LMA copy after code */
\r
120 _sdata = .; /* create a global symbol at data start */
\r
121 *(.data) /* .data sections */
\r
122 *(.data*) /* .data* sections */
\r
125 _edata = .; /* define a global symbol at data end */
\r
129 /* Uninitialized data section */
\r
133 /* This is used by the startup in order to initialize the .bss secion */
\r
134 _sbss = .; /* define a global symbol at bss start */
\r
135 __bss_start__ = _sbss;
\r
141 _ebss = .; /* define a global symbol at bss end */
\r
142 __bss_end__ = _ebss;
\r
145 /* User_heap_stack section, used to check that there is enough RAM left */
\r
146 ._user_heap_stack :
\r
149 PROVIDE ( end = . );
\r
150 PROVIDE ( _end = . );
\r
151 . = . + _Min_Heap_Size;
\r
152 . = . + _Min_Stack_Size;
\r
158 /* Remove information from the standard libraries */
\r
166 .ARM.attributes 0 : { *(.ARM.attributes) }
\r