SiFive have made available pre-built versions of GCC and openocd on their software page. You can visit that page and scroll down until you find the GCC and openocd links, or you can use the convenience links below (which I’ll try to keep updated):
- riscv-openocd-0.10.0-2020.12.1 for Windows (64-bit)
- riscv-openocd-0.10.0-2020.12.1 for macOS (64-bit)
- riscv-openocd-0.10.0-2020.12.1 for Linux (CentOS 6 64-bit)
- riscv-openocd-0.10.0-2020.12.1 for Linux (Ubuntu 64-bit)
For the Linux versions, libusb and libftdi can cause problems. (Why oh why don’t they statically link these libraries?!?)
I tried both the CentOS and Ubuntu versions on my laptop (a Gentoo-based chroot on a Chromebook) and found that the Ubuntu version needed but didn’t bundle a copy of
libftdi.so. The CentOS version did, and while it is dynamically linked to
libusb.so, the archive contains a local copy – but needs some help in order to find it..
I’ve modified the
target/RISC-V/start-openocd.sh script to be more flexible about how it locates libusb, to make all this a bit easier. Edit that file and change the
openocd variable so it references your local copy of the RISC-V
openocd, and point the
libusb_dir at a directory that contains libusb. If you are using the CentOS version, then
<wherever>/riscv-openocd-<version>-x86_64-linux-centos6/lib will work.
The Mac version worked without any library problems.
Return to exploring RISC-V with muforth.