1 /* Linker script for STM32F411 */
3 /* Linker script to configure memory regions. */
6 /* First 64kB of flash reserved for bootloader */
7 /* Other 448kB for application */
8 FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 448K
9 /* CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K */
10 RAM (rwx) : ORIGIN = 0x20000198, LENGTH = 128k - 0x198
13 /* Linker script to place sections and symbol values. Should be used together
14 * with other linker script that defines memory regions FLASH and RAM.
15 * It references following symbols, which must be defined in code:
16 * Reset_Handler : Entry of reset handler
18 * It defines following symbols, which code can use without definition:
23 * __preinit_array_start
54 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
61 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
72 *(.ARM.extab* .gnu.linkonce.armextab.*)
78 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
92 PROVIDE_HIDDEN (__preinit_array_start = .);
93 KEEP(*(.preinit_array))
94 PROVIDE_HIDDEN (__preinit_array_end = .);
98 PROVIDE_HIDDEN (__init_array_start = .);
99 KEEP(*(SORT(.init_array.*)))
101 PROVIDE_HIDDEN (__init_array_end = .);
106 PROVIDE_HIDDEN (__fini_array_start = .);
107 KEEP(*(SORT(.fini_array.*)))
109 PROVIDE_HIDDEN (__fini_array_end = .);
136 /* .stack_dummy section doesn't contains any symbols. It is only
137 * used for linker to calculate size of stack sections, and assign
138 * values to stack symbols later */
144 /* Set stack top to end of RAM, and stack limit move down by
145 * size of stack_dummy section */
146 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
147 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
148 PROVIDE(__stack = __StackTop);
150 /* Check if data + heap + stack exceeds RAM limit */
151 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")