blob: b0d8858661e847e86891f2cbd4a8470e301e1121 [file] [log] [blame]
Austin Schuh41baf202022-01-01 14:33:40 -08001DEPS_SUBMODULES += hw/mcu/nxp/lpcopen
2
3CFLAGS += \
4 -flto \
5 -mthumb \
6 -mabi=aapcs \
7 -mcpu=cortex-m3 \
8 -nostdlib \
9 -DCORE_M3 \
10 -D__USE_LPCOPEN \
11 -DCFG_TUSB_MCU=OPT_MCU_LPC175X_6X \
12 -DRTC_EV_SUPPORT=0
13
14# startup.c and lpc_types.h cause following errors
15CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual
16
17MCU_DIR = hw/mcu/nxp/lpcopen/lpc175x_6x/lpc_chip_175x_6x
18
19# All source paths should be relative to the top level.
20LD_FILE = hw/bsp/$(BOARD)/lpc1768.ld
21
22SRC_C += \
23 src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
24 $(MCU_DIR)/../gcc/cr_startup_lpc175x_6x.c \
25 $(MCU_DIR)/src/chip_17xx_40xx.c \
26 $(MCU_DIR)/src/clock_17xx_40xx.c \
27 $(MCU_DIR)/src/gpio_17xx_40xx.c \
28 $(MCU_DIR)/src/iocon_17xx_40xx.c \
29 $(MCU_DIR)/src/sysctl_17xx_40xx.c \
30 $(MCU_DIR)/src/sysinit_17xx_40xx.c \
31 $(MCU_DIR)/src/uart_17xx_40xx.c
32
33INC += \
34 $(TOP)/$(MCU_DIR)/inc
35
36# For freeRTOS port source
37FREERTOS_PORT = ARM_CM3
38
39# For flash-jlink target
40JLINK_DEVICE = LPC1768
41
42# flash using pyocd
43flash: $(BUILD)/$(PROJECT).hex
44 pyocd flash -t lpc1768 $<
45