2021-04-28 15:02:17 +02:00
|
|
|
SDK_DIR = hw/mcu/nxp/mcux-sdk
|
2023-04-26 17:10:13 +02:00
|
|
|
DEPS_SUBMODULES += $(SDK_DIR) lib/CMSIS_5
|
2021-03-04 16:50:45 +01:00
|
|
|
|
2021-04-28 10:58:43 +02:00
|
|
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
2023-06-24 13:38:41 +02:00
|
|
|
CPU_CORE ?= cortex-m4
|
2021-04-28 10:58:43 +02:00
|
|
|
|
2019-09-01 10:30:25 +02:00
|
|
|
CFLAGS += \
|
2019-11-20 10:06:40 +01:00
|
|
|
-flto \
|
2019-09-03 08:25:36 +02:00
|
|
|
-DCFG_TUSB_MCU=OPT_MCU_LPC54XXX \
|
2023-03-16 17:11:11 +01:00
|
|
|
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
|
2019-09-01 10:30:25 +02:00
|
|
|
|
2021-04-28 18:24:37 +02:00
|
|
|
ifeq ($(PORT), 1)
|
|
|
|
$(info "PORT1 High Speed")
|
2022-06-01 18:53:40 +02:00
|
|
|
CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
|
2021-04-28 18:24:37 +02:00
|
|
|
|
|
|
|
# LPC55 Highspeed Port1 can only write to USB_SRAM region
|
|
|
|
CFLAGS += -DCFG_TUSB_MEM_SECTION='__attribute__((section("m_usb_global")))'
|
|
|
|
else
|
|
|
|
$(info "PORT0 Full Speed")
|
|
|
|
endif
|
|
|
|
|
2019-09-26 19:15:43 +02:00
|
|
|
# mcu driver cause following warnings
|
|
|
|
CFLAGS += -Wno-error=unused-parameter
|
|
|
|
|
2021-04-28 16:34:26 +02:00
|
|
|
MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
|
2019-09-01 10:30:25 +02:00
|
|
|
|
|
|
|
SRC_C += \
|
2021-03-17 10:52:07 +01:00
|
|
|
src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
|
2021-04-28 16:34:26 +02:00
|
|
|
$(MCU_DIR)/system_$(MCU_CORE).c \
|
2019-09-01 10:30:25 +02:00
|
|
|
$(MCU_DIR)/drivers/fsl_clock.c \
|
|
|
|
$(MCU_DIR)/drivers/fsl_power.c \
|
2021-04-28 15:02:17 +02:00
|
|
|
$(MCU_DIR)/drivers/fsl_reset.c \
|
|
|
|
$(SDK_DIR)/drivers/lpc_gpio/fsl_gpio.c \
|
|
|
|
$(SDK_DIR)/drivers/flexcomm/fsl_flexcomm.c \
|
|
|
|
$(SDK_DIR)/drivers/flexcomm/fsl_usart.c
|
2019-09-01 10:30:25 +02:00
|
|
|
|
|
|
|
INC += \
|
2021-04-28 10:58:43 +02:00
|
|
|
$(TOP)/$(BOARD_PATH) \
|
2023-04-26 17:10:13 +02:00
|
|
|
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
|
2019-09-01 10:30:25 +02:00
|
|
|
$(TOP)/$(MCU_DIR) \
|
2021-04-28 15:02:17 +02:00
|
|
|
$(TOP)/$(MCU_DIR)/drivers \
|
|
|
|
$(TOP)/$(SDK_DIR)/drivers/common \
|
|
|
|
$(TOP)/$(SDK_DIR)/drivers/flexcomm \
|
|
|
|
$(TOP)/$(SDK_DIR)/drivers/lpc_iocon \
|
|
|
|
$(TOP)/$(SDK_DIR)/drivers/lpc_gpio
|
2019-09-01 10:30:25 +02:00
|
|
|
|
2021-04-28 16:34:26 +02:00
|
|
|
SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
|