mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-05 01:35:35 +00:00
@ -1,4 +1,5 @@
|
||||
set(MCU_VARIANT MCXA153)
|
||||
set(MCU_FAMILY MCXA)
|
||||
set(MCU_CORE MCXA153)
|
||||
|
||||
set(JLINK_DEVICE MCXA153_M33)
|
||||
@ -15,10 +16,10 @@ function(update_board TARGET)
|
||||
CFG_EXAMPLE_VIDEO_READONLY
|
||||
)
|
||||
target_sources(${TARGET} PRIVATE
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/board/clock_config.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/board/pin_mux.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/clock_config.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/pin_mux.c
|
||||
)
|
||||
target_include_directories(${TARGET} PUBLIC
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/board
|
||||
${SDK_DIR}/${MCU_FAMILY}/periph
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
MCU_VARIANT = MCXA153
|
||||
MCU_FAMILY = MCXA
|
||||
MCU_CORE = MCXA153
|
||||
PORT = 0
|
||||
|
||||
@ -9,11 +10,11 @@ CFLAGS += \
|
||||
-DCFG_EXAMPLE_VIDEO_READONLY
|
||||
|
||||
SRC_C += \
|
||||
${BOARD_PATH}/board/clock_config.c \
|
||||
${BOARD_PATH}/board/pin_mux.c
|
||||
${BOARD_PATH}/clock_config.c \
|
||||
${BOARD_PATH}/pin_mux.c
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(BOARD_PATH)/board
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/periph
|
||||
|
||||
JLINK_DEVICE = MCXA153
|
||||
PYOCD_TARGET = MCXA153
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
set(MCU_VARIANT MCXA156)
|
||||
set(MCU_FAMILY MCXA)
|
||||
set(MCU_CORE MCXA156)
|
||||
|
||||
set(JLINK_DEVICE MCXA156_M33)
|
||||
@ -18,4 +19,7 @@ function(update_board TARGET)
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/clock_config.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/pin_mux.c
|
||||
)
|
||||
target_include_directories(${TARGET} PUBLIC
|
||||
${SDK_DIR}/${MCU_FAMILY}/periph1
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
MCU_VARIANT = MCXA156
|
||||
MCU_FAMILY = MCXA
|
||||
MCU_CORE = MCXA156
|
||||
PORT = 0
|
||||
|
||||
@ -7,6 +8,9 @@ CFLAGS += \
|
||||
-DCPU_MCXA156VLH \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_MCXA15 \
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/periph1
|
||||
|
||||
JLINK_DEVICE = MCXA156
|
||||
PYOCD_TARGET = MCXA156
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
set(MCU_VARIANT MCXN947)
|
||||
set(MCU_FAMILY MCXN)
|
||||
set(MCU_CORE MCXN947_cm33_core0)
|
||||
|
||||
set(JLINK_DEVICE MCXN947_M33_0)
|
||||
@ -18,4 +19,7 @@ function(update_board TARGET)
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/clock_config.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/pin_mux.c
|
||||
)
|
||||
target_include_directories(${TARGET} PUBLIC
|
||||
${SDK_DIR}/${MCU_FAMILY}/periph
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
MCU_VARIANT = MCXN947
|
||||
MCU_FAMILY = MCXN
|
||||
MCU_CORE = MCXN947_cm33_core0
|
||||
PORT ?= 1
|
||||
|
||||
@ -7,6 +8,9 @@ CFLAGS += \
|
||||
-DCPU_MCXN947VDF_cm33_core0 \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_MCXN9 \
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/periph
|
||||
|
||||
JLINK_DEVICE = MCXN947_M33_0
|
||||
PYOCD_TARGET = MCXN947
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
set(MCU_VARIANT MCXN947)
|
||||
set(MCU_FAMILY MCXN)
|
||||
set(MCU_CORE MCXN947_cm33_core0)
|
||||
|
||||
set(JLINK_DEVICE MCXN947_M33_0)
|
||||
@ -18,4 +19,7 @@ function(update_board TARGET)
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/clock_config.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/pin_mux.c
|
||||
)
|
||||
target_include_directories(${TARGET} PUBLIC
|
||||
${SDK_DIR}/${MCU_FAMILY}/periph
|
||||
)
|
||||
endfunction()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
MCU_VARIANT = MCXN947
|
||||
MCU_FAMILY = MCXN
|
||||
MCU_CORE = MCXN947_cm33_core0
|
||||
PORT ?= 1
|
||||
|
||||
@ -7,6 +8,9 @@ CFLAGS += \
|
||||
-DCPU_MCXN947VDF_cm33_core0 \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_MCXN9 \
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/periph
|
||||
|
||||
JLINK_DEVICE = MCXN947_M33_0
|
||||
PYOCD_TARGET = MCXN947
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
include_guard()
|
||||
|
||||
set(SDK_DIR ${TOP}/hw/mcu/nxp/mcux-sdk)
|
||||
set(CMSIS_DIR ${TOP}/lib/CMSIS_5)
|
||||
set(MCUX_DIR ${TOP}/hw/mcu/nxp/mcuxsdk-core)
|
||||
set(SDK_DIR ${TOP}/hw/mcu/nxp/mcux-devices-mcx)
|
||||
set(CMSIS_DIR ${TOP}/lib/CMSIS_6)
|
||||
|
||||
# include board specific
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
|
||||
@ -26,46 +27,55 @@ set(CMAKE_TOOLCHAIN_FILE ${TOP}/examples/build_system/cmake/toolchain/arm_${TOOL
|
||||
# Startup & Linker script
|
||||
#------------------------------------
|
||||
if (NOT DEFINED LD_FILE_GNU)
|
||||
set(LD_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/${MCU_CORE}_flash.ld)
|
||||
set(LD_FILE_GNU ${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/gcc/${MCU_CORE}_flash.ld)
|
||||
endif ()
|
||||
set(LD_FILE_Clang ${LD_FILE_GNU})
|
||||
|
||||
if (NOT DEFINED STARTUP_FILE_GNU)
|
||||
set(STARTUP_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/startup_${MCU_CORE}.S)
|
||||
set(STARTUP_FILE_GNU ${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/gcc/startup_${MCU_CORE}.S)
|
||||
endif()
|
||||
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
||||
|
||||
if (NOT DEFINED LD_FILE_IAR)
|
||||
set(LD_FILE_IAR ${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/iar/${MCU_CORE}_flash.icf)
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED STARTUP_FILE_IAR)
|
||||
set(STARTUP_FILE_IAR ${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/iar/startup_${MCU_CORE}.s)
|
||||
endif ()
|
||||
|
||||
#------------------------------------
|
||||
# Board Target
|
||||
#------------------------------------
|
||||
function(family_add_board BOARD_TARGET)
|
||||
add_library(${BOARD_TARGET} STATIC
|
||||
# driver
|
||||
${SDK_DIR}/drivers/gpio/fsl_gpio.c
|
||||
${SDK_DIR}/drivers/common/fsl_common_arm.c
|
||||
${SDK_DIR}/drivers/lpuart/fsl_lpuart.c
|
||||
${MCUX_DIR}/drivers/gpio/fsl_gpio.c
|
||||
${MCUX_DIR}/drivers/common/fsl_common_arm.c
|
||||
${MCUX_DIR}/drivers/lpuart/fsl_lpuart.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/drivers/spc/fsl_spc.c
|
||||
# mcu
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_clock.c
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers/fsl_reset.c
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}/system_${MCU_CORE}.c
|
||||
${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/system_${MCU_CORE}.c
|
||||
${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/drivers/fsl_clock.c
|
||||
${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/drivers/fsl_reset.c
|
||||
)
|
||||
target_include_directories(${BOARD_TARGET} PUBLIC
|
||||
${CMSIS_DIR}/CMSIS/Core/Include
|
||||
${SDK_DIR}/drivers/gpio/
|
||||
${SDK_DIR}/drivers/lpuart
|
||||
${SDK_DIR}/drivers/common
|
||||
${SDK_DIR}/drivers/port
|
||||
${MCUX_DIR}/drivers/gpio/
|
||||
${MCUX_DIR}/drivers/lpuart
|
||||
${MCUX_DIR}/drivers/common
|
||||
${MCUX_DIR}/drivers/port
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/drivers/spc
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}
|
||||
${SDK_DIR}/devices/${MCU_VARIANT}/drivers
|
||||
${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}
|
||||
${SDK_DIR}/${MCU_FAMILY}/${MCU_VARIANT}/drivers
|
||||
)
|
||||
|
||||
if (${FAMILY_MCUS} STREQUAL "MCXN9")
|
||||
target_sources(${BOARD_TARGET} PRIVATE
|
||||
${SDK_DIR}/drivers/lpflexcomm/fsl_lpflexcomm.c
|
||||
${MCUX_DIR}/drivers/lpflexcomm/fsl_lpflexcomm.c
|
||||
)
|
||||
target_include_directories(${BOARD_TARGET} PUBLIC
|
||||
${SDK_DIR}/drivers/lpflexcomm
|
||||
${MCUX_DIR}/drivers/lpflexcomm
|
||||
)
|
||||
elseif(${FAMILY_MCUS} STREQUAL "MCXA15")
|
||||
endif()
|
||||
@ -100,7 +110,8 @@ function(family_configure_example TARGET RTOS)
|
||||
target_link_options(${TARGET} PUBLIC
|
||||
"LINKER:--script=${LD_FILE_GNU}"
|
||||
--specs=nosys.specs --specs=nano.specs
|
||||
#-nostartfiles
|
||||
"LINKER:--defsym=__stack_size__=0x1000"
|
||||
"LINKER:--defsym=__heap_size__=0"
|
||||
)
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_options(${TARGET} PUBLIC
|
||||
@ -109,6 +120,8 @@ function(family_configure_example TARGET RTOS)
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
|
||||
target_link_options(${TARGET} PUBLIC
|
||||
"LINKER:--config=${LD_FILE_IAR}"
|
||||
"LINKER:--config_def=__stack_size__=0x1000"
|
||||
"LINKER:--config_def=__heap_size__=0"
|
||||
)
|
||||
endif ()
|
||||
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
UF2_FAMILY_ID = 0x2abc77ec
|
||||
SDK_DIR = hw/mcu/nxp/mcux-sdk
|
||||
|
||||
include $(TOP)/$(BOARD_PATH)/board.mk
|
||||
CPU_CORE ?= cortex-m33
|
||||
MCUX_DIR = hw/mcu/nxp/mcuxsdk-core
|
||||
SDK_DIR = hw/mcu/nxp/mcux-devices-mcx
|
||||
|
||||
# Default to Highspeed PORT1
|
||||
PORT ?= 1
|
||||
@ -13,10 +15,13 @@ CFLAGS += \
|
||||
# mcu driver cause following warnings
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=old-style-declaration -Wno-error=redundant-decls
|
||||
|
||||
LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
|
||||
LDFLAGS_GCC += \
|
||||
--specs=nosys.specs --specs=nano.specs \
|
||||
-Wl,--defsym=__stack_size__=0x1000 \
|
||||
-Wl,--defsym=__heap_size__=0 \
|
||||
|
||||
# All source paths should be relative to the top level.
|
||||
LD_FILE ?= $(SDK_DIR)/devices/$(MCU_VARIANT)/gcc/$(MCU_CORE)_flash.ld
|
||||
LD_FILE ?= $(SDK_DIR)/$(MCU_FAMILY)/$(MCU_VARIANT)/gcc/$(MCU_CORE)_flash.ld
|
||||
|
||||
# TinyUSB: Port0 is chipidea FS, Port1 is chipidea HS
|
||||
ifeq ($(PORT), 1)
|
||||
@ -30,17 +35,17 @@ else
|
||||
endif
|
||||
|
||||
SRC_C += \
|
||||
$(SDK_DIR)/devices/$(MCU_VARIANT)/system_$(MCU_CORE).c \
|
||||
$(SDK_DIR)/devices/$(MCU_VARIANT)/drivers/fsl_clock.c \
|
||||
$(SDK_DIR)/devices/$(MCU_VARIANT)/drivers/fsl_reset.c \
|
||||
${SDK_DIR}/drivers/gpio/fsl_gpio.c \
|
||||
${SDK_DIR}/drivers/lpuart/fsl_lpuart.c \
|
||||
${SDK_DIR}/drivers/common/fsl_common_arm.c\
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/$(MCU_VARIANT)/system_$(MCU_CORE).c \
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/$(MCU_VARIANT)/drivers/fsl_clock.c \
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/$(MCU_VARIANT)/drivers/fsl_reset.c \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/gpio/fsl_gpio.c \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/lpuart/fsl_lpuart.c \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/common/fsl_common_arm.c \
|
||||
hw/bsp/mcx/drivers/spc/fsl_spc.c
|
||||
|
||||
# fsl_lpflexcomm for MCXN9
|
||||
ifeq ($(MCU_VARIANT), MCXN947)
|
||||
SRC_C += ${SDK_DIR}/drivers/lpflexcomm/fsl_lpflexcomm.c
|
||||
SRC_C += $(MCUX_DIR)/drivers/lpflexcomm/fsl_lpflexcomm.c
|
||||
endif
|
||||
|
||||
# fsl_spc for MCXNA15
|
||||
@ -50,15 +55,15 @@ endif
|
||||
|
||||
INC += \
|
||||
$(TOP)/$(BOARD_PATH) \
|
||||
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
|
||||
$(TOP)/$(SDK_DIR)/devices/$(MCU_VARIANT) \
|
||||
$(TOP)/$(SDK_DIR)/devices/$(MCU_VARIANT)/drivers \
|
||||
$(TOP)/$(SDK_DIR)/drivers/ \
|
||||
$(TOP)/$(SDK_DIR)/drivers/lpuart \
|
||||
$(TOP)/$(SDK_DIR)/drivers/lpflexcomm \
|
||||
$(TOP)/$(SDK_DIR)/drivers/common\
|
||||
$(TOP)/$(SDK_DIR)/drivers/gpio\
|
||||
$(TOP)/$(SDK_DIR)/drivers/port\
|
||||
$(TOP)/lib/CMSIS_6/CMSIS/Core/Include \
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/$(MCU_VARIANT) \
|
||||
$(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/$(MCU_VARIANT)/drivers \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/ \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/lpuart \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/lpflexcomm \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/common \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/gpio \
|
||||
$(TOP)/$(MCUX_DIR)/drivers/port \
|
||||
$(TOP)/hw/bsp/mcx/drivers/spc
|
||||
|
||||
SRC_S += $(SDK_DIR)/devices/$(MCU_VARIANT)/gcc/startup_$(MCU_CORE).S
|
||||
SRC_S += $(TOP)/$(SDK_DIR)/$(MCU_FAMILY)/$(MCU_VARIANT)/gcc/startup_$(MCU_CORE).S
|
||||
|
||||
@ -60,13 +60,16 @@ deps_optional = {
|
||||
'lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43'],
|
||||
'hw/mcu/nxp/mcuxsdk-core': ['https://github.com/nxp-mcuxpresso/mcuxsdk-core',
|
||||
'0c5c6b16deb211110e06bde896cdff59ab213e16',
|
||||
'lpc51 lpc55'],
|
||||
'lpc51 lpc55 mcx'],
|
||||
'hw/mcu/nxp/mcux-sdk': ['https://github.com/nxp-mcuxpresso/mcux-sdk',
|
||||
'a1bdae309a14ec95a4f64a96d3315a4f89c397c6',
|
||||
'kinetis_k kinetis_k32l2 kinetis_kl mcx rw61x imxrt'],
|
||||
'kinetis_k kinetis_k32l2 kinetis_kl rw61x imxrt'],
|
||||
'hw/mcu/nxp/mcux-devices-lpc': ['https://github.com/nxp-mcuxpresso/mcux-devices-lpc',
|
||||
'8096b783ec09d0d1c8629025a5f9d8e7df26e520',
|
||||
'lpc51 lpc55'],
|
||||
'hw/mcu/nxp/mcux-devices-mcx': ['https://github.com/nxp-mcuxpresso/mcux-devices-mcx',
|
||||
'ada1c97c761123ec0c179bb9bb9f744bf9a11475',
|
||||
'mcx'],
|
||||
'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/sekigon-gonnoc/Pico-PIO-USB.git',
|
||||
'675543bcc9baa8170f868ab7ba316d418dbcf41f',
|
||||
'rp2040'],
|
||||
@ -255,7 +258,7 @@ deps_optional = {
|
||||
'hpmicro'],
|
||||
'lib/CMSIS_5': ['https://github.com/ARM-software/CMSIS_5.git',
|
||||
'2b7495b8535bdcb306dac29b9ded4cfb679d7e5c',
|
||||
'imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx rw61x mm32 msp432e4 nrf saml2x '
|
||||
'imxrt kinetis_k32l2 kinetis_kl lpc54 rw61x mm32 msp432e4 nrf saml2x '
|
||||
'lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43 '
|
||||
'stm32c0 stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h5 '
|
||||
'stm32h7 stm32h7rs stm32l0 stm32l1 stm32l4 stm32l5 stm32u0 stm32u5 stm32wb stm32wba '
|
||||
@ -263,7 +266,7 @@ deps_optional = {
|
||||
'tm4c '],
|
||||
'lib/CMSIS_6': ['https://github.com/ARM-software/CMSIS_6.git',
|
||||
'6f0a58d01aa9bd2feba212097f9afe7acd991d52',
|
||||
'ra stm32n6 lpc51 lpc55'],
|
||||
'ra stm32n6 lpc51 lpc55 mcx'],
|
||||
'lib/sct_neopixel': ['https://github.com/gsteiert/sct_neopixel.git',
|
||||
'e73e04ca63495672d955f9268e003cffe168fcd8',
|
||||
'lpc55'],
|
||||
|
||||
Reference in New Issue
Block a user