RISC-V processors are everyday more used in many different applications. This is why companies like Canonical are releasing their Linux distributions for devices based on RISC-V. One of the latest devices added to this family is the Microchip’s Icicle Kit, a development board from Microchip based on the PolarFire SoC, a set of five RISC-V cores, four of them for the application and another one used as a kind of platform manager, and a PolarFire FPGA. In this blog, we already have used the PolarFire SoC and the Icicle Kit, but this time we are going to use the board to run Ubuntu 22.04.

First of all, although we are not going to create a new development for the PolarFire SoC, we need to install Libero in order to configure the device. Since I use Ubuntu as my main OS, the installation of the license of Libero, is more difficult than the installation on Windows, since using Linux you have to use a License Server running either on your local host or in a remote server.

Installing Libero License

I have Libero installed in an external SSD that I use in different computers. To verify that Libero can be executed in this computer, we need to execute the script check_linux_req.sh, located in the Libero install folder.

pablo@friday:~$ /media/pablo/ext_ssd0/Libero_SoC_v2022.2/Libero/bin/check_linux_req/check_linux_req.sh

This script will inform us of the packages that we don’t have installed and we need to install, so we only need to execute the command to install them.

pablo@friday:~$ sudo apt install -y libfontconfig1:i386 libfreetype6:i386 libglib2.0-0:i386 libice6:i386 libsm6:i386 libuuid1:i386 libxdamage1:i386 libxrender1:i386 xfonts-intl-asian xfonts-intl-chinese xfonts-intl-chinese-big xfonts-intl-japanese xfonts-intl-japanese-big libxft2:i386 libgtk2.0-0:i386 libcanberra-gtk-module:i386 libfreetype6-dev

Wit all the packages installed, we can be sure that Libero will be executed without problems. Now is the time for the license. Microchip offsers different kind of licenses, some of them free of charge. This is the case of the Silver license, which we can download by clicking on Register a free license in the Microchip’s webpage and the license will arrive to our inbox. Remember that for Linux OS, you need to select the Floating License. In order to run the license manager, Microchip has a very well-explained guide.

One of the steps that you have to execute is to create the LM_LICENSE_FILE environment variable. To do that on Ubuntu, I have added it to the .bashrc,

pablo@friday:~$ gedit .bashrc

Inside the .bashrc, we only need to add the following line at the end of the file.

export LM_LICENSE_FILE=1702@localhost:$LM_LICENSE_FILE

Once we have the license server files and the license ready, to run the serer we need to execute a command. Since my memory is not too long, I use to create an script file named run_microsemi_license.sh that will run the license server. The content of this file is the next.

~/Linux_Licensing_Daemon/lmgrd -c ~/flexlm/License.dat -log /tmp/lmgrd.log

Maybe the firs time you execute the command, you get the next error.

lmgrd: No such file or directory

This is because you need to install the package lsb. Once installed, the server will run.

sudo apt install lsb

Now we need to install the drivers for the FlashPro 6 JTAG. To do that we ned to navigate to the Libero installation folder, and execute the file fp6_env_install.

pablo@friday:~$ sudo /media/pablo/ext_ssd0/Libero_SoC_v2022.2/Libero/bin/fp6_env_install 
[sudo] password for pablo: 
FP6 set successfully in /etc/cyusb.conf.
FP6 set successfully in /etc/udev/rules.d/88-cyusb.rules.
Please unplug and plug FP6 hardware to the machine. It is necessary for the OS to take it into account.

At this point, we have all the needed installed on our computer. The next is programming the icicle kit with the reference design.

Icicle kit Reference Design

To run Ubuntu, or any other design, in any SoC based on FPGA, like the PolarFire SoC, we need first to configure the device in order to have the correct hardware on the FPGA side. For the Icicle kit, Microchip gives us the Icicle Kit Reference Design, which is located in a GitHub repository. On that repository we can find different Reference Design Releases. The last release is the 2023.2, and this is what we are going to install.

Once we have the design downloaded, we will have a .job file that contains the bitstream for the PolarFire SoC, and also the First Stage Bootloader, which for the Icicle Kit is named Hart Software Services (HSS). To configure this bitstream into the device, and load the HSS, we need to create open the application FlashPro Express, located in the Libero install folder and create a new project using the .job file downloaded.

The Icicle kit has different USB connectors. The one used for the JTAG connection is J33.

Now by clicking on RUN, the design will be sent to the PolarFire SoC, and after a few seconds, the design will be ready.

Downloading Ubuntu for the Icicle Kit

Now is the time to download the Ubuntu image. if we navigate to the official Ubuntu page for the Icicle Kit, we can see that the required version for the HSS is 2022.10. Since the version we have installed is the newest, I assumed that it is also supported. Now we can navigate to the download page, and download the image.

The file downloaded has the extension .img.xz. In order to write the image into an SD card, we can use the command xzcat to decompress the image, and the dd command to write the files into the SD card.

pablo@friday:~$ xzcat ./Downloads/ubuntu-22.04.2-preinstalled-server-riscv64+icicle.img.xz | sudo dd bs=1M conv=fsync of=/dev/sdc

Running Ubuntu

Finally is time to insert the SD card into the socket of the Icicle kit, and turn on the board. To connect to the Linux terminal, we need to connect the USB cable in the J11 socket, which will generate 4 COM ports in or computer. The port ttyUSB1, if you are using Ubuntu in your host machine, will be the port where we can check the boot of Ubuntu in the Icicle kit.

pablo@friday:~$ putty -serial /dev/ttyUSB1 -sercfg 115200,8,n,1,N &

The next two images are corresponding with the boot process of Ubuntu in the Icicle Kit. the credentials are ubuntu:ubuntu.

In the first boot, the SO will ask you to change the default password.

Microchip, in collaboration with some other companies, is taking big steps to reaching other classic FPGA companies, and not just that, but they are also betting on fairly new technology such as RISC-V. I always have thought that, if you are the newest in a field where they are already big opponents, you have to make things different in order to be at the same level as them. It is also true that using RISC-V has some risks, for example, most of the companies that develop embedded software are using ARM, and changing to RISC-V could be a little bit risky, but remember that ARM was in the same position with the x86 processors. RISC-V is new, yes, but it is also different, and this gives RISC-V a reason to be, at least, considered, and devices like PolarFire SoC are a good option to start with.