]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_STM32F100_Atollic/stm32_flash.ld
Update headers for the FreeRTOS V7.0.2 release.
[freertos] / Demo / CORTEX_STM32F100_Atollic / stm32_flash.ld
1 /*
2 *****************************************************************************
3 **
4 **  File        : stm32_flash.ld
5 **
6 **  Abstract    : Linker script for STM32F100RB Device with
7 **                128KByte FLASH, 8KByte RAM
8 **
9 **                Set heap size, stack size and stack location according
10 **                to application requirements.
11 **
12 **                Set memory bank area and size if external memory is used.
13 **
14 **  Target      : STMicroelectronics STM32
15 **
16 **  Environment : Atollic TrueSTUDIO(R)
17 **
18 **  Distribution: The file is distributed \93as is,\94 without any warranty
19 **                of any kind.
20 **
21 **  (c)Copyright Atollic AB.
22 **  This file may be distributed and used with the FreeRTOS example project 
23 **  for Atollic TrueSTUDIO only. 
24 **
25 *****************************************************************************
26 */
27
28 /* Entry Point */
29 ENTRY(Reset_Handler)
30
31 /* Highest address of the user mode stack */
32 _estack = 0x20002000;    /* end of 8K RAM */
33
34 /* Generate a link error if heap and stack don't fit into RAM */
35 _Min_Heap_Size = 0;      /* required amount of heap  */
36 _Min_Stack_Size = 0x80; /* required amount of stack */
37
38 /* Specify the memory areas */
39 MEMORY
40 {
41   FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 128K
42   RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 8K
43   MEMORY_B1 (rx)  : ORIGIN = 0x60000000, LENGTH = 0K
44 }
45
46 /* Define output sections */
47 SECTIONS
48 {
49   /* The startup code goes first into FLASH */
50   .isr_vector :
51   {
52     . = ALIGN(4);
53     KEEP(*(.isr_vector)) /* Startup code */
54     . = ALIGN(4);
55   } >FLASH
56
57   /* The program code and other data goes into FLASH */
58   .text :
59   {
60     . = ALIGN(4);
61     *(.text)           /* .text sections (code) */
62     *(.text*)          /* .text* sections (code) */
63     *(.rodata)         /* .rodata sections (constants, strings, etc.) */
64     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
65     *(.glue_7)         /* glue arm to thumb code */
66     *(.glue_7t)        /* glue thumb to arm code */
67         *(.eh_frame)
68
69     KEEP (*(.init))
70     KEEP (*(.fini))
71
72     . = ALIGN(4);
73     _etext = .;        /* define a global symbols at end of code */
74   } >FLASH
75
76
77    .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
78     .ARM : {
79     __exidx_start = .;
80       *(.ARM.exidx*)
81       __exidx_end = .;
82     } >FLASH
83
84   .preinit_array     :
85   {
86     PROVIDE_HIDDEN (__preinit_array_start = .);
87     KEEP (*(.preinit_array*))
88     PROVIDE_HIDDEN (__preinit_array_end = .);
89   } >FLASH
90   .init_array :
91   {
92     PROVIDE_HIDDEN (__init_array_start = .);
93     KEEP (*(SORT(.init_array.*)))
94     KEEP (*(.init_array*))
95     PROVIDE_HIDDEN (__init_array_end = .);
96   } >FLASH
97   .fini_array :
98   {
99     PROVIDE_HIDDEN (__fini_array_start = .);
100     KEEP (*(.fini_array*))
101     KEEP (*(SORT(.fini_array.*)))
102     PROVIDE_HIDDEN (__fini_array_end = .);
103   } >FLASH
104
105   /* used by the startup to initialize data */
106   _sidata = .;
107
108   /* Initialized data sections goes into RAM, load LMA copy after code */
109   .data : AT ( _sidata )
110   {
111     . = ALIGN(4);
112     _sdata = .;        /* create a global symbol at data start */
113     *(.data)           /* .data sections */
114     *(.data*)          /* .data* sections */
115
116     . = ALIGN(4);
117     _edata = .;        /* define a global symbol at data end */
118   } >RAM
119
120   /* Uninitialized data section */
121   . = ALIGN(4);
122   .bss :
123   {
124     /* This is used by the startup in order to initialize the .bss secion */
125     _sbss = .;         /* define a global symbol at bss start */
126     __bss_start__ = _sbss;
127     *(.bss)
128     *(.bss*)
129     *(COMMON)
130
131     . = ALIGN(4);
132     _ebss = .;         /* define a global symbol at bss end */
133     __bss_end__ = _ebss;
134   } >RAM
135
136   PROVIDE ( end = _ebss );
137   PROVIDE ( _end = _ebss );
138
139   /* User_heap_stack section, used to check that there is enough RAM left */
140   ._user_heap_stack :
141   {
142     . = ALIGN(4);
143     . = . + _Min_Heap_Size;
144     . = . + _Min_Stack_Size;
145     . = ALIGN(4);
146   } >RAM
147
148   /* MEMORY_bank1 section, code must be located here explicitly            */
149   /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
150   .memory_b1_text :
151   {
152     *(.mb1text)        /* .mb1text sections (code) */
153     *(.mb1text*)       /* .mb1text* sections (code)  */
154     *(.mb1rodata)      /* read-only data (constants) */
155     *(.mb1rodata*)
156   } >MEMORY_B1
157
158   /* Remove information from the standard libraries */
159   /DISCARD/ :
160   {
161     libc.a ( * )
162     libm.a ( * )
163     libgcc.a ( * )
164   }
165
166   .ARM.attributes 0 : { *(.ARM.attributes) }
167 }