mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-07 05:54:11 +08:00
* add name field to usbd_class_driver_t * ci: use set matrix py script * add riscv32 and cmake support for ch32v307, fomu, gd32vf103 * update build_cmake.py to take --family --board --toolchain * separate hil test to its own workflow * move esp32 board into separated hil json * add make build to ci * remov build_make.py * build.py support esp32 board * setup toolchain support esp-idf * fix missing click * merge family in matrix build to reduce jobs * skip cifuzz since it still has issue with get_deps and click
67 lines
2.1 KiB
Makefile
67 lines
2.1 KiB
Makefile
# https://www.embecosm.com/resources/tool-chain-downloads/#riscv-stable
|
|
#CROSS_COMPILE ?= riscv32-unknown-elf-
|
|
|
|
# Toolchain from https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack
|
|
CROSS_COMPILE ?= riscv-none-embed-
|
|
|
|
# Submodules
|
|
CH32V307_SDK = hw/mcu/wch/ch32v307
|
|
|
|
# WCH-SDK paths
|
|
CH32V307_SDK_SRC = $(CH32V307_SDK)/EVT/EXAM/SRC
|
|
|
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
|
CPU_CORE ?= rv32imac-ilp32
|
|
|
|
CFLAGS += \
|
|
-flto \
|
|
-msmall-data-limit=8 \
|
|
-mno-save-restore -Os \
|
|
-fmessage-length=0 \
|
|
-fsigned-char \
|
|
-ffunction-sections \
|
|
-fdata-sections \
|
|
-DCFG_TUSB_MCU=OPT_MCU_CH32V307 \
|
|
-Xlinker --gc-sections \
|
|
-DBOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
|
|
|
|
LDFLAGS_GCC += \
|
|
-nostdlib -nostartfiles \
|
|
--specs=nosys.specs --specs=nano.specs
|
|
|
|
SRC_C += \
|
|
src/portable/wch/dcd_ch32_usbhs.c \
|
|
$(CH32V307_SDK_SRC)/Core/core_riscv.c \
|
|
$(CH32V307_SDK_SRC)/Peripheral/src/ch32v30x_gpio.c \
|
|
$(CH32V307_SDK_SRC)/Peripheral/src/ch32v30x_misc.c \
|
|
$(CH32V307_SDK_SRC)/Peripheral/src/ch32v30x_rcc.c \
|
|
$(CH32V307_SDK_SRC)/Peripheral/src/ch32v30x_usart.c
|
|
|
|
SRC_S += \
|
|
$(CH32V307_SDK_SRC)/Startup/startup_ch32v30x_D8C.S
|
|
|
|
INC += \
|
|
$(TOP)/$(BOARD_PATH) \
|
|
$(TOP)/$(CH32V307_SDK_SRC)/Peripheral/inc
|
|
|
|
# For freeRTOS port source
|
|
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/RISC-V
|
|
|
|
# wch-link is not supported yet in official openOCD yet. We need to either use
|
|
# 1. download openocd as part of mounriver studio http://www.mounriver.com/download or
|
|
# 2. compiled from modified source https://github.com/kprasadvnsi/riscv-openocd-wch
|
|
#
|
|
# Note: For Linux, somehow openocd in mounriver studio does not seem to have wch-link enable,
|
|
# therefore we need to compile it from source as follows:
|
|
# git clone https://github.com/kprasadvnsi/riscv-openocd-wch
|
|
# cd riscv-openocd-wch
|
|
# ./bootstrap
|
|
# ./configure CFLAGS="-Wno-error" --enable-wlink
|
|
# make
|
|
# openocd binaries will be generated in riscv-openocd-wch/src
|
|
|
|
# flash target ROM bootloader
|
|
OPENOCD_WCH = /home/${USER}/app/riscv-openocd-wch/src/openocd
|
|
flash: $(BUILD)/$(PROJECT).elf
|
|
$(OPENOCD_WCH) -f $(TOP)/$(FAMILY_PATH)/wch-riscv.cfg -c init -c halt -c "program $<" -c wlink_reset_resume -c exit
|