Install Ubuntu on the SiFive HiFive Unmatched

The SiFive HiFive Unmatched is a RISC-V based SBC.

Using the pre-installed server image

  1. Download one of the supported images:

  2. Flash the pre-installed server image to a microSD card (see Flash images to a microSD card)

  3. Insert the microSD card into the board

  4. Set the boot source to the microSD card (see Boot source selection)

  5. Connect to the UART console (see UART console and Connect to a UART console)

  6. Power on the board

  7. Wait for an output line confirming that cloud-init has finished running; this service is responsible for generating SSH keys, and creating the default user:

    [   35.682018] cloud-init[909]: Cloud-init v. 24.1.3-0ubuntu3 finished at Tue, 23 Apr 2024 07:44:59 +0000. Datasource DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net].  Up 35.65 seconds
    
  8. Login with the user ubuntu and the default password ubuntu; you will be asked to choose a new password

Using the live server image

The live installer image is used to install Ubuntu to an NVMe drive attached to the M.2 slot on the board.

  1. Download one of the supported images:

  2. Flash the pre-installed server image to a microSD card (see Flash images to a microSD card)

  3. Insert the microSD card into the board

  4. Set the boot source to the microSD card (see Boot source selection)

  5. Connect to the UART console (see UART console and Connect to a UART console)

  6. Power on the board; if there is no operating system already on the NVMe drive, skip to step 9

  7. When “Hit any key to stop autoboot” is displayed, press Enter

  8. Enter the following commands to boot the installer:

    pci enum
    nvme scan
    load mmc 0:1 $fdt_addr_r dtb/sifive/hifive-unmatched-a00.dtb
    load mmc 0:1 $kernel_addr_r EFI/boot/bootriscv64.efi
    bootefi $kernel_addr_r $fdt_addr_r
    
  9. From the GRUB menu, select “Try or Install Ubuntu Server”

  10. Loading the installer takes some time. Once it is loaded, follow the Ubuntu Server installation tutorial

  11. Once the installation is complete, reboot the board without removing the microSD card

  12. Press Enter when “Hit any key to stop autoboot” is displayed, and enter:

    pci enum
    nvme scan
    efidebug boot add -b 0001 'Ubuntu' nvme 0:1 /EFI/ubuntu/grubriscv64.efi
    efidebug boot order 0001
    bootefi bootmgr
    
  13. On the next boot, U-Boot will automatically start GRUB

Note

U-Boot does not allow the operating system to write UEFI variables. You can do this manually using U-Boot’s eficonfig command.

Installing the Gnome desktop

If you have a graphics card installed, you may want to use a graphical desktop. The Gnome desktop can be installed with

sudo apt update
sudo apt install ubuntu-desktop
sudo systemctl start gdm3

Boot source selection

The SiFive HiFive Unmatched board can boot firmware from the built-in flash memory, or from the microSD card. The boot source is selected via DIP switches.

MSEL3

MSEL2

MSEL1

MSEL0

Boot Source

0

1

0

1

QSPI0 Flash

0

1

1

0

QSPI0 Flash

0

1

1

1

QSPI1 Flash

1

0

0

0

QSPI1 microSD Card

1

0

0

1

QSPI2 Flash

1

0

1

0

QSPI0 Flash

1

0

1

1

QSPI2 microSD Card (default)

1

1

0

0

QSPI1 Flash

1

1

0

1

QSPI1 Flash

1

1

1

0

QSPI0 Flash

1

1

1

1

QSPI0 Flash

On Ubuntu, the only supported setting is the default QSPI2 microSD card setting of 1011 as illustrated below:

Boot from microSD card with the default setting of 1011

Warning

On version 2 of the HiFive Unmatched boards, the silk screen showing the orientation of the MSEL DIP switches is incorrect and should be ignored (follow the settings on the image above). The suffix of the board assembly number label indicates the board version, e.g. the 2 in HF105-ASSY-2A0 indicates board version 2.

Cloud-init seed

Sample files for a cloud-init seed are present on the FAT partition labeled “CIDATA”. See Configure your board for headless use for more information.

UART console

The board makes both JTAG and UART available over the micro USB connector located adjacent to the microSD card slot, hence this board does not require a USB-UART adapter. Connect with a regular micro-USB cable.

When connected, it appears as two separate devices in Linux. The first UART (typically /dev/ttyUSB0) is JTAG, and the second (typically /dev/ttyUSB1) is the UART console. Connect with the following settings (see Connect to a UART console):

  • 115200 baud

  • 8 data bits

  • no parity

  • 1 stop bit

  • no flow control

However, please note the boot ROM messages are written at 57600 baud.