board.mk 1.0 KB

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