summaryrefslogtreecommitdiff
path: root/examples/build_system/make
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2024-05-31 12:38:18 +0200
committerHiFiPhile <[email protected]>2024-05-31 12:38:18 +0200
commitb0f5422262a26fb1ab496e33bb8009efb6660788 (patch)
treedfd2570838592e9b822e701097f18b753f32bca6 /examples/build_system/make
parent67456357c54ee81e8418a9e814df774b1a3dee85 (diff)
parentd10b65ada4be7d5754b3128e80a9b4db72bdb23f (diff)
Merge branch 'master' of https://github.com/hathach/tinyusb into rx_fb
Diffstat (limited to 'examples/build_system/make')
-rw-r--r--examples/build_system/make/cpu/rv32i-ilp32.mk11
-rw-r--r--examples/build_system/make/cpu/rv32imac-ilp32.mk10
-rw-r--r--examples/build_system/make/rules.mk11
3 files changed, 25 insertions, 7 deletions
diff --git a/examples/build_system/make/cpu/rv32i-ilp32.mk b/examples/build_system/make/cpu/rv32i-ilp32.mk
index a465baf4c..af764afc5 100644
--- a/examples/build_system/make/cpu/rv32i-ilp32.mk
+++ b/examples/build_system/make/cpu/rv32i-ilp32.mk
@@ -1,12 +1,15 @@
ifeq ($(TOOLCHAIN),gcc)
CFLAGS += \
- -march=rv32i \
+ -march=rv32i_zicsr \
-mabi=ilp32 \
-else ifeq ($(TOOLCHAIN),iar)
- #CFLAGS += --cpu cortex-a53
- #ASFLAGS += --cpu cortex-a53
+else ifeq ($(TOOLCHAIN),clang)
+ CFLAGS += \
+ -march=rv32i_zicsr \
+ -mabi=ilp32 \
+else ifeq ($(TOOLCHAIN),iar)
+ $(error not support)
endif
# For freeRTOS port source
diff --git a/examples/build_system/make/cpu/rv32imac-ilp32.mk b/examples/build_system/make/cpu/rv32imac-ilp32.mk
index 2b6493e48..19c322ebc 100644
--- a/examples/build_system/make/cpu/rv32imac-ilp32.mk
+++ b/examples/build_system/make/cpu/rv32imac-ilp32.mk
@@ -1,11 +1,15 @@
ifeq ($(TOOLCHAIN),gcc)
CFLAGS += \
- -march=rv32imac \
+ -march=rv32imac_zicsr \
+ -mabi=ilp32 \
+
+else ifeq ($(TOOLCHAIN),clang)
+ CFLAGS += \
+ -march=rv32imac_zicsr \
-mabi=ilp32 \
else ifeq ($(TOOLCHAIN),iar)
- #CFLAGS += --cpu cortex-a53
- #ASFLAGS += --cpu cortex-a53
+ $(error not support)
endif
diff --git a/examples/build_system/make/rules.mk b/examples/build_system/make/rules.mk
index 7b6b339ed..102c6db0c 100644
--- a/examples/build_system/make/rules.mk
+++ b/examples/build_system/make/rules.mk
@@ -134,6 +134,17 @@ OPENOCD_OPTION ?=
flash-openocd: $(BUILD)/$(PROJECT).elf
openocd $(OPENOCD_OPTION) -c "program $< verify reset exit"
+# --------------- openocd-wch -----------------
+# wch-linke 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 https://github.com/hathach/riscv-openocd-wch or
+# https://github.com/dragonlock2/miscboards/blob/main/wch/SDK/riscv-openocd.tar.xz
+# with ./configure --disable-werror --enable-wlinke --enable-ch347=no
+OPENOCD_WCH ?= /home/${USER}/app/riscv-openocd-wch/src/openocd
+OPENOCD_WCH_OPTION ?=
+flash-openocd-wch: $(BUILD)/$(PROJECT).elf
+ $(OPENOCD_WCH) $(OPENOCD_WCH_OPTION) -c init -c halt -c "flash write_image $<" -c reset -c exit
+
# --------------- dfu-util -----------------
DFU_UTIL_OPTION ?= -a 0
flash-dfu-util: $(BUILD)/$(PROJECT).bin