How to get Freedom E SDK working?

Hi,

i’m new to the SparkFun Red-V Microcontroller and previously only worked with Arduino’s - have a hard time getting the Freedom E SDK to work.

I’ve downloaded the prebuilt toolchain from SiFive and got it running using their Freedom E SDK, so that i can compile the samples like ‘hello’ with success. However, i don’t want to target a HiFive board, but a Red-V instead, so i pulled the SDK from SparkFun but didn’t got it working:

git clone --recursive https://github.com/sparkfun/freedom-e-sdk.git
cd freedom-e-sdk
make TARGET=sparkfun-redv PROGRAM=hello software

This yields the following error:

scripts/standalone.mk:253: *** missing 'endif'. Stop.

At first i thought this probably has something to do with the SDK being outdated compared to the SiFive one, so i tried the one Forum Member Dana6jq maintains, which is on par with upstream and also has the Red-V BSP included. Same procedure as above, with the following result:

. /home/egon/tmp/sifive/freedom-e-sdk/venv/bin/activate && scripts/devicetree-overlay-generator/generate_overlay.py --type sparkfun-redv --output /home/egon/tmp/sifive/freedom-e-sdk/bsp/sparkfun-redv/design.dts --rename-include core.dts /home/egon/tmp/sifive/freedom-e-sdk/bsp/sparkfun-redv/core.dts
Type 'sparkfun-redv' is not supported, please choose one of: rtl, arty, qemu, hifive, spike, vc707, vcu118
make: *** [scripts/libmetal.mk:32: /home/egon/tmp/sifive/freedom-e-sdk/bsp/sparkfun-redv/design.dts] Error 1

Any ideas what i did wrong? I’m running on Ubuntu 20.04 with the following compiler:

riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14
riscv-openocd-0.10.0-2020.12.1-x86_64-linux-ubuntu14

I took a quick look and it looks like editing scripts/standalone.mk and going to about line 43 (after the ‘LINK_TARGET = ramrodata’ line) and duplicating one of the " endif" lines should fix the missing ‘endif’ error.

Looks like the bug was introduced with commit f59858b “adding sparkfun-red-v”

Thanks for your reply!

As it turned out after reading the SparkFun Developer Guide, using the official SiFive Freedom E SDK also works when using the Target “SiFive HiFive1 Rev B” as the Red-V is almost a clone of it, just missing the Wifi.