summaryrefslogtreecommitdiffstats
path: root/tinyusb/hw/bsp/lpc54/family.mk
diff options
context:
space:
mode:
Diffstat (limited to 'tinyusb/hw/bsp/lpc54/family.mk')
-rwxr-xr-xtinyusb/hw/bsp/lpc54/family.mk54
1 files changed, 54 insertions, 0 deletions
diff --git a/tinyusb/hw/bsp/lpc54/family.mk b/tinyusb/hw/bsp/lpc54/family.mk
new file mode 100755
index 00000000..600df6fd
--- /dev/null
+++ b/tinyusb/hw/bsp/lpc54/family.mk
@@ -0,0 +1,54 @@
+SDK_DIR = hw/mcu/nxp/mcux-sdk
+DEPS_SUBMODULES += $(SDK_DIR)
+
+include $(TOP)/$(BOARD_PATH)/board.mk
+
+CFLAGS += \
+ -flto \
+ -mthumb \
+ -mabi=aapcs \
+ -mcpu=cortex-m4 \
+ -mfloat-abi=hard \
+ -mfpu=fpv4-sp-d16 \
+ -DCFG_TUSB_MCU=OPT_MCU_LPC54XXX \
+ -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
+
+ifeq ($(PORT), 1)
+ $(info "PORT1 High Speed")
+ CFLAGS += -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_HIGH_SPEED
+
+ # 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
+
+# mcu driver cause following warnings
+CFLAGS += -Wno-error=unused-parameter
+
+MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
+
+SRC_C += \
+ src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
+ $(MCU_DIR)/system_$(MCU_CORE).c \
+ $(MCU_DIR)/drivers/fsl_clock.c \
+ $(MCU_DIR)/drivers/fsl_power.c \
+ $(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
+
+INC += \
+ $(TOP)/$(BOARD_PATH) \
+ $(TOP)/$(MCU_DIR)/../../CMSIS/Include \
+ $(TOP)/$(MCU_DIR) \
+ $(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
+
+SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
+
+# For freeRTOS port source
+FREERTOS_PORT = ARM_CM4F