espressif_tinyusb/hw/bsp/lpc55/family.mk

68 lines
1.8 KiB
Makefile
Raw Normal View History

2021-02-28 18:39:48 +01:00
UF2_FAMILY_ID = 0x2abc77ec
2021-04-28 14:53:31 +02:00
SDK_DIR = hw/mcu/nxp/mcux-sdk
DEPS_SUBMODULES += lib/sct_neopixel $(SDK_DIR)
2021-02-28 18:39:48 +01:00
include $(TOP)/$(BOARD_PATH)/board.mk
2021-04-28 14:53:31 +02:00
# Default to Highspeed PORT1
PORT ?= 1
2021-03-01 06:18:37 +01:00
2021-01-02 23:53:15 +01:00
CFLAGS += \
-flto \
-mthumb \
-mabi=aapcs \
-mcpu=cortex-m33 \
-mfloat-abi=hard \
-mfpu=fpv5-sp-d16 \
-DCFG_TUSB_MCU=OPT_MCU_LPC55XX \
2021-03-01 06:18:37 +01:00
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
-DBOARD_TUD_RHPORT=$(PORT)
2021-03-01 06:18:37 +01:00
ifeq ($(PORT), 1)
$(info "PORT1 High Speed")
CFLAGS += -DBOARD_TUD_MAX_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")))'
2021-03-01 06:18:37 +01:00
else
$(info "PORT0 Full Speed")
endif
2021-01-02 23:53:15 +01:00
# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal
2021-04-28 14:53:31 +02:00
MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
2021-01-02 23:53:15 +01:00
# All source paths should be relative to the top level.
2021-03-01 06:18:37 +01:00
LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld
2021-01-02 23:53:15 +01:00
SRC_C += \
src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
2021-03-01 06:18:37 +01:00
$(MCU_DIR)/system_$(MCU_CORE).c \
2021-01-02 23:53:15 +01:00
$(MCU_DIR)/drivers/fsl_clock.c \
$(MCU_DIR)/drivers/fsl_power.c \
$(MCU_DIR)/drivers/fsl_reset.c \
2021-04-28 14:53:31 +02:00
$(SDK_DIR)/drivers/lpc_gpio/fsl_gpio.c \
$(SDK_DIR)/drivers/flexcomm/fsl_flexcomm.c \
$(SDK_DIR)/drivers/flexcomm/fsl_usart.c \
lib/sct_neopixel/sct_neopixel.c
2021-01-02 23:53:15 +01:00
INC += \
2021-02-28 18:39:48 +01:00
$(TOP)/$(BOARD_PATH) \
$(TOP)/lib/sct_neopixel \
2021-01-02 23:53:15 +01:00
$(TOP)/$(MCU_DIR)/../../CMSIS/Include \
$(TOP)/$(MCU_DIR) \
2021-04-28 14:53:31 +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 \
$(TOP)/$(SDK_DIR)/drivers/sctimer
2021-01-02 23:53:15 +01:00
2021-03-01 06:18:37 +01:00
SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
2021-01-02 23:53:15 +01:00
LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_hardabi.a
# For freeRTOS port source
FREERTOS_PORT = ARM_CM33_NTZ/non_secure