Little change in Makefiles to allow easy swap to the "WCH-Interrupt-fast" toolchain
doegox opened this issue · comments
Hi
If you change in all Makefile as follows
-BASE_OPTS = -march=rv32imac -mabi=ilp32 -msmall-data-limit=8 $(OPTIM_OPTS) -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections
+RISCV_ARCH ?= rv32imac
+BASE_OPTS = -march=$(RISCV_ARCH) -mabi=ilp32 -msmall-data-limit=8 $(OPTIM_OPTS) -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections
then to apply the "WCH-Interrupt-fast" toolchain, one doesn't need to patch the examples as specified in https://github.com/hydrausb3/riscv-none-elf-gcc-xpack/releases/tag/12.2.0-1, but he can just do
make COMPILER_PREFIX=riscv-none-elf RISCV_ARCH=rv32imac_zicsr
It is a good idea but such modifications cannot be applied easily today to be compatible with both toolchain especially the MounRiver IDE as it requires some modifications in Eclipse project (which will need to specify COMPILER_PREFIX & RISCV_ARCH)
So to be studied to have something which work easily in both world proprietary toolchain with and without MounRiver IDE and the open source xPack GNU RISC-V Embedded GCC v12.2.0-1 toolchain
Fixed with commit e1707dc
- Makefile add automatic detection and use of compatible riscv compiler either closed source from MounRiver Studio riscv-none-embed or open source one GCC riscv-none-elf available at https://github.com/hydrausb3/riscv-none-elf-gcc-xpack/releases/
- Note: I have tested that Makefile with success on Windows (MSYS2) and GNU/Linux Ubuntu 20.04 or more with MounRiver Studio/MounRiver Studio Community or open source GCC 12.2.0 for RISCV available on https://github.com/hydrausb3/riscv-none-elf-gcc-xpack/releases/