1 /* Linker script for mbed LPC1768 */
3 /* Linker script to configure memory regions. */
6 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32K
7 RAM (rwx) : ORIGIN = 0x100000C0, LENGTH = 0x1F40
8 USB_RAM (rwx): ORIGIN = 0x20004000, LENGTH = 0x800
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
44 *(.text.Reset_Handler)
47 /* Only vectors and code running at reset are safe to be in first 512
48 bytes since RAM can be mapped into this area for RAM based interrupt
59 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
66 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
77 *(.ARM.extab* .gnu.linkonce.armextab.*)
83 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
97 PROVIDE (__preinit_array_start = .);
98 KEEP(*(.preinit_array))
99 PROVIDE (__preinit_array_end = .);
103 PROVIDE (__init_array_start = .);
104 KEEP(*(SORT(.init_array.*)))
106 PROVIDE (__init_array_end = .);
111 PROVIDE (__fini_array_start = .);
112 KEEP(*(SORT(.fini_array.*)))
114 PROVIDE (__fini_array_end = .);
138 /* .stack_dummy section doesn't contains any symbols. It is only
139 * used for linker to calculate size of stack sections, and assign
140 * values to stack symbols later */
146 /* Set stack top to end of RAM, and stack limit move down by
147 * size of stack_dummy section */
148 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
149 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
150 PROVIDE(__stack = __StackTop);
152 /* Check if data + heap + stack exceeds RAM limit */
153 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")