1 /* Linker script to configure memory regions. */
4 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
5 RAM (rwx) : ORIGIN = 0x200000EC, LENGTH = 20K - 0xEC
8 /* Linker script to place sections and symbol values. Should be used together
9 * with other linker script that defines memory regions FLASH and RAM.
10 * It references following symbols, which must be defined in code:
11 * Reset_Handler : Entry of reset handler
13 * It defines following symbols, which code can use without definition:
18 * __preinit_array_start
49 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
56 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
67 *(.ARM.extab* .gnu.linkonce.armextab.*)
73 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
89 PROVIDE_HIDDEN (__preinit_array_start = .);
90 KEEP(*(.preinit_array))
91 PROVIDE_HIDDEN (__preinit_array_end = .);
95 PROVIDE_HIDDEN (__init_array_start = .);
96 KEEP(*(SORT(.init_array.*)))
98 PROVIDE_HIDDEN (__init_array_end = .);
103 PROVIDE_HIDDEN (__fini_array_start = .);
104 KEEP(*(SORT(.fini_array.*)))
106 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 _estack = __StackTop;
148 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
149 PROVIDE(__stack = __StackTop);
151 /* Check if data + heap + stack exceeds RAM limit */
152 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")