1 /* Linker script to configure memory regions. */
4 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 48K
5 RAM (rwx) : ORIGIN = 0x100000C0, LENGTH = 0x1F40
6 USB_RAM (rwx): ORIGIN = 0x20004000, LENGTH = 0x800
9 /* Linker script to place sections and symbol values. Should be used together
10 * with other linker script that defines memory regions FLASH and RAM.
11 * It references following symbols, which must be defined in code:
12 * Reset_Handler : Entry of reset handler
14 * It defines following symbols, which code can use without definition:
19 * __preinit_array_start
42 *(.text.Reset_Handler)
44 /* Only vectors and code running at reset are safe to be in first 512
45 bytes since RAM can be mapped into this area for RAM based interrupt
56 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
63 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
74 *(.ARM.extab* .gnu.linkonce.armextab.*)
80 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
94 PROVIDE (__preinit_array_start = .);
95 KEEP(*(.preinit_array))
96 PROVIDE (__preinit_array_end = .);
100 PROVIDE (__init_array_start = .);
101 KEEP(*(SORT(.init_array.*)))
103 PROVIDE (__init_array_end = .);
108 PROVIDE (__fini_array_start = .);
109 KEEP(*(SORT(.fini_array.*)))
111 PROVIDE (__fini_array_end = .);
135 /* .stack_dummy section doesn't contains any symbols. It is only
136 * used for linker to calculate size of stack sections, and assign
137 * values to stack symbols later */
143 /* Set stack top to end of RAM, and stack limit move down by
144 * size of stack_dummy section */
145 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
146 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
147 PROVIDE(__stack = __StackTop);
149 /* Check if data + heap + stack exceeds RAM limit */
150 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")