Austin Schuh | 41baf20 | 2022-01-01 14:33:40 -0800 | [diff] [blame^] | 1 | DEPS_SUBMODULES += hw/mcu/nxp/lpcopen |
| 2 | |
| 3 | CFLAGS += \ |
| 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 |
| 15 | CFLAGS += -Wno-error=strict-prototypes -Wno-error=cast-qual |
| 16 | |
| 17 | MCU_DIR = hw/mcu/nxp/lpcopen/lpc175x_6x/lpc_chip_175x_6x |
| 18 | |
| 19 | # All source paths should be relative to the top level. |
| 20 | LD_FILE = hw/bsp/$(BOARD)/lpc1768.ld |
| 21 | |
| 22 | SRC_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 | |
| 33 | INC += \ |
| 34 | $(TOP)/$(MCU_DIR)/inc |
| 35 | |
| 36 | # For freeRTOS port source |
| 37 | FREERTOS_PORT = ARM_CM3 |
| 38 | |
| 39 | # For flash-jlink target |
| 40 | JLINK_DEVICE = LPC1768 |
| 41 | |
| 42 | # flash using pyocd |
| 43 | flash: $(BUILD)/$(PROJECT).hex |
| 44 | pyocd flash -t lpc1768 $< |
| 45 | |