]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_MPU_STM32L4_Discovery_Keil_STM32Cube/Projects/STM32Cube/STM32L475VGTX_FLASH.ld
Make vSetupTimerInterrupt weak in the RVDS M4 MPU port to give the
[freertos] / FreeRTOS / Demo / CORTEX_MPU_STM32L4_Discovery_Keil_STM32Cube / Projects / STM32Cube / STM32L475VGTX_FLASH.ld
1 /*
2 ******************************************************************************
3 **
4 **  File        : LinkerScript.ld
5 **
6 **  Author              : Auto-generated by STM32CubeIDE
7 **
8 **  Abstract    : Linker script for B-L475E-IOT01A1 Board embedding STM32L475VGTx Device from STM32L4 series
9 **                      1024Kbytes FLASH
10 **                      96Kbytes RAM
11 **                      32Kbytes RAM2
12 **
13 **                Set heap size, stack size and stack location according
14 **                to application requirements.
15 **
16 **                Set memory bank area and size if external memory is used.
17 **
18 **  Target      : STMicroelectronics STM32
19 **
20 **  Distribution: The file is distributed as is without any warranty
21 **                of any kind.
22 **
23 *****************************************************************************
24 ** @attention
25 **
26 ** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
27 **
28 ** Redistribution and use in source and binary forms, with or without modification,
29 ** are permitted provided that the following conditions are met:
30 **   1. Redistributions of source code must retain the above copyright notice,
31 **      this list of conditions and the following disclaimer.
32 **   2. Redistributions in binary form must reproduce the above copyright notice,
33 **      this list of conditions and the following disclaimer in the documentation
34 **      and/or other materials provided with the distribution.
35 **   3. Neither the name of STMicroelectronics nor the names of its contributors
36 **      may be used to endorse or promote products derived from this software
37 **      without specific prior written permission.
38 **
39 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
40 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
43 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
45 ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
46 ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47 ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 **
50 *****************************************************************************
51 */
52
53 /* Entry Point */
54 ENTRY(Reset_Handler)
55
56 /* Highest address of the user mode stack */
57 _estack = ORIGIN(RAM) + LENGTH(RAM);    /* end of "RAM" Ram type memory */
58
59 _Min_Heap_Size = 0x200 ;        /* required amount of heap  */
60 _Min_Stack_Size = 0x400 ;       /* required amount of stack */
61
62 /* Memories definition */
63 MEMORY
64 {
65   RAM   (xrw)   : ORIGIN = 0x20000000,  LENGTH = 96K
66   RAM2  (xrw)   : ORIGIN = 0x10000000,  LENGTH = 32K
67   FLASH (rx)    : ORIGIN = 0x8000000,   LENGTH = 1024K
68 }
69
70 /* Initial 32K Flash is used to store kernel functions and
71  * initial 512 bytes of RAM is used to store kernel data. */
72 __privileged_functions_region_size__  = 32K;
73 __privileged_data_region_size__       = 512;
74
75 __FLASH_segment_start__               = ORIGIN( FLASH );
76 __FLASH_segment_end__                 = __FLASH_segment_start__ + LENGTH( FLASH );
77
78 __SRAM_segment_start__                = ORIGIN( RAM );
79 __SRAM_segment_end__                  = __SRAM_segment_start__ + LENGTH( RAM );
80
81 __privileged_functions_start__        = __FLASH_segment_start__;
82 __privileged_functions_end__          = __FLASH_segment_start__ + __privileged_functions_region_size__;
83
84 __privileged_data_start__             = __SRAM_segment_start__;
85 __privileged_data_end__               = __SRAM_segment_start__ + __privileged_data_region_size__;
86
87 /* Sections */
88 SECTIONS
89 {
90   /* The startup code and FreeRTOS kernel code are placed into privileged
91    * flash. */
92   .privileged_functions :
93   {
94     . = ALIGN(4);
95     KEEP(*(.isr_vector)) /* Startup code. */
96     . = ALIGN(4);
97     *(privileged_functions)
98     . = ALIGN(4);
99     FILL(0xDEAD);
100     /* Ensure that non-privileged code is placed after the region reserved for
101      * privileged kernel code. */
102     /* Note that dot (.) actually refers to the byte offset from the start of
103      * the current section (.privileged_functions in this case). As a result,
104      * setting dot (.) to a value sets the size of the section. */
105     . = __privileged_functions_region_size__;
106   } >FLASH
107
108   /* The program code and other data into "FLASH" Rom type memory */
109   .text :
110   {
111     /* Place the FreeRTOS System Calls first in the unprivileged region. */
112     . = ALIGN(4);
113     __syscalls_flash_start__ = .;
114     *(freertos_system_calls)
115     __syscalls_flash_end__ = .;
116     . = ALIGN(4);
117     *(.text)           /* .text sections (code) */
118     *(.text*)          /* .text* sections (code) */
119     *(.glue_7)         /* glue arm to thumb code */
120     *(.glue_7t)        /* glue thumb to arm code */
121     *(.eh_frame)
122
123     KEEP (*(.init))
124     KEEP (*(.fini))
125
126     . = ALIGN(4);
127     _etext = .;        /* define a global symbols at end of code */
128   } >FLASH
129
130   /* Constant data into "FLASH" Rom type memory */
131   .rodata :
132   {
133     . = ALIGN(4);
134     *(.rodata)         /* .rodata sections (constants, strings, etc.) */
135     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
136     . = ALIGN(4);
137   } >FLASH
138
139   .ARM.extab   : {
140     . = ALIGN(4);
141     *(.ARM.extab* .gnu.linkonce.armextab.*)
142     . = ALIGN(4);
143   } >FLASH
144
145   .ARM : {
146     . = ALIGN(4);
147     __exidx_start = .;
148     *(.ARM.exidx*)
149     __exidx_end = .;
150     . = ALIGN(4);
151   } >FLASH
152
153   .preinit_array     :
154   {
155     . = ALIGN(4);
156     PROVIDE_HIDDEN (__preinit_array_start = .);
157     KEEP (*(.preinit_array*))
158     PROVIDE_HIDDEN (__preinit_array_end = .);
159     . = ALIGN(4);
160   } >FLASH
161
162   .init_array :
163   {
164     . = ALIGN(4);
165     PROVIDE_HIDDEN (__init_array_start = .);
166     KEEP (*(SORT(.init_array.*)))
167     KEEP (*(.init_array*))
168     PROVIDE_HIDDEN (__init_array_end = .);
169     . = ALIGN(4);
170   } >FLASH
171
172   .fini_array :
173   {
174     . = ALIGN(4);
175     PROVIDE_HIDDEN (__fini_array_start = .);
176     KEEP (*(SORT(.fini_array.*)))
177     KEEP (*(.fini_array*))
178     PROVIDE_HIDDEN (__fini_array_end = .);
179     . = ALIGN(4);
180   } >FLASH
181
182   /* Used by the startup to initialize data */
183   _sidata = LOADADDR(.privileged_data);
184
185   /* FreeRTOS kernel data. */
186   .privileged_data :
187   {
188     . = ALIGN(4);
189     _sdata = .;        /* Create a global symbol at data start. */
190     *(privileged_data)
191     . = ALIGN(4);
192     FILL(0xDEAD);
193     /* Ensure that non-privileged data is placed after the region reserved for
194      * privileged kernel data. */
195     /* Note that dot (.) actually refers to the byte offset from the start of
196      * the current section (.privileged_data in this case). As a result, setting
197      * dot (.) to a value sets the size of the section. */
198     . = __privileged_data_region_size__;
199   } >RAM AT> FLASH
200
201   /* Initialized data sections into "RAM" Ram type memory */
202   .data :
203   {
204     . = ALIGN(4);
205     *(.data)           /* .data sections */
206     *(.data*)          /* .data* sections */
207
208     . = ALIGN(4);
209     _edata = .;        /* define a global symbol at data end */
210
211   } >RAM AT> FLASH
212
213   /* Uninitialized data section into "RAM" Ram type memory */
214   . = ALIGN(4);
215   .bss :
216   {
217     /* This is used by the startup in order to initialize the .bss section */
218     _sbss = .;         /* define a global symbol at bss start */
219     __bss_start__ = _sbss;
220     *(.bss)
221     *(.bss*)
222     *(COMMON)
223
224     . = ALIGN(4);
225     _ebss = .;         /* define a global symbol at bss end */
226     __bss_end__ = _ebss;
227   } >RAM
228
229   /* User_heap_stack section, used to check that there is enough "RAM" Ram  type memory left */
230   ._user_heap_stack :
231   {
232     . = ALIGN(8);
233     PROVIDE ( end = . );
234     PROVIDE ( _end = . );
235     . = . + _Min_Heap_Size;
236     . = . + _Min_Stack_Size;
237     . = ALIGN(8);
238   } >RAM
239
240   /* Remove information from the compiler libraries */
241   /DISCARD/ :
242   {
243     libc.a ( * )
244     libm.a ( * )
245     libgcc.a ( * )
246   }
247
248   .ARM.attributes 0 : { *(.ARM.attributes) }
249 }