If you want to use the HiFive1 with muforth you currently have to use the RISC-V port of openocd. You could download the source and build it, but there is an easier way!

Getting pre-built binaries from SiFive

SiFive have made available pre-built versions of GCC and openocd on their boards and 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):

Messing about with dynamically-linked libraries

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.

When I originally wrote this page in 2017 I created issues (#23 and #24) against the pre-built openocd binaries. The Mac situation has improved, but Linux is still somewhat messed up.


Return to exploring RISC-V with muforth.