Skip to content

Commit 0843613

Browse files
committed
Add LPC11U24/301 TARGET
1 parent d6c658e commit 0843613

File tree

3 files changed

+165
-1
lines changed

3 files changed

+165
-1
lines changed
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/* Linker script for mbed LPC1768 */
2+
3+
/* Linker script to configure memory regions. */
4+
MEMORY
5+
{
6+
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32K
7+
RAM (rwx) : ORIGIN = 0x100000C0, LENGTH = 0x1740
8+
USB_RAM (rwx): ORIGIN = 0x20004000, LENGTH = 0x800
9+
}
10+
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
15+
*
16+
* It defines following symbols, which code can use without definition:
17+
* __exidx_start
18+
* __exidx_end
19+
* __etext
20+
* __data_start__
21+
* __preinit_array_start
22+
* __preinit_array_end
23+
* __init_array_start
24+
* __init_array_end
25+
* __fini_array_start
26+
* __fini_array_end
27+
* __data_end__
28+
* __bss_start__
29+
* __bss_end__
30+
* __end__
31+
* end
32+
* __HeapLimit
33+
* __StackLimit
34+
* __StackTop
35+
* __stack
36+
*/
37+
ENTRY(Reset_Handler)
38+
39+
SECTIONS
40+
{
41+
.text :
42+
{
43+
KEEP(*(.isr_vector))
44+
*(.text.Reset_Handler)
45+
*(.text.SystemInit)
46+
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
49+
vectors. */
50+
. = 0x00000200;
51+
*(.text*)
52+
53+
KEEP(*(.init))
54+
KEEP(*(.fini))
55+
56+
/* .ctors */
57+
*crtbegin.o(.ctors)
58+
*crtbegin?.o(.ctors)
59+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
60+
*(SORT(.ctors.*))
61+
*(.ctors)
62+
63+
/* .dtors */
64+
*crtbegin.o(.dtors)
65+
*crtbegin?.o(.dtors)
66+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
67+
*(SORT(.dtors.*))
68+
*(.dtors)
69+
70+
*(.rodata*)
71+
72+
KEEP(*(.eh_frame*))
73+
} > FLASH
74+
75+
.ARM.extab :
76+
{
77+
*(.ARM.extab* .gnu.linkonce.armextab.*)
78+
} > FLASH
79+
80+
__exidx_start = .;
81+
.ARM.exidx :
82+
{
83+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
84+
} > FLASH
85+
__exidx_end = .;
86+
87+
__etext = .;
88+
89+
.data : AT (__etext)
90+
{
91+
__data_start__ = .;
92+
*(vtable)
93+
*(.data*)
94+
95+
. = ALIGN(4);
96+
/* preinit data */
97+
PROVIDE (__preinit_array_start = .);
98+
KEEP(*(.preinit_array))
99+
PROVIDE (__preinit_array_end = .);
100+
101+
. = ALIGN(4);
102+
/* init data */
103+
PROVIDE (__init_array_start = .);
104+
KEEP(*(SORT(.init_array.*)))
105+
KEEP(*(.init_array))
106+
PROVIDE (__init_array_end = .);
107+
108+
109+
. = ALIGN(4);
110+
/* finit data */
111+
PROVIDE (__fini_array_start = .);
112+
KEEP(*(SORT(.fini_array.*)))
113+
KEEP(*(.fini_array))
114+
PROVIDE (__fini_array_end = .);
115+
116+
. = ALIGN(4);
117+
/* All data end */
118+
__data_end__ = .;
119+
120+
} > RAM
121+
122+
.bss :
123+
{
124+
__bss_start__ = .;
125+
*(.bss*)
126+
*(COMMON)
127+
__bss_end__ = .;
128+
} > RAM
129+
130+
.heap :
131+
{
132+
__end__ = .;
133+
end = __end__;
134+
*(.heap*)
135+
__HeapLimit = .;
136+
} > RAM
137+
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 */
141+
.stack_dummy :
142+
{
143+
*(.stack)
144+
} > RAM
145+
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);
151+
152+
/* Check if data + heap + stack exceeds RAM limit */
153+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
154+
}

libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/LPC11U24.ld renamed to libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U24_401/LPC11U24.ld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,3 @@ SECTIONS
152152
/* Check if data + heap + stack exceeds RAM limit */
153153
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
154154
}
155-

workspace_tools/targets.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ def __init__(self):
8080
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
8181

8282

83+
class LPC11U24_301(Target):
84+
def __init__(self):
85+
Target.__init__(self)
86+
87+
self.core = "Cortex-M0"
88+
89+
self.extra_labels = ['NXP', 'LPC11UXX']
90+
91+
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
92+
93+
8394
class KL05Z(Target):
8495
def __init__(self):
8596
Target.__init__(self)

0 commit comments

Comments
 (0)