On https://github.com/sipeed/platform-gd32v there are only toolchains for Windows and Linux. When can we expect supportr for MacOS?
You can build a toolchain for MacOs by yourself. I did so. Actually, you need to build riscv-openocd, gd32-dfu-utils and the gd32 libs.
I have compiled successfully the gcc toolchain. But when I install it in PlatformIO and compile Blink.cpp I get lots of errors. I cloned from https://github.com/riscv/riscv-gnu-toolchain
HARDWARE: GD32VF103CBT6 108MHz, 32KB RAM, 128KB Flash DEBUG: Current (altera-usb-blaster) External (altera-usb-blaster, gd-link, jlink, rv-link, sipeed-rv-debugger, um232h) PACKAGES: framework-arduino-gd32v 0.1.1, toolchain-riscv-mac 9.2.0 LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF Modes: Finder ~ chain, Compatibility ~ soft Found 1 compatible libraries Scanning dependencies... No dependencies Building in release mode Compiling .pio/build/sipeed-longan-nano/src/Blink.cpp.o dyld: Library not loaded: /usr/local/opt/isl/lib/libisl.21.dylib Referenced from: /Users/d058463/.platformio/packages/toolchain-riscv-mac/bin/../libexec/gcc/riscv64-unknown-elf/9.2.0/cc1plus Reason: image not found riscv64-unknown-elf-g++: internal compiler error: Abort trap: 6 signal terminated program cc1plus Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. Compiling .pio/build/sipeed-longan-nano/FrameworkArduinoVariant/pins_arduino.c.o dyld: Library not loaded: /usr/local/opt/isl/lib/libisl.21.dylib Referenced from: /Users/d058463/.platformio/packages/toolchain-riscv-mac/bin/../libexec/gcc/riscv64-unknown-elf/9.2.0/cc1 Reason: image not found ...
Can anyone tell me the exact flags that I need to pass to ./configure for the gcc?
Would you like to teach me which downloadable source tree are, of riscv-openocd, gd32-dfu-utils and the gd32 libs?
BTW, the toolchain in my macOS is:
$ riscv32-unknown-elf-gcc -v
Using built-in specs.
Configured with: /opt/riscv/src/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv32-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv32-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=…/./riscv-gcc --enable-multilib --with-abi=ilp32d --with-arch=rv32gc --with-tune=rocket ‘CFLAGS_FOR_TARGET=-Os -mcmodel=medlow’ ‘CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow’
Thread model: single
gcc version 9.2.0 (GCC)
The PlatformIO packages contain the toolchain, openocd, and dfu-util. Here is what I have tried (just guessing):
The toolchain is not the one which is in PlatformIO. To compile you have to install the prerequisites described in each project.
As a temporary workaround I have created a fork with support for MacOS tooling: https://github.com/yesitsme007/platform-gd32v-mac-unofficial. It uses a probably slightly older toolchain and is more or less untested. I could compile and upload an Arduino blink example. More information can be found on the project page. I am not sure how useful this is, but maybe it helps and you might give it a try.
Thanks! I will try them.
I do not use platformio but eclipse on mac: Eclipse CDT, Gnu Mcu Eclipse (I installed the xpack from https://xpack.github.io/riscv-none-embed-gcc/install/ for riscv-none-embed-gcc), and from (https://github.com/riscv-mcu: dfu-utils, openocd and GD32VF103_Firmware_Library.
This is an old thread, but for the benefit of those finding this via search, the easiest way to get a good GNU chain on MacOS is via homebrew. https://github.com/riscv/homebrew-riscv Two commands and you’re done. Remember to include the --with-multilib flag for GD32V support because the default is 64-bit only.
We recently even landed changes to allow hosting on M1. Works great.