1 /* Linker script to configure memory regions. */
4 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 128K
5 RAM (rwx) : ORIGIN = 0x100000C0, LENGTH = 0x1F40
6 RAMIO (rwx) : ORIGIN = 0x20000000, LENGTH = 0x800
7 USB_RAM (rwx): ORIGIN = 0x20004000, LENGTH = 0x800
10 /* Linker script to place sections and symbol values. Should be used together
11 * with other linker script that defines memory regions FLASH and RAM.
12 * It references following symbols, which must be defined in code:
13 * Reset_Handler : Entry of reset handler
15 * It defines following symbols, which code can use without definition:
20 * __preinit_array_start
43 *(.text.Reset_Handler)
45 /* Only vectors and code running at reset are safe to be in first 512
46 bytes since RAM can be mapped into this area for RAM based interrupt
57 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
64 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
75 *(.ARM.extab* .gnu.linkonce.armextab.*)
81 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
95 PROVIDE (__preinit_array_start = .);
96 KEEP(*(.preinit_array))
97 PROVIDE (__preinit_array_end = .);
101 PROVIDE (__init_array_start = .);
102 KEEP(*(SORT(.init_array.*)))
104 PROVIDE (__init_array_end = .);
109 PROVIDE (__fini_array_start = .);
110 KEEP(*(SORT(.fini_array.*)))
112 PROVIDE (__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")