]> mj.ucw.cz Git - home-hw.git/blob - STM32F030R8Tx_FLASH.ld
Files auto-generated by Cube MX
[home-hw.git] / STM32F030R8Tx_FLASH.ld
1 /*\r
2 *****************************************************************************\r
3 **\r
4 \r
5 **  File        : LinkerScript.ld\r
6 **\r
7 **  Abstract    : Linker script for STM32F030R8Tx Device with\r
8 **                64KByte FLASH, 8KByte RAM\r
9 **\r
10 **                Set heap size, stack size and stack location according\r
11 **                to application requirements.\r
12 **\r
13 **                Set memory bank area and size if external memory is used.\r
14 **\r
15 **  Target      : STMicroelectronics STM32\r
16 **\r
17 **\r
18 **  Distribution: The file is distributed as is, without any warranty\r
19 **                of any kind.\r
20 **\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
28 **\r
29 *****************************************************************************\r
30 */\r
31 \r
32 /* Entry Point */\r
33 ENTRY(Reset_Handler)\r
34 \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
40 \r
41 /* Specify the memory areas */\r
42 MEMORY\r
43 {\r
44 RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 8K\r
45 FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 64K\r
46 }\r
47 \r
48 /* Define output sections */\r
49 SECTIONS\r
50 {\r
51   /* The startup code goes first into FLASH */\r
52   .isr_vector :\r
53   {\r
54     . = ALIGN(4);\r
55     KEEP(*(.isr_vector)) /* Startup code */\r
56     . = ALIGN(4);\r
57   } >FLASH\r
58 \r
59   /* The program code and other data goes into FLASH */\r
60   .text :\r
61   {\r
62     . = ALIGN(4);\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
67     *(.eh_frame)\r
68 \r
69     KEEP (*(.init))\r
70     KEEP (*(.fini))\r
71 \r
72     . = ALIGN(4);\r
73     _etext = .;        /* define a global symbols at end of code */\r
74   } >FLASH\r
75 \r
76   /* Constant data goes into FLASH */\r
77   .rodata :\r
78   {\r
79     . = ALIGN(4);\r
80     *(.rodata)         /* .rodata sections (constants, strings, etc.) */\r
81     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */\r
82     . = ALIGN(4);\r
83   } >FLASH\r
84 \r
85   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH\r
86   .ARM : {\r
87     __exidx_start = .;\r
88     *(.ARM.exidx*)\r
89     __exidx_end = .;\r
90   } >FLASH\r
91 \r
92   .preinit_array     :\r
93   {\r
94     PROVIDE_HIDDEN (__preinit_array_start = .);\r
95     KEEP (*(.preinit_array*))\r
96     PROVIDE_HIDDEN (__preinit_array_end = .);\r
97   } >FLASH\r
98   .init_array :\r
99   {\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
104   } >FLASH\r
105   .fini_array :\r
106   {\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
111   } >FLASH\r
112 \r
113   /* used by the startup to initialize data */\r
114   _sidata = LOADADDR(.data);\r
115 \r
116   /* Initialized data sections goes into RAM, load LMA copy after code */\r
117   .data : \r
118   {\r
119     . = ALIGN(4);\r
120     _sdata = .;        /* create a global symbol at data start */\r
121     *(.data)           /* .data sections */\r
122     *(.data*)          /* .data* sections */\r
123 \r
124     . = ALIGN(4);\r
125     _edata = .;        /* define a global symbol at data end */\r
126   } >RAM AT> FLASH\r
127 \r
128   \r
129   /* Uninitialized data section */\r
130   . = ALIGN(4);\r
131   .bss :\r
132   {\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
136     *(.bss)\r
137     *(.bss*)\r
138     *(COMMON)\r
139 \r
140     . = ALIGN(4);\r
141     _ebss = .;         /* define a global symbol at bss end */\r
142     __bss_end__ = _ebss;\r
143   } >RAM\r
144 \r
145   /* User_heap_stack section, used to check that there is enough RAM left */\r
146   ._user_heap_stack :\r
147   {\r
148     . = ALIGN(8);\r
149     PROVIDE ( end = . );\r
150     PROVIDE ( _end = . );\r
151     . = . + _Min_Heap_Size;\r
152     . = . + _Min_Stack_Size;\r
153     . = ALIGN(8);\r
154   } >RAM\r
155 \r
156   \r
157 \r
158   /* Remove information from the standard libraries */\r
159   /DISCARD/ :\r
160   {\r
161     libc.a ( * )\r
162     libm.a ( * )\r
163     libgcc.a ( * )\r
164   }\r
165 \r
166   .ARM.attributes 0 : { *(.ARM.attributes) }\r
167 }\r
168 \r
169 \r