1 /* Default memory layout. */
\r
4 ROM (rx) : ORIGIN = 0x00, LENGTH = 0x80000
\r
5 RAM (rw) : ORIGIN = 0x20000000, LENGTH = 0x8000
\r
8 /* Variables used by FreeRTOS-MPU. */
\r
9 _Privileged_Functions_Region_Size = 32K;
\r
10 _Privileged_Data_Region_Size = 512;
\r
12 __FLASH_segment_start__ = ORIGIN( ROM );
\r
13 __FLASH_segment_end__ = __FLASH_segment_start__ + LENGTH( ROM );
\r
15 __privileged_functions_start__ = ORIGIN( ROM );
\r
16 __privileged_functions_end__ = __privileged_functions_start__ + _Privileged_Functions_Region_Size;
\r
18 __SRAM_segment_start__ = ORIGIN( RAM );
\r
19 __SRAM_segment_end__ = __SRAM_segment_start__ + LENGTH( RAM );
\r
21 __privileged_data_start__ = ORIGIN( RAM );
\r
22 __privileged_data_end__ = ORIGIN( RAM ) + _Privileged_Data_Region_Size;
\r
26 * The '__stack' definition is required by crt0, do not remove it.
\r
28 __stack = ORIGIN(RAM) + LENGTH(RAM);
\r
32 * Default stack sizes.
\r
33 * These are used by the startup in order to allocate stacks
\r
34 * for the different modes.
\r
37 __Main_Stack_Size = 2048 ;
\r
39 PROVIDE ( _Main_Stack_Size = __Main_Stack_Size ) ;
\r
41 __Main_Stack_Limit = __stack - __Main_Stack_Size ;
\r
43 /*"PROVIDE" allows to easily override these values from an object file or the command line. */
\r
44 PROVIDE ( _Main_Stack_Limit = __Main_Stack_Limit ) ;
\r
47 * There will be a link error if there is not this amount of
\r
48 * RAM free at the end.
\r
50 _Minimum_Stack_Size = 1024 ;
\r
53 * Default heap definitions.
\r
54 * The heap start immediately after the last statically allocated
\r
55 * .sbss/.noinit section, and extends up to the main stack limit.
\r
57 PROVIDE ( _Heap_Begin = _end_noinit ) ;
\r
58 PROVIDE ( _Heap_Limit = __stack - __Main_Stack_Size ) ;
\r
61 * The entry point is informative, for debuggers and simulators,
\r
62 * since the Cortex-M vector points to it anyway.
\r
66 /* Sections Definitions */
\r
71 * For Cortex-M devices, the beginning of the startup code is stored in
\r
72 * the .isr_vector section, which goes to ROM
\r
74 privileged_functions :
\r
78 KEEP(*(.isr_vector))
\r
79 *(privileged_functions)
\r
82 /* Non privileged code is after _Privileged_Functions_Region_Size. */
\r
83 __privileged_functions_actual_end__ = .;
\r
84 . = _Privileged_Functions_Region_Size;
\r
95 * This section is here for convenience, to store the
\r
96 * startup code at the beginning of the flash area, hoping that
\r
97 * this will increase the readability of the listing.
\r
99 KEEP(*(.after_vectors .after_vectors.*)) /* Startup code and ISR */
\r
104 * These are the old initialisation sections, intended to contain
\r
105 * naked code, with the prologue/epilogue added by crti.o/crtn.o
\r
106 * when linking with startup files. The standalone startup code
\r
107 * currently does not run these, better use the init arrays below.
\r
115 * The preinit code, i.e. an array of pointers to initialisation
\r
116 * functions to be performed before constructors.
\r
118 PROVIDE_HIDDEN (__preinit_array_start = .);
\r
121 * Used to run the SystemInit() before anything else.
\r
123 KEEP(*(.preinit_array_sysinit .preinit_array_sysinit.*))
\r
126 * Used for other platform inits.
\r
128 KEEP(*(.preinit_array_platform .preinit_array_platform.*))
\r
131 * The application inits. If you need to enforce some order in
\r
132 * execution, create new sections, as before.
\r
134 KEEP(*(.preinit_array .preinit_array.*))
\r
136 PROVIDE_HIDDEN (__preinit_array_end = .);
\r
141 * The init code, i.e. an array of pointers to static constructors.
\r
143 PROVIDE_HIDDEN (__init_array_start = .);
\r
144 KEEP(*(SORT(.init_array.*)))
\r
145 KEEP(*(.init_array))
\r
146 PROVIDE_HIDDEN (__init_array_end = .);
\r
151 * The fini code, i.e. an array of pointers to static destructors.
\r
153 PROVIDE_HIDDEN (__fini_array_start = .);
\r
154 KEEP(*(SORT(.fini_array.*)))
\r
155 KEEP(*(.fini_array))
\r
156 PROVIDE_HIDDEN (__fini_array_end = .);
\r
161 *(.text*) /* all remaining code */
\r
163 *(vtable) /* C++ virtual tables */
\r
169 *(.rodata*) /* read-only data (constants) */
\r
174 KEEP(*(.eh_frame*))
\r
177 * Stub sections generated by the linker, to glue together
\r
178 * ARM and Thumb code. .glue_7 is used for ARM code calling
\r
179 * Thumb code, and .glue_7t is used for Thumb code calling
\r
180 * ARM code. Apparently always generated by the linker, for some
\r
181 * architectures, so better leave them here.
\r
187 /* ARM magic sections */
\r
190 *(.ARM.extab* .gnu.linkonce.armextab.*)
\r
196 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
\r
205 * This address is used by the startup code to
\r
206 * initialise the .data section.
\r
214 *(.ROarraySection .ROarraySection.*)
\r
222 /* Non kernel data is kept out of the first _Privileged_Data_Region_Size
\r
224 __privileged_data_actual_end__ = .;
\r
225 . = _Privileged_Data_Region_Size;
\r
229 * The initialised data section.
\r
230 * The program executes knowing that the data is in the RAM
\r
231 * but the loader puts the initial values in the ROM (inidata).
\r
232 * It is one task of the startup to copy the initial values from
\r
235 .data : AT ( _sidata )
\r
239 /* This is used by the startup code to initialise the .data section */
\r
240 _sdata = . ; /* STM specific definition */
\r
241 __data_start__ = . ;
\r
242 *(.data_begin .data_begin.*)
\r
246 *(.data_end .data_end.*)
\r
249 /* This is used by the startup code to initialise the .data section */
\r
250 _edata = . ; /* STM specific definition */
\r
257 * The uninitialised data section. NOLOAD is used to avoid
\r
258 * the "section `.bss' type changed to PROGBITS" warning
\r
263 __bss_start__ = .; /* standard newlib definition */
\r
264 _sbss = .; /* STM specific definition */
\r
265 *(.bss_begin .bss_begin.*)
\r
270 *(.bss_end .bss_end.*)
\r
272 __bss_end__ = .; /* standard newlib definition */
\r
273 _ebss = . ; /* STM specific definition */
\r
281 *(.noinit .noinit.*)
\r
287 /* Mandatory to be word aligned, _sbrk assumes this */
\r
288 PROVIDE ( end = _end_noinit ); /* was _ebss */
\r
289 PROVIDE ( _end = _end_noinit );
\r
290 PROVIDE ( __end = _end_noinit );
\r
291 PROVIDE ( __end__ = _end_noinit );
\r
292 PROVIDE ( ROM_DATA_START = __data_start__ );
\r
295 * Used for validation only, do not allocate anything here!
\r
297 * This is just to check that there is enough RAM left for the Main
\r
298 * stack. It should generate an error if it's full.
\r
304 . = . + _Minimum_Stack_Size ;
\r
309 /* After that there are only debugging sections. */
\r
311 /* This can remove the debugging information from the standard libraries */
\r
321 /* Stabs debugging sections. */
\r
322 .stab 0 : { *(.stab) }
\r
323 .stabstr 0 : { *(.stabstr) }
\r
324 .stab.excl 0 : { *(.stab.excl) }
\r
325 .stab.exclstr 0 : { *(.stab.exclstr) }
\r
326 .stab.index 0 : { *(.stab.index) }
\r
327 .stab.indexstr 0 : { *(.stab.indexstr) }
\r
328 .comment 0 : { *(.comment) }
\r
330 * DWARF debug sections.
\r
331 * Symbols in the DWARF debugging sections are relative to the beginning
\r
332 * of the section so we begin them at 0.
\r
335 .debug 0 : { *(.debug) }
\r
336 .line 0 : { *(.line) }
\r
337 /* GNU DWARF 1 extensions */
\r
338 .debug_srcinfo 0 : { *(.debug_srcinfo) }
\r
339 .debug_sfnames 0 : { *(.debug_sfnames) }
\r
340 /* DWARF 1.1 and DWARF 2 */
\r
341 .debug_aranges 0 : { *(.debug_aranges) }
\r
342 .debug_pubnames 0 : { *(.debug_pubnames) }
\r
344 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
\r
345 .debug_abbrev 0 : { *(.debug_abbrev) }
\r
346 .debug_line 0 : { *(.debug_line) }
\r
347 .debug_frame 0 : { *(.debug_frame) }
\r
348 .debug_str 0 : { *(.debug_str) }
\r
349 .debug_loc 0 : { *(.debug_loc) }
\r
350 .debug_macinfo 0 : { *(.debug_macinfo) }
\r
351 /* SGI/MIPS DWARF 2 extensions */
\r
352 .debug_weaknames 0 : { *(.debug_weaknames) }
\r
353 .debug_funcnames 0 : { *(.debug_funcnames) }
\r
354 .debug_typenames 0 : { *(.debug_typenames) }
\r
355 .debug_varnames 0 : { *(.debug_varnames) }
\r