How to Build "riscv64-unknown-elf-gcc"

Hello, I am trying to get the Freedom E SDK working for my HiFive1 and I am currently stuck at:

/bin/sh: 1: riscv64-unknown-elf-gcc: not found
(standard_in) 1: syntax error
make: *** No rule to make target 'tools'.  Stop.

I have already setup my $PATH to point at /opt/riscv/bin. I have also built the GNU RISC-V toolchain for Linux and it does not seem to build “riscv64-unknown-elf-gcc”. What am I missing?

I am a hobbyist and do not program all of the time so I may be missing something that may seem obvious to a programmer.

Did you remember to set the RISCV_PATH variable? This is a pretty common mistake IIRC.

I added it to my $PATH. Can you be more specific? What is yours set like? Perhaps I am doing it wrong.

I’m referring to the instructions here: https://github.com/sifive/freedom-e-sdk#install-the-risc-v-toolchain-and-openocd

1 Like

Freedom-E-SDK assumes you’re using a toolchain provided by SiFive (see link in previous message).

It’s possible to get things to work with a custom toolchain, but it almost certainly will require some Makefile hacking. Rereading your first message, I’d especially caution against attempting to use a “Linux” toolchain unless you’re an expert in this area.

1 Like

… So, im seeing there is supposed to be a download — for example for “RISC-V GNU Toolchain”. It links to the boards page. Specifically I need the one for the HiFive1 A01 here: https://www.sifive.com/boards/hifive1 but I cannot find these downloads… They just link to the Freedom E SDK Github repo: https://github.com/sifive/freedom-e-sdk

The toolchain I was using to try to get this working actually came from a web search: https://github.com/riscv/riscv-gnu-toolchain

WHere is the toolchain provided by SiFive? Have a link?

We used to have a “boards” page that had both board info and software info. The software info is now on a separate software page. So the freedom-e-sdk info should be updated. See
https://www.sifive.com/software

2 Likes

@davidpgil: thanks for spotting these inconsistencies between the FESDK docs and our website. The FESDK docs should now be updated with the link @jimw provided. We’re working on updating the “boards” pages accordingly.

EDIT: website is now updated too. Thanks again for the bug report.

1 Like

OK – this helped my stop the error. So I think this issue is solved – sort of. I am stuck in a different way now. I will open a new thread. Thanks.