1 /* Default memory layout. */
\r
4 ROM (rx) : ORIGIN = 0x00, LENGTH = 0x80000
\r
5 RAM (rw) : ORIGIN = 0x20000000, LENGTH = 0x8000
\r
8 /* Variables required by FreeRTOS MPU. */
\r
9 _Privileged_Functions_Region_Size = 16K;
\r
10 _Privileged_Data_Region_Size = 256;
\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
24 /* Variables used by FreeRTOS-MPU. */
\r
25 _Privileged_Functions_Region_Size = 16K;
\r
26 _Privileged_Data_Region_Size = 256;
\r
28 __FLASH_segment_start__ = ORIGIN( ROM );
\r
29 __FLASH_segment_end__ = __FLASH_segment_start__ + LENGTH( ROM );
\r
31 __privileged_functions_start__ = ORIGIN( ROM );
\r
32 __privileged_functions_end__ = __privileged_functions_start__ + _Privileged_Functions_Region_Size;
\r
34 __SRAM_segment_start__ = ORIGIN( RAM );
\r
35 __SRAM_segment_end__ = __SRAM_segment_start__ + LENGTH( RAM );
\r
37 __privileged_data_start__ = ORIGIN( RAM );
\r
38 __privileged_data_end__ = ORIGIN( RAM ) + _Privileged_Data_Region_Size;
\r
42 * The '__stack' definition is required by crt0, do not remove it.
\r
44 /* Place top of stack immediate before ROM Log
\r
45 *__stack = ORIGIN(RAM) + LENGTH(RAM);
\r
47 __stack = ORIGIN(RAM) + LENGTH(RAM);
\r
52 * Default stack sizes.
\r
53 * These are used by the startup in order to allocate stacks
\r
54 * for the different modes.
\r
57 __Main_Stack_Size = 2048 ;
\r
59 PROVIDE ( _Main_Stack_Size = __Main_Stack_Size ) ;
\r
61 __Main_Stack_Limit = __stack - __Main_Stack_Size ;
\r
63 /*"PROVIDE" allows to easily override these values from an object file or the command line. */
\r
64 PROVIDE ( _Main_Stack_Limit = __Main_Stack_Limit ) ;
\r
67 * There will be a link error if there is not this amount of
\r
68 * RAM free at the end.
\r
70 _Minimum_Stack_Size = 256 ;
\r
73 * Default heap definitions.
\r
74 * The heap start immediately after the last statically allocated
\r
75 * .sbss/.noinit section, and extends up to the main stack limit.
\r
77 PROVIDE ( _Heap_Begin = _end_noinit ) ;
\r
78 PROVIDE ( _Heap_Limit = __stack - __Main_Stack_Size ) ;
\r
81 * The entry point is informative, for debuggers and simulators,
\r
82 * since the Cortex-M vector points to it anyway.
\r
86 /* Sections Definitions */
\r
91 * For Cortex-M devices, the beginning of the startup code is stored in
\r
92 * the .isr_vector section, which goes to ROM
\r
94 privileged_functions :
\r
98 KEEP(*(.isr_vector))
\r
99 *(privileged_functions)
\r
107 /* Non privileged code kept out of the first 16K or flash. */
\r
108 . = __privileged_functions_start__ + _Privileged_Functions_Region_Size;
\r
114 * This section is here for convenience, to store the
\r
115 * startup code at the beginning of the flash area, hoping that
\r
116 * this will increase the readability of the listing.
\r
118 KEEP(*(.after_vectors .after_vectors.*)) /* Startup code and ISR */
\r
123 * These are the old initialisation sections, intended to contain
\r
124 * naked code, with the prologue/epilogue added by crti.o/crtn.o
\r
125 * when linking with startup files. The standalone startup code
\r
126 * currently does not run these, better use the init arrays below.
\r
134 * The preinit code, i.e. an array of pointers to initialisation
\r
135 * functions to be performed before constructors.
\r
137 PROVIDE_HIDDEN (__preinit_array_start = .);
\r
140 * Used to run the SystemInit() before anything else.
\r
142 KEEP(*(.preinit_array_sysinit .preinit_array_sysinit.*))
\r
145 * Used for other platform inits.
\r
147 KEEP(*(.preinit_array_platform .preinit_array_platform.*))
\r
150 * The application inits. If you need to enforce some order in
\r
151 * execution, create new sections, as before.
\r
153 KEEP(*(.preinit_array .preinit_array.*))
\r
155 PROVIDE_HIDDEN (__preinit_array_end = .);
\r
160 * The init code, i.e. an array of pointers to static constructors.
\r
162 PROVIDE_HIDDEN (__init_array_start = .);
\r
163 KEEP(*(SORT(.init_array.*)))
\r
164 KEEP(*(.init_array))
\r
165 PROVIDE_HIDDEN (__init_array_end = .);
\r
170 * The fini code, i.e. an array of pointers to static destructors.
\r
172 PROVIDE_HIDDEN (__fini_array_start = .);
\r
173 KEEP(*(SORT(.fini_array.*)))
\r
174 KEEP(*(.fini_array))
\r
175 PROVIDE_HIDDEN (__fini_array_end = .);
\r
180 *(.text*) /* all remaining code */
\r
182 *(vtable) /* C++ virtual tables */
\r
188 *(.rodata*) /* read-only data (constants) */
\r
193 KEEP(*(.eh_frame*))
\r
196 * Stub sections generated by the linker, to glue together
\r
197 * ARM and Thumb code. .glue_7 is used for ARM code calling
\r
198 * Thumb code, and .glue_7t is used for Thumb code calling
\r
199 * ARM code. Apparently always generated by the linker, for some
\r
200 * architectures, so better leave them here.
\r
206 /* ARM magic sections */
\r
209 *(.ARM.extab* .gnu.linkonce.armextab.*)
\r
215 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
\r
224 * This address is used by the startup code to
\r
225 * initialise the .data section.
\r
233 *(.ROarraySection .ROarraySection.*)
\r
241 /* Non kernel data is kept out of the first 256 bytes of SRAM. */
\r
244 . = ORIGIN( RAM ) + _Privileged_Data_Region_Size;
\r
247 * The initialised data section.
\r
248 * The program executes knowing that the data is in the RAM
\r
249 * but the loader puts the initial values in the ROM (inidata).
\r
250 * It is one task of the startup to copy the initial values from
\r
253 .data : AT ( _sidata )
\r
257 /* This is used by the startup code to initialise the .data section */
\r
258 _sdata = . ; /* STM specific definition */
\r
259 __data_start__ = . ;
\r
260 *(.data_begin .data_begin.*)
\r
264 *(.data_end .data_end.*)
\r
267 /* This is used by the startup code to initialise the .data section */
\r
268 _edata = . ; /* STM specific definition */
\r
275 * The uninitialised data section. NOLOAD is used to avoid
\r
276 * the "section `.bss' type changed to PROGBITS" warning
\r
281 __bss_start__ = .; /* standard newlib definition */
\r
282 _sbss = .; /* STM specific definition */
\r
283 *(.bss_begin .bss_begin.*)
\r
288 *(.bss_end .bss_end.*)
\r
290 __bss_end__ = .; /* standard newlib definition */
\r
291 _ebss = . ; /* STM specific definition */
\r
299 *(.noinit .noinit.*)
\r
305 /* Mandatory to be word aligned, _sbrk assumes this */
\r
306 PROVIDE ( end = _end_noinit ); /* was _ebss */
\r
307 PROVIDE ( _end = _end_noinit );
\r
308 PROVIDE ( __end = _end_noinit );
\r
309 PROVIDE ( __end__ = _end_noinit );
\r
310 PROVIDE ( ROM_DATA_START = __data_start__ );
\r
313 * Used for validation only, do not allocate anything here!
\r
315 * This is just to check that there is enough RAM left for the Main
\r
316 * stack. It should generate an error if it's full.
\r
322 . = . + _Minimum_Stack_Size ;
\r
331 /* . = . + __ROM_Log_Size ; */
\r
337 .bss_CCMRAM : ALIGN(4)
\r
339 *(.bss.CCMRAM .bss.CCMRAM.*)
\r
344 * The C or assembly source must explicitly place the code
\r
345 * or data there using the "section" attribute.
\r
349 /* remaining code */
\r
350 /* read-only data (constants) */
\r
361 * The C or assembly source must explicitly place the code or data there
\r
362 * using the "section" attribute.
\r
402 /* After that there are only debugging sections. */
\r
404 /* This can remove the debugging information from the standard libraries */
\r
414 /* Stabs debugging sections. */
\r
415 .stab 0 : { *(.stab) }
\r
416 .stabstr 0 : { *(.stabstr) }
\r
417 .stab.excl 0 : { *(.stab.excl) }
\r
418 .stab.exclstr 0 : { *(.stab.exclstr) }
\r
419 .stab.index 0 : { *(.stab.index) }
\r
420 .stab.indexstr 0 : { *(.stab.indexstr) }
\r
421 .comment 0 : { *(.comment) }
\r
423 * DWARF debug sections.
\r
424 * Symbols in the DWARF debugging sections are relative to the beginning
\r
425 * of the section so we begin them at 0.
\r
428 .debug 0 : { *(.debug) }
\r
429 .line 0 : { *(.line) }
\r
430 /* GNU DWARF 1 extensions */
\r
431 .debug_srcinfo 0 : { *(.debug_srcinfo) }
\r
432 .debug_sfnames 0 : { *(.debug_sfnames) }
\r
433 /* DWARF 1.1 and DWARF 2 */
\r
434 .debug_aranges 0 : { *(.debug_aranges) }
\r
435 .debug_pubnames 0 : { *(.debug_pubnames) }
\r
437 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
\r
438 .debug_abbrev 0 : { *(.debug_abbrev) }
\r
439 .debug_line 0 : { *(.debug_line) }
\r
440 .debug_frame 0 : { *(.debug_frame) }
\r
441 .debug_str 0 : { *(.debug_str) }
\r
442 .debug_loc 0 : { *(.debug_loc) }
\r
443 .debug_macinfo 0 : { *(.debug_macinfo) }
\r
444 /* SGI/MIPS DWARF 2 extensions */
\r
445 .debug_weaknames 0 : { *(.debug_weaknames) }
\r
446 .debug_funcnames 0 : { *(.debug_funcnames) }
\r
447 .debug_typenames 0 : { *(.debug_typenames) }
\r
448 .debug_varnames 0 : { *(.debug_varnames) }
\r