board.mk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. SDK_DIR = hw/mcu/nxp/nxp_sdk
  2. DEPS_SUBMODULES += $(SDK_DIR)
  3. CFLAGS += \
  4. -mthumb \
  5. -mabi=aapcs \
  6. -mcpu=cortex-m0plus \
  7. -DCPU_MKL25Z128VLK4 \
  8. -DCFG_TUSB_MCU=OPT_MCU_MKL25ZXX \
  9. -DCFG_EXAMPLE_VIDEO_READONLY
  10. LDFLAGS += \
  11. -Wl,--defsym,__stack_size__=0x400 \
  12. -Wl,--defsym,__heap_size__=0
  13. # mcu driver cause following warnings
  14. CFLAGS += -Wno-error=unused-parameter -Wno-error=format -Wno-error=redundant-decls
  15. MCU_DIR = $(SDK_DIR)/devices/MKL25Z4
  16. # All source paths should be relative to the top level.
  17. LD_FILE = $(MCU_DIR)/gcc/MKL25Z128xxx4_flash.ld
  18. SRC_C += \
  19. src/portable/nxp/khci/dcd_khci.c \
  20. src/portable/nxp/khci/hcd_khci.c \
  21. $(MCU_DIR)/system_MKL25Z4.c \
  22. $(MCU_DIR)/project_template/clock_config.c \
  23. $(MCU_DIR)/drivers/fsl_clock.c \
  24. $(MCU_DIR)/drivers/fsl_gpio.c \
  25. $(MCU_DIR)/drivers/fsl_lpsci.c
  26. INC += \
  27. $(TOP)/hw/bsp/$(BOARD) \
  28. $(TOP)/$(SDK_DIR)/CMSIS/Include \
  29. $(TOP)/$(MCU_DIR) \
  30. $(TOP)/$(MCU_DIR)/drivers \
  31. $(TOP)/$(MCU_DIR)/project_template \
  32. SRC_S += $(MCU_DIR)/gcc/startup_MKL25Z4.S
  33. # For freeRTOS port source
  34. FREERTOS_PORT = ARM_CM0
  35. # For flash-jlink target
  36. JLINK_DEVICE = MKL25Z128xxx4
  37. # For flash-pyocd target
  38. PYOCD_TARGET = mkl25zl128
  39. # flash using pyocd
  40. flash: flash-pyocd