Skip to content

Commit 9c77957

Browse files
committed
LPCXpresso LPC1769 board ported
The blinky example compiles and runs. The board has a different eth phy component than mbed LPC1768. It requires a driver.
1 parent e4d0e12 commit 9c77957

File tree

6 files changed

+397
-1
lines changed

6 files changed

+397
-1
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2013 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#ifndef MBED_PINNAMES_H
17+
#define MBED_PINNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
PIN_INPUT,
27+
PIN_OUTPUT
28+
} PinDirection;
29+
30+
#define PORT_SHIFT 5
31+
32+
typedef enum {
33+
// LPC Pin Names
34+
P0_0 = LPC_GPIO0_BASE,
35+
P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15, P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23, P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31,
36+
P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15, P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23, P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31,
37+
P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, P2_8, P2_9, P2_10, P2_11, P2_12, P2_13, P2_14, P2_15, P2_16, P2_17, P2_18, P2_19, P2_20, P2_21, P2_22, P2_23, P2_24, P2_25, P2_26, P2_27, P2_28, P2_29, P2_30, P2_31,
38+
P3_0, P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, P3_8, P3_9, P3_10, P3_11, P3_12, P3_13, P3_14, P3_15, P3_16, P3_17, P3_18, P3_19, P3_20, P3_21, P3_22, P3_23, P3_24, P3_25, P3_26, P3_27, P3_28, P3_29, P3_30, P3_31,
39+
P4_0, P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, P4_8, P4_9, P4_10, P4_11, P4_12, P4_13, P4_14, P4_15, P4_16, P4_17, P4_18, P4_19, P4_20, P4_21, P4_22, P4_23, P4_24, P4_25, P4_26, P4_27, P4_28, P4_29, P4_30, P4_31,
40+
41+
// mbed DIP Pin Names
42+
p5 = P0_9,
43+
p6 = P0_8,
44+
p7 = P0_7,
45+
p8 = P0_6,
46+
p9 = P0_0,
47+
p10 = P0_1,
48+
p11 = P0_18,
49+
p12 = P0_17,
50+
p13 = P0_15,
51+
p14 = P0_16,
52+
p15 = P0_23,
53+
p16 = P0_24,
54+
p17 = P0_25,
55+
p18 = P0_26,
56+
p19 = P1_30,
57+
p20 = P1_31,
58+
p21 = P0_2,
59+
p22 = P0_3,
60+
p23 = P0_21,
61+
p24 = P0_22,
62+
p25 = P0_27,
63+
p26 = P0_28,
64+
p27 = P2_13,
65+
66+
p38 = P0_4,
67+
p39 = P0_5,
68+
p40 = P0_10,
69+
p41 = P0_11,
70+
p42 = P2_0,
71+
p43 = P2_1,
72+
p44 = P2_2,
73+
p45 = P2_3,
74+
p46 = P2_4,
75+
p47 = P2_5,
76+
p48 = P2_6,
77+
p49 = P2_7,
78+
p50 = P2_8,
79+
p51 = P2_10,
80+
p52 = P2_11,
81+
p53 = P2_12,
82+
83+
84+
// Other mbed Pin Names
85+
LED1 = P0_22,
86+
LED2 = P0_22,
87+
LED3 = P0_22,
88+
LED4 = P0_22,
89+
90+
USBTX = p21,
91+
USBRX = p22,
92+
93+
A0 = P0_23,
94+
A1 = P0_24,
95+
A2 = P0_25,
96+
A3 = P0_26,
97+
A4 = P1_30,
98+
A5 = P1_31,
99+
100+
// Not connected
101+
NC = (int)0xFFFFFFFF,
102+
103+
I2C_SCL0 = NC,
104+
I2C_SDA0 = NC,
105+
I2C_SCL1 = p10,
106+
I2C_SDA1 = p9,
107+
I2C_SCL2 = p41, // pin used by application board
108+
I2C_SDA2 = p40, // pin used by application board
109+
I2C_SCL = I2C_SCL2,
110+
I2C_SDA = I2C_SDA2,
111+
} PinName;
112+
113+
typedef enum {
114+
PullUp = 0,
115+
PullDown = 3,
116+
PullNone = 2,
117+
Repeater = 1,
118+
OpenDrain = 4,
119+
PullDefault = PullDown
120+
} PinMode;
121+
122+
// version of PINCON_TypeDef using register arrays
123+
typedef struct {
124+
__IO uint32_t PINSEL[11];
125+
uint32_t RESERVED0[5];
126+
__IO uint32_t PINMODE[10];
127+
__IO uint32_t PINMODE_OD[5];
128+
} PINCONARRAY_TypeDef;
129+
130+
#define PINCONARRAY ((PINCONARRAY_TypeDef *)LPC_PINCON_BASE)
131+
132+
#ifdef __cplusplus
133+
}
134+
#endif
135+
136+
#endif
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
2+
// Check the 'features' section of the target description in 'targets.json' for more details.
3+
/* mbed Microcontroller Library
4+
* Copyright (c) 2006-2013 ARM Limited
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
#ifndef MBED_DEVICE_H
19+
#define MBED_DEVICE_H
20+
21+
22+
23+
24+
#define DEVICE_ID_LENGTH 32
25+
#define DEVICE_MAC_OFFSET 20
26+
27+
28+
// #define DEVICE_PORTIN 1
29+
// #define DEVICE_PORTOUT 1
30+
// #define DEVICE_PORTINOUT 1
31+
32+
// #define DEVICE_INTERRUPTIN 0
33+
34+
// #define DEVICE_ANALOGIN 0
35+
// #define DEVICE_ANALOGOUT 0
36+
37+
// #define DEVICE_SERIAL 1
38+
39+
// #define DEVICE_I2C 0
40+
// #define DEVICE_I2CSLAVE 0
41+
42+
// #define DEVICE_SPI 0
43+
// #define DEVICE_SPISLAVE 0
44+
45+
// #define DEVICE_CAN 0
46+
47+
// #define DEVICE_RTC 0
48+
49+
// #define DEVICE_ETHERNET 0
50+
51+
// #define DEVICE_PWMOUT 0
52+
53+
// #define DEVICE_SEMIHOST 0
54+
// #define DEVICE_LOCALFILESYSTEM 0
55+
56+
// #define DEVICE_SLEEP 1
57+
58+
// #ifdef DEVICE_DEBUG_AWARENESS
59+
// #undef DEVICE_DEBUG_AWARENESS
60+
// #define DEVICE_DEBUG_AWARENESS 0
61+
// #endif
62+
63+
// #define DEVICE_STDIO_MESSAGES 0
64+
65+
// #define DEVICE_ERROR_PATTERN 0
66+
67+
68+
#include "objects.h"
69+
70+
#endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// List of reserved pins for MBED LPC1768
2+
3+
#ifndef RESERVED_PINS_H
4+
#define RESERVED_PINS_H
5+
6+
#define TARGET_RESERVED_PINS {}
7+
8+
#endif
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
/* Linker script for mbed LPC1769 */
2+
3+
/* Linker script to configure memory regions. */
4+
MEMORY
5+
{
6+
FLASH (rx) : ORIGIN = 0x00002000, LENGTH = 504K
7+
RAM (rwx) : ORIGIN = 0x100000C8, LENGTH = (32K - 0xC8 - 32) /* topmost 32 bytes used by IAP functions */
8+
9+
USB_RAM(rwx) : ORIGIN = 0x2007C000, LENGTH = 16K
10+
ETH_RAM(rwx) : ORIGIN = 0x20080000, LENGTH = 16K
11+
}
12+
13+
/* Linker script to place sections and symbol values. Should be used together
14+
* with other linker script that defines memory regions FLASH and RAM.
15+
* It references following symbols, which must be defined in code:
16+
* Reset_Handler : Entry of reset handler
17+
*
18+
* It defines following symbols, which code can use without definition:
19+
* __exidx_start
20+
* __exidx_end
21+
* __etext
22+
* __data_start__
23+
* __preinit_array_start
24+
* __preinit_array_end
25+
* __init_array_start
26+
* __init_array_end
27+
* __fini_array_start
28+
* __fini_array_end
29+
* __data_end__
30+
* __bss_start__
31+
* __bss_end__
32+
* __end__
33+
* end
34+
* __HeapLimit
35+
* __StackLimit
36+
* __StackTop
37+
* __stack
38+
*/
39+
ENTRY(Reset_Handler)
40+
41+
SECTIONS
42+
{
43+
.text :
44+
{
45+
KEEP(*(.isr_vector))
46+
*(.text*)
47+
48+
KEEP(*(.init))
49+
KEEP(*(.fini))
50+
51+
/* .ctors */
52+
*crtbegin.o(.ctors)
53+
*crtbegin?.o(.ctors)
54+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
55+
*(SORT(.ctors.*))
56+
*(.ctors)
57+
58+
/* .dtors */
59+
*crtbegin.o(.dtors)
60+
*crtbegin?.o(.dtors)
61+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
62+
*(SORT(.dtors.*))
63+
*(.dtors)
64+
65+
*(.rodata*)
66+
67+
KEEP(*(.eh_frame*))
68+
} > FLASH
69+
70+
.ARM.extab :
71+
{
72+
*(.ARM.extab* .gnu.linkonce.armextab.*)
73+
} > FLASH
74+
75+
__exidx_start = .;
76+
.ARM.exidx :
77+
{
78+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
79+
} > FLASH
80+
__exidx_end = .;
81+
82+
__etext = .;
83+
84+
.data : AT (__etext)
85+
{
86+
__data_start__ = .;
87+
Image$$RW_IRAM1$$Base = .;
88+
*(vtable)
89+
*(.data*)
90+
91+
. = ALIGN(4);
92+
/* preinit data */
93+
PROVIDE (__preinit_array_start = .);
94+
KEEP(*(.preinit_array))
95+
PROVIDE (__preinit_array_end = .);
96+
97+
. = ALIGN(4);
98+
/* init data */
99+
PROVIDE (__init_array_start = .);
100+
KEEP(*(SORT(.init_array.*)))
101+
KEEP(*(.init_array))
102+
PROVIDE (__init_array_end = .);
103+
104+
105+
. = ALIGN(4);
106+
/* finit data */
107+
PROVIDE (__fini_array_start = .);
108+
KEEP(*(SORT(.fini_array.*)))
109+
KEEP(*(.fini_array))
110+
PROVIDE (__fini_array_end = .);
111+
112+
. = ALIGN(4);
113+
/* All data end */
114+
__data_end__ = .;
115+
116+
} > RAM
117+
118+
119+
.bss :
120+
{
121+
__bss_start__ = .;
122+
*(.bss*)
123+
*(COMMON)
124+
__bss_end__ = .;
125+
Image$$RW_IRAM1$$ZI$$Limit = . ;
126+
} > RAM
127+
128+
129+
.heap :
130+
{
131+
__end__ = .;
132+
end = __end__;
133+
*(.heap*)
134+
__HeapLimit = .;
135+
} > RAM
136+
137+
/* .stack_dummy section doesn't contains any symbols. It is only
138+
* used for linker to calculate size of stack sections, and assign
139+
* values to stack symbols later */
140+
.stack_dummy :
141+
{
142+
*(.stack)
143+
} > RAM
144+
145+
/* Set stack top to end of RAM, and stack limit move down by
146+
* size of stack_dummy section */
147+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
148+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
149+
PROVIDE(__stack = __StackTop);
150+
151+
/* Check if data + heap + stack exceeds RAM limit */
152+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
153+
154+
155+
/* Code can explicitly ask for data to be
156+
placed in these higher RAM banks where
157+
they will be left uninitialized.
158+
*/
159+
.AHBSRAM0 (NOLOAD):
160+
{
161+
Image$$RW_IRAM2$$Base = . ;
162+
*(AHBSRAM0)
163+
Image$$RW_IRAM2$$ZI$$Limit = .;
164+
} > USB_RAM
165+
166+
.AHBSRAM1 (NOLOAD):
167+
{
168+
Image$$RW_IRAM3$$Base = . ;
169+
*(AHBSRAM1)
170+
Image$$RW_IRAM3$$ZI$$Limit = .;
171+
} > ETH_RAM
172+
}

targets/TARGET_NXP/mbed_rtx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#define INITIAL_SP (0x02009000UL)
5151
#endif
5252

53-
#elif defined(TARGET_LPC1768)
53+
#elif defined(TARGET_LPC1768) || defined(TARGET_LPC1769)
5454

5555
#ifndef INITIAL_SP
5656
#define INITIAL_SP (0x10008000UL)

0 commit comments

Comments
 (0)