Skip to content

Commit 9a27099

Browse files
committed
Added support for LPC11U35_401 in ARM and GCC_ARM
1 parent 1c23d68 commit 9a27099

File tree

3 files changed

+180
-1
lines changed
  • libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX
  • workspace_tools

3 files changed

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

workspace_tools/targets.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ def __init__(self):
228228

229229
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
230230

231+
class LPC11U35_401(Target):
232+
def __init__(self):
233+
Target.__init__(self)
234+
235+
self.core = "Cortex-M0"
236+
237+
self.extra_labels = ['NXP', 'LPC11UXX']
238+
239+
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
231240

232241
# Get a single instance for each target
233242
TARGETS = [
@@ -244,7 +253,8 @@ def __init__(self):
244253
MBED_MCU(),
245254
LPC1347(),
246255
LPC1114(),
247-
LPC11C24()
256+
LPC11C24(),
257+
LPC11U35_401()
248258
]
249259

250260
# Map each target name to its unique instance

0 commit comments

Comments
 (0)