]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_STM32F100_Atollic/Debug_STM32F100R8_FLASH.ld
Ensure both one-shot and auto-reload are written consistently with a hyphen in comments.
[freertos] / FreeRTOS / Demo / CORTEX_STM32F100_Atollic / Debug_STM32F100R8_FLASH.ld
1 /*\r
2 ******************************************************************************\r
3 File:     Debug_STM32F100R8_FLASH.ld\r
4 Info:     Generated by Atollic TrueSTUDIO(R) 9.0.1   2019-02-15\r
5 \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
9 \r
10 The MIT License (MIT)\r
11 Copyright (c) 2018 STMicroelectronics\r
12 \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
19 \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
22 \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
29 SOFTWARE.\r
30 \r
31 ******************************************************************************\r
32 */\r
33 \r
34 /* Entry Point */\r
35 ENTRY(Reset_Handler)\r
36 \r
37 /* Highest address of the user mode stack */\r
38 _estack = 0x20002000;    /* end of 8K RAM */\r
39 \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
43 \r
44 /* Specify the memory areas */\r
45 MEMORY\r
46 {\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
50 }\r
51 \r
52 /* Define output sections */\r
53 SECTIONS\r
54 {\r
55   /* The startup code goes first into FLASH */\r
56   .isr_vector :\r
57   {\r
58     . = ALIGN(4);\r
59     KEEP(*(.isr_vector)) /* Startup code */\r
60     . = ALIGN(4);\r
61   } >FLASH\r
62 \r
63   /* The program code and other data goes into FLASH */\r
64   .text :\r
65   {\r
66     . = ALIGN(4);\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
71     *(.eh_frame)\r
72 \r
73     KEEP (*(.init))\r
74     KEEP (*(.fini))\r
75 \r
76     . = ALIGN(4);\r
77     _etext = .;        /* define a global symbols at end of code */\r
78   } >FLASH\r
79 \r
80   /* Constant data goes into FLASH */\r
81   .rodata :\r
82   {\r
83     . = ALIGN(4);\r
84     *(.rodata)         /* .rodata sections (constants, strings, etc.) */\r
85     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */\r
86     . = ALIGN(4);\r
87   } >FLASH\r
88 \r
89   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH\r
90   .ARM : {\r
91     __exidx_start = .;\r
92     *(.ARM.exidx*)\r
93     __exidx_end = .;\r
94   } >FLASH\r
95 \r
96   .preinit_array     :\r
97   {\r
98     PROVIDE_HIDDEN (__preinit_array_start = .);\r
99     KEEP (*(.preinit_array*))\r
100     PROVIDE_HIDDEN (__preinit_array_end = .);\r
101   } >FLASH\r
102   .init_array :\r
103   {\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
108   } >FLASH\r
109   .fini_array :\r
110   {\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
115   } >FLASH\r
116 \r
117   /* used by the startup to initialize data */\r
118   _sidata = LOADADDR(.data);\r
119 \r
120   /* Initialized data sections goes into RAM, load LMA copy after code */\r
121   .data : \r
122   {\r
123     . = ALIGN(4);\r
124     _sdata = .;        /* create a global symbol at data start */\r
125     *(.data)           /* .data sections */\r
126     *(.data*)          /* .data* sections */\r
127 \r
128     . = ALIGN(4);\r
129     _edata = .;        /* define a global symbol at data end */\r
130   } >RAM AT> FLASH\r
131 \r
132   /* Uninitialized data section */\r
133   . = ALIGN(4);\r
134   .bss :\r
135   {\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
139     *(.bss)\r
140     *(.bss*)\r
141     *(COMMON)\r
142 \r
143     . = ALIGN(4);\r
144     _ebss = .;         /* define a global symbol at bss end */\r
145     __bss_end__ = _ebss;\r
146   } >RAM\r
147 \r
148   /* User_heap_stack section, used to check that there is enough RAM left */\r
149   ._user_heap_stack :\r
150   {\r
151     . = ALIGN(4);\r
152     PROVIDE ( end = . );\r
153     PROVIDE ( _end = . );\r
154     . = . + _Min_Heap_Size;\r
155     . = . + _Min_Stack_Size;\r
156     . = ALIGN(4);\r
157   } >RAM\r
158 \r
159   /* MEMORY_bank1 section, code must be located here explicitly            */\r
160   /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */\r
161   .memory_b1_text :\r
162   {\r
163     *(.mb1text)        /* .mb1text sections (code) */\r
164     *(.mb1text*)       /* .mb1text* sections (code)  */\r
165     *(.mb1rodata)      /* read-only data (constants) */\r
166     *(.mb1rodata*)\r
167   } >MEMORY_B1\r
168 \r
169   /* Remove information from the standard libraries */\r
170   /DISCARD/ :\r
171   {\r
172     libc.a ( * )\r
173     libm.a ( * )\r
174     libgcc.a ( * )\r
175   }\r
176 \r
177   .ARM.attributes 0 : { *(.ARM.attributes) }\r
178 }\r