summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-13 18:11:59 +0700
committerhathach <[email protected]>2026-03-13 18:11:59 +0700
commit7ce1e7820451319227b2c1120a2b5e4a63ebf0a9 (patch)
tree9ef8ee269ef7f5ba1811b7819888e5c61bce9829
parent8a70453baee2117348a4901735a5999509fb5a69 (diff)
actual build make/cmake for ft9xx
-rw-r--r--docs/reference/boards.rst2
-rw-r--r--docs/reference/dependencies.rst2
-rw-r--r--examples/device/audio_4_channel_mic_freertos/skip.txt1
-rw-r--r--examples/device/audio_test_freertos/skip.txt1
-rw-r--r--examples/device/cdc_msc_freertos/skip.txt1
-rw-r--r--examples/device/hid_composite_freertos/skip.txt1
-rw-r--r--examples/device/midi_test_freertos/skip.txt1
-rw-r--r--examples/host/cdc_msc_hid_freertos/skip.txt1
-rw-r--r--hw/bsp/family_support.cmake15
-rw-r--r--hw/bsp/ft9xx/boards/mm900evxb/board.cmake5
-rw-r--r--hw/bsp/ft9xx/boards/mm900evxb/board.h (renamed from hw/bsp/brtmm90x/boards/mm900evxb/board.h)0
-rw-r--r--hw/bsp/ft9xx/boards/mm900evxb/board.mk1
-rw-r--r--hw/bsp/ft9xx/family.c (renamed from hw/bsp/brtmm90x/family.c)0
-rw-r--r--hw/bsp/ft9xx/family.cmake74
-rw-r--r--hw/bsp/ft9xx/family.mk (renamed from hw/bsp/brtmm90x/family.mk)13
-rwxr-xr-xtools/get_deps.py4
16 files changed, 116 insertions, 6 deletions
diff --git a/docs/reference/boards.rst b/docs/reference/boards.rst
index eaef078d3..e01ea9d23 100644
--- a/docs/reference/boards.rst
+++ b/docs/reference/boards.rst
@@ -55,7 +55,7 @@ Bridgetek
========= ========= ======== ===================================== ======
Board Name Family URL Note
========= ========= ======== ===================================== ======
-mm900evxb MM900EVxB brtmm90x https://brtchip.com/product/mm900ev1b
+mm900evxb MM900EVxB ft9xx https://brtchip.com/product/mm900ev1b
========= ========= ======== ===================================== ======
Espressif
diff --git a/docs/reference/dependencies.rst b/docs/reference/dependencies.rst
index 9b61e10a8..16a43f479 100644
--- a/docs/reference/dependencies.rst
+++ b/docs/reference/dependencies.rst
@@ -17,7 +17,7 @@ hw/mcu/artery/at32f423 https://github.com/ArteryTek/AT32F423_
hw/mcu/artery/at32f425 https://github.com/ArteryTek/AT32F425_Firmware_Library.git 620233e1357d5c1b7e2bde6b9dd5196822b91817 at32f425
hw/mcu/artery/at32f435_437 https://github.com/ArteryTek/AT32F435_437_Firmware_Library.git 25439cc6650a8ae0345934e8707a5f38c7ae41f8 at32f435_437
hw/mcu/artery/at32f45x https://github.com/ArteryTek/AT32F45x_Firmware_Library.git 3d4a1b38be8ebac292e2350ca53bc4bfa4430233 at32f45x
-hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1 brtmm90x
+hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1 ft9xx
hw/mcu/broadcom https://github.com/adafruit/broadcom-peripherals.git 08370086080759ed54ac1136d62d2ad24c6fa267 broadcom_32bit broadcom_64bit
hw/mcu/gd/nuclei-sdk https://github.com/Nuclei-Software/nuclei-sdk.git 7eb7bfa9ea4fbeacfafe1d5f77d5a0e6ed3922e7 gd32vf103
hw/mcu/infineon/mtb-xmclib-cat3 https://github.com/Infineon/mtb-xmclib-cat3.git daf5500d03cba23e68c2f241c30af79cd9d63880 xmc4000
diff --git a/examples/device/audio_4_channel_mic_freertos/skip.txt b/examples/device/audio_4_channel_mic_freertos/skip.txt
index ded5ee4bc..be44cb2c0 100644
--- a/examples/device/audio_4_channel_mic_freertos/skip.txt
+++ b/examples/device/audio_4_channel_mic_freertos/skip.txt
@@ -8,6 +8,7 @@ mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
+mcu:FT90X
mcu:RP2040
mcu:SAMD11
mcu:VALENTYUSB_EPTRI
diff --git a/examples/device/audio_test_freertos/skip.txt b/examples/device/audio_test_freertos/skip.txt
index be1912a31..007fece53 100644
--- a/examples/device/audio_test_freertos/skip.txt
+++ b/examples/device/audio_test_freertos/skip.txt
@@ -8,6 +8,7 @@ mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
+mcu:FT90X
mcu:RP2040
mcu:SAMD11
mcu:VALENTYUSB_EPTRI
diff --git a/examples/device/cdc_msc_freertos/skip.txt b/examples/device/cdc_msc_freertos/skip.txt
index 199cd8ac6..31d808d8e 100644
--- a/examples/device/cdc_msc_freertos/skip.txt
+++ b/examples/device/cdc_msc_freertos/skip.txt
@@ -8,6 +8,7 @@ mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
+mcu:FT90X
mcu:RP2040
mcu:SAMD11
mcu:VALENTYUSB_EPTRI
diff --git a/examples/device/hid_composite_freertos/skip.txt b/examples/device/hid_composite_freertos/skip.txt
index 62f4a3795..8ae238584 100644
--- a/examples/device/hid_composite_freertos/skip.txt
+++ b/examples/device/hid_composite_freertos/skip.txt
@@ -8,6 +8,7 @@ mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
+mcu:FT90X
mcu:RP2040
mcu:SAMD11
mcu:VALENTYUSB_EPTRI
diff --git a/examples/device/midi_test_freertos/skip.txt b/examples/device/midi_test_freertos/skip.txt
index 62f4a3795..8ae238584 100644
--- a/examples/device/midi_test_freertos/skip.txt
+++ b/examples/device/midi_test_freertos/skip.txt
@@ -8,6 +8,7 @@ mcu:GD32VF103
mcu:MCXA15
mcu:MKL25ZXX
mcu:MSP430x5xx
+mcu:FT90X
mcu:RP2040
mcu:SAMD11
mcu:VALENTYUSB_EPTRI
diff --git a/examples/host/cdc_msc_hid_freertos/skip.txt b/examples/host/cdc_msc_hid_freertos/skip.txt
index 74ee436cb..bb62547a6 100644
--- a/examples/host/cdc_msc_hid_freertos/skip.txt
+++ b/examples/host/cdc_msc_hid_freertos/skip.txt
@@ -1,3 +1,4 @@
mcu:CH32F20X
mcu:RP2040
board:lpcxpresso54114
+mcu:FT90X
diff --git a/hw/bsp/family_support.cmake b/hw/bsp/family_support.cmake
index 8cc2af190..96d6993e6 100644
--- a/hw/bsp/family_support.cmake
+++ b/hw/bsp/family_support.cmake
@@ -881,6 +881,21 @@ function(family_flash_uniflash TARGET)
set_property(TARGET ${TARGET}-uniflash PROPERTY FOLDER ${TARGET}-group)
endfunction()
+# Add flash ft9xx target need to remove kernal's ftdi_sio and bind D2XX drivers
+# sudo rmmod ftdi_sio && for i in 0 1 2 3; do sudo sh -c "echo 3-3.4:1.$i > /sys/bus/usb/drivers/ftdi_sio/unbind" 2>/dev/null; done
+function(family_flash_ft9xx TARGET)
+ if (NOT DEFINED FT9XXPROG)
+ set(FT9XXPROG FT9xxProg)
+ endif ()
+
+ add_custom_target(${TARGET}-ft9xx
+ DEPENDS ${TARGET}
+ COMMAND ${FT9XXPROG} -f $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
+ )
+
+ set_property(TARGET ${TARGET}-ft9xx PROPERTY FOLDER ${TARGET}-group)
+endfunction()
+
#----------------------------------
# Family specific
#----------------------------------
diff --git a/hw/bsp/ft9xx/boards/mm900evxb/board.cmake b/hw/bsp/ft9xx/boards/mm900evxb/board.cmake
new file mode 100644
index 000000000..49b779de4
--- /dev/null
+++ b/hw/bsp/ft9xx/boards/mm900evxb/board.cmake
@@ -0,0 +1,5 @@
+function(update_board TARGET)
+ target_compile_definitions(${TARGET} PUBLIC
+ __FT900__
+ )
+endfunction()
diff --git a/hw/bsp/brtmm90x/boards/mm900evxb/board.h b/hw/bsp/ft9xx/boards/mm900evxb/board.h
index 623033c2c..623033c2c 100644
--- a/hw/bsp/brtmm90x/boards/mm900evxb/board.h
+++ b/hw/bsp/ft9xx/boards/mm900evxb/board.h
diff --git a/hw/bsp/ft9xx/boards/mm900evxb/board.mk b/hw/bsp/ft9xx/boards/mm900evxb/board.mk
new file mode 100644
index 000000000..4e22ff2e6
--- /dev/null
+++ b/hw/bsp/ft9xx/boards/mm900evxb/board.mk
@@ -0,0 +1 @@
+CFLAGS += -D__FT900__
diff --git a/hw/bsp/brtmm90x/family.c b/hw/bsp/ft9xx/family.c
index ff24cfe89..ff24cfe89 100644
--- a/hw/bsp/brtmm90x/family.c
+++ b/hw/bsp/ft9xx/family.c
diff --git a/hw/bsp/ft9xx/family.cmake b/hw/bsp/ft9xx/family.cmake
new file mode 100644
index 000000000..31efb3c10
--- /dev/null
+++ b/hw/bsp/ft9xx/family.cmake
@@ -0,0 +1,74 @@
+include_guard()
+
+set(FT9XX_SDK ${TOP}/hw/mcu/bridgetek/ft9xx/ft90x-sdk/Source)
+
+# include board specific
+include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
+
+# toolchain set up
+set(CMAKE_SYSTEM_CPU ft32 CACHE INTERNAL "System Processor")
+set(CMAKE_TOOLCHAIN_FILE ${TOP}/examples/build_system/cmake/toolchain/ft32_${TOOLCHAIN}.cmake)
+
+set(FAMILY_MCUS FT90X CACHE INTERNAL "")
+
+#------------------------------------
+# BOARD_TARGET
+#------------------------------------
+function(family_add_board BOARD_TARGET)
+ add_library(${BOARD_TARGET} STATIC
+ ${FT9XX_SDK}/src/sys.c
+ ${FT9XX_SDK}/src/interrupt.c
+ ${FT9XX_SDK}/src/delay.c
+ ${FT9XX_SDK}/src/timers.c
+ ${FT9XX_SDK}/src/uart_simple.c
+ ${FT9XX_SDK}/src/gpio.c
+ )
+ target_include_directories(${BOARD_TARGET} PUBLIC
+ ${FT9XX_SDK}/include
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}
+ )
+ target_compile_definitions(${BOARD_TARGET} PUBLIC
+ BOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
+ )
+ target_compile_options(${BOARD_TARGET} PUBLIC
+ -fmessage-length=0
+ )
+
+ update_board(${BOARD_TARGET})
+endfunction()
+
+#------------------------------------
+# Functions
+#------------------------------------
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
+ family_add_tinyusb(${TARGET} OPT_MCU_FT90X)
+
+ target_sources(${TARGET} PUBLIC
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
+ ${TOP}/src/portable/bridgetek/ft9xx/dcd_ft9xx.c
+ ${FT9XX_SDK}/src/bootstrap.c
+ )
+ set_source_files_properties(${FT9XX_SDK}/src/bootstrap.c PROPERTIES
+ COMPILE_OPTIONS "-w")
+ target_include_directories(${TARGET} PUBLIC
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
+ )
+ target_compile_options(${TARGET} PUBLIC
+ -Wno-error=shadow
+ )
+
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ target_link_options(${TARGET} PUBLIC
+ "LINKER:--script=${TOP}/hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld"
+ "LINKER:--entry=_start"
+ )
+ endif ()
+
+ # Flashing
+ family_add_bin_hex(${TARGET})
+ family_flash_ft9xx(${TARGET})
+endfunction()
diff --git a/hw/bsp/brtmm90x/family.mk b/hw/bsp/ft9xx/family.mk
index 2de4dc760..9d71bf321 100644
--- a/hw/bsp/brtmm90x/family.mk
+++ b/hw/bsp/ft9xx/family.mk
@@ -18,13 +18,14 @@ FT9XX_SDK = hw/mcu/bridgetek/ft9xx/ft90x-sdk/Source
INC += "$(TOP)/$(FT9XX_SDK)/include"
endif
+include $(TOP)/$(BOARD_PATH)/board.mk
+
# Add include files which are within the TinyUSB directory structure.
INC += \
$(TOP)/$(BOARD_PATH)
-# Add required C Compiler flags for FT90X.
+# Add required C Compiler flags for FT9XX.
CFLAGS += \
- -D__FT900__ \
-fvar-tracking \
-fvar-tracking-assignments \
-fmessage-length=0 \
@@ -50,6 +51,7 @@ SRC_C += src/portable/bridgetek/ft9xx/dcd_ft9xx.c
ifneq ($(FT9XX_PREBUILT_LIBS),1)
# Optionally add in files from the Bridgetek SDK instead of the prebuilt
# library. These are the minimum required.
+SRC_C += $(FT9XX_SDK)/src/bootstrap.c
SRC_C += $(FT9XX_SDK)/src/sys.c
SRC_C += $(FT9XX_SDK)/src/interrupt.c
SRC_C += $(FT9XX_SDK)/src/delay.c
@@ -64,3 +66,10 @@ endif
# Not required crt0 file for FT90X. Use compiler built-in file.
#SRC_S += hw/mcu/bridgetek/ft9xx/scripts/crt0.S
+
+# Flash using FT9xxProg, need to remove kernal's ftdi_sio and bind D2XX drivers
+# sudo rmmod ftdi_sio && for i in 0 1 2 3; do sudo sh -c "echo 3-3.4:1.$i > /sys/bus/usb/drivers/ftdi_sio/unbind" 2>/dev/null; done
+FT9XXPROG ?= FT9xxProg
+flash: flash-ft9xx
+flash-ft9xx: $(BUILD)/$(PROJECT).bin
+ $(FT9XXPROG) -f $<
diff --git a/tools/get_deps.py b/tools/get_deps.py
index 77c3a593a..c4ec5454e 100755
--- a/tools/get_deps.py
+++ b/tools/get_deps.py
@@ -35,8 +35,8 @@ deps_optional = {
'b20b398d3e5e2007594e54a74ba3d2a2e50ddd75',
'maxim'],
'hw/mcu/bridgetek/ft9xx/ft90x-sdk': ['https://github.com/BRTSG-FOSS/ft90x-sdk.git',
- '91060164afe239fcb394122e8bf9eb24d3194eb1',
- 'brtmm90x'],
+ '03f74eac84645178fdde7f2e5ca9acdcb7bd9dcd',
+ 'ft9xx'],
'hw/mcu/broadcom': ['https://github.com/adafruit/broadcom-peripherals.git',
'08370086080759ed54ac1136d62d2ad24c6fa267',
'broadcom_32bit broadcom_64bit'],