Skip to content

Commit 934baae

Browse files
committed
bsp lpc51
1 parent 1154b7a commit 934baae

File tree

4 files changed

+44
-14
lines changed

4 files changed

+44
-14
lines changed

.github/workflows/build_arm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- 'imxrt'
3737
- 'kinetis_k32 kinetis_kl'
3838
- 'lpc11 lpc13 lpc15 lpc18'
39-
- 'lpc54 lpc55'
39+
- 'lpc51 lpc54 lpc55'
4040
- 'mm32 msp432e4'
4141
- 'nrf'
4242
- 'ra'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
MCU = LPC51U68
2+
3+
CFLAGS += \
4+
-DCPU_LPC51U68JBD64 \
5+
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data")))'
6+
7+
SRC_C += \
8+
src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
9+
$(MCU_DIR)/system_LPC51U68.c \
10+
$(MCU_DIR)/drivers/fsl_clock.c \
11+
$(MCU_DIR)/drivers/fsl_power.c \
12+
$(MCU_DIR)/drivers/fsl_reset.c \
13+
$(SDK_DIR)/drivers/lpc_gpio/fsl_gpio.c \
14+
$(SDK_DIR)/drivers/flexcomm/fsl_flexcomm.c \
15+
$(SDK_DIR)/drivers/flexcomm/fsl_usart.c
16+
17+
INC += \
18+
$(TOP)/$(MCU_DIR)/../../CMSIS/Include \
19+
$(TOP)/$(MCU_DIR) \
20+
$(TOP)/$(MCU_DIR)/drivers \
21+
$(TOP)/$(SDK_DIR)/drivers/common \
22+
$(TOP)/$(SDK_DIR)/drivers/flexcomm \
23+
$(TOP)/$(SDK_DIR)/drivers/lpc_iocon \
24+
$(TOP)/$(SDK_DIR)/drivers/lpc_gpio
25+
26+
SRC_S += $(MCU_DIR)/gcc/startup_LPC51U68.S
27+
28+
LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower.a
29+
30+
# For freeRTOS port source
31+
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM0
32+
33+
JLINK_DEVICE = LPC51U68
34+
PYOCD_TARGET = LPC51U68
35+
36+
# flash using pyocd (51u68 is not supported yet)
37+
flash: flash-pyocd
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
SDK_DIR = hw/mcu/nxp/mcux-sdk
22
DEPS_SUBMODULES += $(SDK_DIR)
33

4+
MCU_DIR = $(SDK_DIR)/devices/$(MCU)
5+
include $(TOP)/$(BOARD_PATH)/board.mk
6+
47
CFLAGS += \
58
-flto \
69
-mthumb \
710
-mabi=aapcs \
811
-mcpu=cortex-m0plus \
9-
-DCPU_LPC51U68JBD64 \
1012
-DCFG_TUSB_MCU=OPT_MCU_LPC51UXX \
11-
-DCFG_TUSB_MEM_SECTION='__attribute__((section(".data")))' \
1213
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
1314

1415
# mcu driver cause following warnings
1516
CFLAGS += -Wno-error=unused-parameter
1617

17-
MCU_DIR = $(SDK_DIR)/devices/LPC51U68
18-
1918
# All source paths should be relative to the top level.
20-
LD_FILE = $(MCU_DIR)/gcc/LPC51U68_flash.ld
19+
LD_FILE = $(MCU_DIR)/gcc/$(MCU)_flash.ld
2120

2221
SRC_C += \
2322
src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
24-
$(MCU_DIR)/system_LPC51U68.c \
23+
$(MCU_DIR)/system_$(MCU).c \
2524
$(MCU_DIR)/drivers/fsl_clock.c \
2625
$(MCU_DIR)/drivers/fsl_power.c \
2726
$(MCU_DIR)/drivers/fsl_reset.c \
@@ -38,15 +37,9 @@ INC += \
3837
$(TOP)/$(SDK_DIR)/drivers/lpc_iocon \
3938
$(TOP)/$(SDK_DIR)/drivers/lpc_gpio
4039

41-
SRC_S += $(MCU_DIR)/gcc/startup_LPC51U68.S
40+
SRC_S += $(MCU_DIR)/gcc/startup_$(MCU).S
4241

4342
LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower.a
4443

4544
# For freeRTOS port source
4645
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM0
47-
48-
JLINK_DEVICE = LPC51U68
49-
PYOCD_TARGET = LPC51U68
50-
51-
# flash using pyocd (51u68 is not supported yet)
52-
flash: flash-pyocd

0 commit comments

Comments
 (0)