Skip to content
Michael Welling edited this page Dec 5, 2021 · 34 revisions

LoFive Documentation

LoFive is a lightweight SiFive Freedom E310 open source SoC evaluation kit. The E310 leverages the Free and Open RISC-V Instruction Set Architecture originally developed by UC Berkeley and now has wide industry support via the RISC-V Foundation.

Table of Contents

Specifications

  • MCU – SiFive Freedom E310 (FE310) 32-bit RV32IMAC processor @ up to 320+ MHz (1.61 DMIPS/MHz)
  • Storage - 128-Mbit SPI flash (ISSI IS25LP128)
  • Expansion - 2x 14-pin headers with JTAG, GPIO, PWM, SPI, UART, 5V, 3.3V and GND
  • Misc - 1x reset button, 16 MHz crystal
  • Power Supply - 5V via pin 1 on header; Operating Voltage: 3.3 V and 1.8 V
  • Dimensions - 35.56 x 17.78 mm / 1.4 x 0.7 in
  • License - CERN Open Hardware Licence v1.2

Schematic

R1

R0

Installing LoFive Enabled Freedom-E SDK

The Freedom-E SDK port for LoFive hosted here: LoFive Freedom-E SDK

Cloning the SDK

git clone --recursive https://github.com/mwelling/freedom-e-sdk.git
cd freedom-e-sdk

Checking out legacy SDK for Lofive R0

git checkout lofive
git submodule update --init --recursive

Note: The legacy SDK builds the toolchain and utilities from scratch. Refer to the README on this branch for more information.

Checking out new SDK for Lofive R1

git checkout lofive-r1
git submodule sync
git submodule update --init --recursive

Note: The new SDK uses a pre-built toolchain and openocd. Refer to the README on this branch for more information.

Configuring host for FT2232H-56Q FTDI UART breakout

In order to use the FTDI breakout from a non-root user a few steps are required to enable access.

First the udev rules need to be installed:

wget https://raw.githubusercontent.com/riscv/riscv-openocd/riscv/contrib/60-openocd.rules
sudo mv 60-openocd.rules /etc/udev/rules.d

Next add your user to the plugdev group:

sudo adduser $(whoami) plugdev

Next restart udev service and logout of the current session:

sudo service udev restart
exit

Now a new console, cd into the SDK directory and you should be ready to use the FTDI programmer using the instructions below.

Programming using FT2232H-56Q FTDI UART breakout

Connecting FT2232H-56Q to LoFive

The on-board flash is programmed via JTAG and a special RISC-V version of OpenOCD built into the Freedom-E SDK. LoFive currently supports using the FT2232H-56Q Mini MDL FTDI breakout adapter.

Wire the breakout adapter as follows:

LoFive Pin FTDI Breakout Pin
+5Vin VBS
GND GND
TRSTN AD5
TCK AD0
TDO AD2
TMS AD3
TDI AD1
UART0.TX BD1
UART0.RX BD0

This will power the board and allow you to program with the LoFive enabled Freedom-E SDK linked above.

Programming to LoFive R0 using the legacy SDK

Programming LoFive with a demo

Once the SDK is installed and compiled you can load the code via make commands.

For instance to compile and load the LED fade demo:

make software PROGRAM=led_fade BOARD=freedom-e300-lofive
make upload PROGRAM=led_fade BOARD=freedom-e300-lofive

Note: This SDK only supports running on Linux.

Programming the bootloader

Some of the early units of the LoFive may have been deployed without the bootloader installed. If a previously loaded program does not load automatically on reset or power cycle the bootloader is likely not installed.

To program the bootloader to the LoFive run the following from the Freedom-E SDK:

make software upload PROGRAM=double_tap_dontboot BOARD=freedom-e300-lofive-blank

Programming to LoFive R1 using the new SDK

Programming the bootloader

make PROGRAM=lofive-boot TARGET=lofive-r1-bootloader upload 

Note: You only have to run this once to load the initial bootloader.

Programming a demo

make PROGRAM=sifive-welcome TARGET=lofive-r1 upload