1 /* Linker script for STM32F407 */
3 /* Linker script to configure memory regions. */
6 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
7 CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
8 RAM (rwx) : ORIGIN = 0x20000188, LENGTH = 0x1FE78
11 /* Linker script to place sections and symbol values. Should be used together
12 * with other linker script that defines memory regions FLASH and RAM.
13 * It references following symbols, which must be defined in code:
14 * Reset_Handler : Entry of reset handler
16 * It defines following symbols, which code can use without definition:
21 * __preinit_array_start
52 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
59 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
70 *(.ARM.extab* .gnu.linkonce.armextab.*)
76 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
90 PROVIDE_HIDDEN (__preinit_array_start = .);
91 KEEP(*(.preinit_array))
92 PROVIDE_HIDDEN (__preinit_array_end = .);
96 PROVIDE_HIDDEN (__init_array_start = .);
97 KEEP(*(SORT(.init_array.*)))
99 PROVIDE_HIDDEN (__init_array_end = .);
104 PROVIDE_HIDDEN (__fini_array_start = .);
105 KEEP(*(SORT(.fini_array.*)))
107 PROVIDE_HIDDEN (__fini_array_end = .);
134 /* .stack_dummy section doesn't contains any symbols. It is only
135 * used for linker to calculate size of stack sections, and assign
136 * values to stack symbols later */
142 /* Set stack top to end of RAM, and stack limit move down by
143 * size of stack_dummy section */
144 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
145 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
146 PROVIDE(__stack = __StackTop);
148 /* Check if data + heap + stack exceeds RAM limit */
149 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")