mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
60 lines
1.8 KiB
Makefile
60 lines
1.8 KiB
Makefile
|
CROSS_COMPILE = riscv32-unknown-elf-
|
||
|
|
||
|
DEPS_SUBMODULES += hw/mcu/gd/nuclei-sdk
|
||
|
|
||
|
NUCLEI_SDK = hw/mcu/gd/nuclei-sdk
|
||
|
GD32VF103_SDK_SOC_COMMON = $(NUCLEI_SDK)/SoC/gd32vf103/Common
|
||
|
GD32VF103_SDK_DRIVER = $(GD32VF103_SDK_SOC_COMMON)/Source/Drivers
|
||
|
SKIP_NANOLIB = 1
|
||
|
|
||
|
CFLAGS += \
|
||
|
-march=rv32imac \
|
||
|
-mabi=ilp32 \
|
||
|
-mcmodel=medlow \
|
||
|
-mstrict-align \
|
||
|
-nostdlib -nostartfiles \
|
||
|
-DCFG_TUSB_MCU=OPT_MCU_GD32VF103 \
|
||
|
-DDOWNLOAD_MODE=DOWNLOAD_MODE_FLASHXIP \
|
||
|
-DGD32VF103
|
||
|
|
||
|
# mcu driver cause following warnings
|
||
|
#CFLAGS += -Wno-error=unused-parameter
|
||
|
|
||
|
# All source paths should be relative to the top level.
|
||
|
LD_FILE = hw/bsp/$(BOARD)/gcc_gd32vf103xb_flashxip.ld # 128kb ROM 32kb RAM
|
||
|
# LD_FILE = hw/bsp/$(BOARD)/gcc_gd32vf103x8_flashxip.ld # 64kb ROM 20kb RAM Longan Nano Lite
|
||
|
|
||
|
SRC_C += \
|
||
|
src/portable/st/synopsys/dcd_synopsys.c \
|
||
|
$(GD32VF103_SDK_DRIVER)/gd32vf103_rcu.c \
|
||
|
$(GD32VF103_SDK_DRIVER)/gd32vf103_gpio.c \
|
||
|
$(GD32VF103_SDK_DRIVER)/Usb/gd32vf103_usb_hw.c \
|
||
|
$(GD32VF103_SDK_DRIVER)/gd32vf103_fmc.c \
|
||
|
$(GD32VF103_SDK_DRIVER)/gd32vf103_usart.c \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/Stubs/sbrk.c \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/Stubs/close.c \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/Stubs/isatty.c \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/Stubs/fstat.c \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/Stubs/lseek.c \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/Stubs/read.c
|
||
|
|
||
|
SRC_S += \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/GCC/startup_gd32vf103.S \
|
||
|
$(GD32VF103_SDK_SOC_COMMON)/Source/GCC/intexc_gd32vf103.S
|
||
|
|
||
|
INC += \
|
||
|
$(TOP)/hw/bsp/$(BOARD) \
|
||
|
$(TOP)/$(NUCLEI_SDK)/NMSIS/Core/Include \
|
||
|
$(TOP)/$(GD32VF103_SDK_SOC_COMMON)/Include \
|
||
|
$(TOP)/$(GD32VF103_SDK_SOC_COMMON)/Include/Usb \
|
||
|
|
||
|
# For freeRTOS port source
|
||
|
#FREERTOS_PORT = ARM_CM3
|
||
|
|
||
|
# For flash-jlink target
|
||
|
JLINK_DEVICE = gd32vf103cb
|
||
|
|
||
|
# flash target ROM bootloader
|
||
|
flash: $(BUILD)/$(PROJECT).bin
|
||
|
dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
|