2019-10-12 00:00:36 +08:00
|
|
|
CFLAGS += \
|
2019-11-20 16:06:40 +07:00
|
|
|
-flto \
|
2019-10-12 00:00:36 +08:00
|
|
|
-march=rv32i \
|
|
|
|
-mabi=ilp32 \
|
|
|
|
-nostdlib \
|
2019-11-12 21:11:46 -08:00
|
|
|
-DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI
|
2019-10-12 00:00:36 +08:00
|
|
|
|
2020-03-25 14:06:51 +07:00
|
|
|
# Cross Compiler for RISC-V
|
|
|
|
CROSS_COMPILE = riscv-none-embed-
|
|
|
|
|
2019-10-12 00:00:36 +08:00
|
|
|
MCU_DIR = hw/mcu/fomu
|
|
|
|
BSP_DIR = hw/bsp/fomu
|
|
|
|
|
|
|
|
# All source paths should be relative to the top level.
|
2020-03-07 17:49:30 +07:00
|
|
|
LD_FILE = hw/bsp/$(BOARD)/fomu.ld
|
2019-10-12 00:00:36 +08:00
|
|
|
|
2020-04-16 22:11:00 +07:00
|
|
|
SRC_S += hw/bsp/$(BOARD)/crt0-vexriscv.S
|
2019-10-12 00:00:36 +08:00
|
|
|
|
|
|
|
INC += \
|
|
|
|
$(TOP)/$(BSP_DIR)/include
|
|
|
|
|
|
|
|
# For TinyUSB port source
|
2019-11-12 21:11:46 -08:00
|
|
|
VENDOR = valentyusb
|
|
|
|
CHIP_FAMILY = eptri
|
2019-10-12 00:00:36 +08:00
|
|
|
|
2020-03-11 00:09:37 +07:00
|
|
|
# For freeRTOS port source
|
|
|
|
FREERTOS_PORT = RISC-V
|
|
|
|
|
2019-10-12 00:00:36 +08:00
|
|
|
# flash using dfu-util
|
2020-04-16 22:11:00 +07:00
|
|
|
$(BUILD)/$(BOARD)-firmware.dfu: $(BUILD)/$(BOARD)-firmware.bin
|
|
|
|
@echo "Create $@"
|
|
|
|
python $(TOP)/hw/bsp/$(BOARD)/dfu.py -b $^ -D 0x1209:0x5bf0 $@
|
|
|
|
|
2019-10-12 00:00:36 +08:00
|
|
|
flash: $(BUILD)/$(BOARD)-firmware.dfu
|
|
|
|
dfu-util -D $^
|