← richliu.com / Post
中文 EN

Running RISC-V Linux on Lattice Versa ECP5 EVB

2025-09-21 RISC-V FPGA ECP5 LiteX Embedded

This post extends an earlier article on building a RISC-V environment. The goal here is getting a full Linux boot on the Lattice Versa ECP5 EVB — which turned out to require one non-obvious fix.

The Key Problem: Wrong Chip Variant

Boards sold on the market use the LFE5UM-45F, not the default target of LFE5UM5G-85F that tools assume. My Taobao board was the older "non-5G" variant, causing ID mismatches when flashing.

Fix: Explicitly specify the device when building:

./make.py --device LFE5UM \
          --board=versa_ecp5 \
          --cpu-count=1 \
          --build

Hardware Prep

Before powering on, set the J50 jumper to bypass iSPclock — without this, the board may not boot correctly.

Once connected via USB, the FT2232H presents two devices:

Flashing the Bitstream

openFPGALoader -b ecp5_evn versa_ecp5.bit

udev Rules for FTDI Access

Create /etc/udev/rules.d/99-ftdi.rules:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", \
    MODE="0664", GROUP="plugdev"
sudo udevadm control --reload-rules
sudo udevadm trigger

Dual-Core SMP

The LFE5UM-45F supports dual-core SMP configurations. To enable: pass --cpu-count=2 to make.py.

Boot

With everything configured correctly, the Linux kernel boot messages appear on ttyUSB1, eventually dropping into a RISC-V Linux shell. Running a full Linux OS on a soft-core RISC-V CPU synthesized onto an FPGA is one of those things that never gets old.