Unboxing the Sparkfun RISC-V RedBoard

The RED-V Board Brings the RISC-V Instruction Set Architecture to an Arduino-like Package

You may have heard about a relatively new type of computing device called the RISC-V (pronounced “risk-five”).  The RISC-V is a newcomer to the embedded ecosphere, so there weren’t too many low-cost platforms for evaluating these systems until recently.

Today, I’m taking an initial look at the DEV-15594 “RED-V” board from Sparkfun Electronics.

Notice of Non-Affiliation and Disclaimer: We are not affiliated, associated, authorized, endorsed by, compensated by, or in any way officially connected with Sparkfun Electronics, SiFive, Segger Microcontroller Systems, RISC-V Foundation, Arduino, Microchip, NXP or their subsidiaries or affiliates.

RedBoard Hardware Overview

Arduino users will probably notice the familiar footprint of the RED-V RedBoard.  The DEV-15594 has the same header type and basic dimensions as the Arduino Uno R3 and similarly-styled boards.

Unlike the Arduino however, this system features the SiFive Freedom E310.  The chip is also called the “FE310” in technical literature, and this is what is printed on the physical device itself.  The Freedom E310 and others like it are based on the RISC-V instruction set architecture (ISA).

A circuit board

Description automatically generated
Figure 1: The RED-V Board Uses its Default Application to Blink the Blue Indicator Light

“RISC” is short for Reduced Instruction Set Computer.  This is the general classification for computers such as the ATmega microcontrollers normally found on the Arduino Uno and other small embedded systems.  According to the RISC-V Foundation, this particular ISA was started in 2010 as part of the University of California at Berkeley’s Parallel Computing Laboratory.

The RISC-V ISA was devised to be an open-source hardware ISA.  The advantages and tradeoffs of this open-source approach are outside the scope of this unboxing, but the RISC-V Foundation points out this makes the ISA royalty-free for developers—and makes the iterative design of RISC-V-based devices more economically feasible for smaller startups.

The architecture is modular, with variants covering 32-bit, 64-bit, and 128-bit address spaces as of the year 2019.  The base ISA uses 32-bit instruction encoding with support for variable-length instructions.

Objective

The FE310 isn’t just a microcontroller, but is an entire customized system-on-chip (SoC), meaning that the processor and the caches constitute just a small part of the chip.  But for today, we’re just covering the fundamentals:

  1. Installing the requisite software (Freedom Studio);
  2. Installing the RISC-V and SEGGER J-Link drivers;
  3. Building an example application ;
  4. Flashing the application to the RED-V board
Figure 2: The RED-V Board (Annotated)

The RED-V board also includes the NXP Semiconductor Kinetis K22 chip.  This is an ARM Cortex-M4 device responsible for uploading applications to the SiFive Freedom E310 core.  The Kinetis chip provides USB functionality by way of the J-Link firmware pre-loaded onto it.

There is also an on-board flash memory chip that can store 32 Mbits even when power is removed.  The flash uses a Quad Serial Peripheral Interface (Quad SPI or QPI) interface.  The exact part number isn’t called out in the official schematic, but the markings indicate an Integrated Silicon Solution Inc. IS25LP032.

Hardware Materials Used

All the basic technical documents required to get the system running are published on Sparkfun’s official Red-V RedBoard Hookup Guide.  The only hardware required other than a host computer and the RED-V board itself is a USB-C cable.

Hardware Used:

  • RED-V RedBoard
  • USB Cable: Type A (USB 3.1) to Type C
  • Desktop PC running Windows 10, 64-bit

Software Resources Used

For this build, I downloaded the Freedom Studio application version: 2019.08.2 for Windows 10.  The software is based on the Eclipse platform; much like other development environments we’ve used here.  It comes pre-bundled with RISC-V GNU Compiler Collection toolchain.  This—along with the Freedom Studio User Manual—was recommended by SiFive as the fastest way to get started.

Software Used:

  • Freedom Studio 2019.08.2
  • (Required) No spaces in the installation directory
  • (Required) Windows long path must be set to enabled in the registry

Freedom Studio was available from the SiFive website as FreedomStudio-2019-08-2-win64.zip.  Before doing anything with it, read any parts of the manual that pertain to your operating system.

Important Notice for Windows Users

Before you install anything: first know you should choose an installation directory that doesn’t contain spaces.  This is rule #1 in the official manual.

Secondly, you should enable Windows Long Path support using the standard Windows Registry Editor (“regedit”).  Full instructions for this are included in the Freedom Studio manual.

A screenshot of Windows Registry Editor

Description automatically generated
Figure 3: A Screenshot of Windows Registry Editor (RegEdit) with LongPathsEnabled = 1

Freedom Studio Installation

After scanning the Freedom Studio download for malware (always scan files from the outside world), I extracted the .zip file to the directory where I wanted Freedom Studio to reside. 

Once everything was unzipped, I ran the executable FreedomStudio.exe.  Windows security may prompt you for confirmation first, but it should run.

Once the Freedom Studio environment loads, you will probably see the following welcome form.

A screenshot of a social media post

Description automatically generated
Figure 4: The SiFive Welcome Screen

Pause here, and navigate to Windows file explorer to prepare the hardware drivers.

HiFive Driver Installation

Next, it was time to locate the driver installers that were included with Freedom Studio. 

In file explorer: I navigated back to the installation directory where FreedomStudio.exe was now located.  Let’s call that directory FreedomStudio-2019.08.  From there, I navigated to SiFive –> Drivers and then ran the application: HiFive1_Driver.exe.  This ran an installation wizard to set up the appropriate driver.

A screenshot of a cell phone

Description automatically generated
Figure 5: SiFive HiFive1 FTDI Drivers Ready to Support the RED-V RedBoard

J-Link Driver Installation

Next, it was time to install the SEGGER/J-Link drivers.  Without them, you will likely encounter the “Connecting to J-Link failed” message when you try to upload your code to the RED-V board.

To install: I also navigated to FreedomStudio-2019.08\SiFive\jlink-6.52.5-2019.08.0\USBDriver.  My desktop uses an Intel x64 processor, and so I went to the “x64” folder to run the dpinst_x64.exe application in administrator mode.  If you have a different processor, you will need to use a different folder other than the x64 folder.

A screenshot of a cell phone

Description automatically generated
Figure 6: Successful Driver Installation

You can try to confirm the new drivers are working properly by using Window’s Device Manager.  As usually, Device Manager will mark any missing or misconfigured drivers with a yellow “general caution” symbol (⚠).

Create a New Freedom E SDK Project

Back in Freedom Studio, I selected “I want to create a new Freedom E SDK Project.”  This launches the Create a Freedom E SDK Project interface.

A screenshot of a social media post

Description automatically generated
Figure 7: Selecting “I want to create a new Freedom E SDK Project”

Next, we enter the Create a Freedom E SDK Project form.  According to Sparkfun, the SiFive HiFive1 Revision B board is similar to our RED-V board, so it will serve as the target.  Choose “sifive-hifive1-revb” in the drop-down box.

Figure 8:Creating a New Freedom E SDK Project

Second, we want to load the example program “hello.”  This program will use the printf method to send “Hello World” from the FE310 to Freedom Studio’s serial terminal where we can read it.  With the project names selected, click “Finish” to proceed.  Freedom Studio should automatically build the example application at this point.

Edit Configuration

After the sketch builds, the Edit Configuration window will appear.  For now, I choose to click “close.”

Figure 9:The Edit Configuration Form

Closing the Edit Configuration form should bring you to the main development environment.

A screenshot of a computer screen

Description automatically generated
Figure 10: The Freedom Studio Environment

Begin Debugging (Application Upload)

To upload the application to the RED-V board, we need to access the Run Configurations dialog.  I did this by navigating to the far-left side of the IDE to the “Project Explorer” area.  I then right-clicked my project name (at the top of the tree) and then navigated to Run As –> Run Configurations.

Alternatively, I could have also reached the drop-down menu next to the green “run” button at the top of the environment…

A screenshot of a cell phone

Description automatically generated
Figure 11: “Run Configurations” as Seen from the Main Development Environment

In the Run Configurations screen, I expanded the option for “SiFive GDB SEGGER J-Link Debugging.”  This yielded sifive-hifive1-revb-hello as a selectable option.  With the project selected, you can simply click the run button.

Figure 12: The Run Configuration Dialog Has Been Configured to Run the SiFive GNU Debugger (GDB) SEGGER J-Link Option

Within moments, the GDB (short for GNU Debugger) server should be automatically configured and launched; and the “hello” application will be on its way to the RED-V board.  If you encounter an error here, it is a strong indication that your drivers did not install completely.

Figure 13: The GNU Debugger (GDB) Initializing

If the process is successful, the console area near the center of Freedom Studio should generate a long report ending with the message “Starting target CPU.”

Open FreedomStudio’s Terminal

To read the “hello world” message, you will probably need to configure Freedom Studio’s terminal.  By default, mine was configured to use COM1, which displayed nothing.  To configure: navigate to the lower-right of the environment and click the “Terminal” tab. 

Figure 14:Configuring the Terminal To Use Ports Other Than COM1

At this point, it may be worth opening Window 10’s Device Manager to reveal the correct COM port.  Device Manager groups the RED-V board’s COM ports in the “Ports (COM & LPT)” category.  In my case, there were two identical devices marked as:

  • JLink CDC UART Port (COM8)
  • JLink CDC UART Port (COM9)

The correct device turned out to be COM8, which I configured below.

Figure 15: Configuring a New Serial Terminal for 115200 Baud, 8 Bits, No Parity, 1 Stop Bit

The terminal was now prepared to receive the string.  I relaunched the application on the device by first navigating to the top of the Freedom Studio environment and pressing the “terminate” button (the red square/stop symbol), followed by the green run button again. 

Figure 16: Successful Contact from the RED-V

Conclusions

This concludes our initial look at the FE310 and RED-V board: hopefully with more projects to come.  It’s worth noting that the full guide on getting started (including modifying the example program to blink the LED is published on the Sparkfun official site.

References

[1] Sparkfun Electronics, “SparkFun RED-V RedBoard – SiFive RISC-V FE310 SoC,” Sparkfun Electronics, [Online]. Available: https://www.sparkfun.com/products/15594. [Accessed 11 Dec. 2019].
[2] D. A. Patterson and D. R. Ditzel, “The case for the reduced instruction set computer,” ACM SIGARCH Computer Architecture News, vol. 8, no. 6, pp. 25-28, 1980.
[3] Arduino AG, “Arduno(TM) UNO Rev3,” [Online]. Available: https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf. [Accessed 12 Dec. 2019].
[4] RISC-V Foundation, “RISC-V History,” RISC-V Foundation, [Online]. Available: https://riscv.org/risc-v-history/. [Accessed 12 Dec. 2019].
[5] Y. Lee, A. Waterman, H. Cook, et. al., “An agile approach to building RISC-V microprocessors,” IEEE Micro, vol. 36, no. 2, pp. 8-20, Mar 2016.
[6] A. Waterman, Y. Lee, R. Avizienis, H. Cook, D. Patterson and K. Asanovic, “The RISC-V instruction set,” in IEEE Hot Chips 25 Symposium (HCS), Stanford, CA, USA, 2013.
[7] A. Waterman, Y. Lee, D. A. Patterson and K. Asanovic, “The RISC-V Instruction Set Manual, Volume I: Base User-Level ISA,” 13 May 2011. [Online]. Available: https://www2.eecs.berkeley.edu/Pubs/TechRpts/2011/EECS-2011-62.pdf. [Accessed 12 Dec. 2019].
[8] K. Asanovic and D. A. Patterson, “Instruction Sets Should Be Free: The Case For RISC-V,” 6 Aug. 2014. [Online]. Available: https://www2.eecs.berkeley.edu/Pubs/TechRpts/2014/EECS-2014-146.pdf. [Accessed 12 Dec. 2019].
[9] NXP Semiconductor, “MK22FN128VLL10 Product Information|NXP,” NXP Semiconductor, [Online]. Available: https://www.nxp.com/part/MK22FN128VLL10#/. [Accessed 12 Dec. 2019].
[10] Sparkfun Electronics, “RED-V RedBoard Hookup Guide,” Sparkfun Electronics, [Online]. Available: https://learn.sparkfun.com/tutorials/red-v-redboard-hookup-guide. [Accessed 12 Dec. 2019].
[11] SiFive, Inc., “Freedom Studio User Manual,” SiFive, Inc., 2 Aug. 2019. [Online]. Available: https://static.dev.sifive.com/dev-tools/FreedomStudio/2019.08/freedom-studio-manual-4.7.2-2019-08-2.pdf. [Accessed 12 Dec. 2019].
[12] SiFive, Inc., “Software,” SiFive, Inc., [Online]. Available: https://www.sifive.com/boards/#software. [Accessed 12 Dec. 2019].
[13] Sparkfun Electronics, “RED-V Development Guide,” Sparkfun Electronics, [Online]. Available: https://learn.sparkfun.com/tutorials/red-v-development-guide. [Accessed 12 Dec. 2019].

Notice of Non-Affiliation and Disclaimer: As of the publication date, we are not affiliated, associated, authorized, endorsed by, compensated by, or in any way officially connected with Sparkfun Electronics, SiFive, Segger Microcontroller Systems, RISC-V Foundation, Arduino, Microchip, NXP or their subsidiaries or affiliates.

The names of Sparkfun Electronics, SiFive, Segger Microcontroller Systems, RISC-V Foundation, Arduino, Microchip, NXP as well as related names, marks, emblems, and images are trademarks of their respective owners.

Important Notice: This article and its contents (the “Information”) belong to Unboxing-tomorrow.com and Voxidyne Media LLC. No license is granted for the use of it other than for information purposes. No license of any intellectual property rights is granted.  The Information is subject to change without notice. The Information supplied is believed to be accurate, but Voxidyne Media LLC assumes no responsibility for its accuracy or completeness, any error in or omission from it or for any use made of it.  Liability for loss or damage resulting from any reliance on the Information or use of it (including liability resulting from negligence or where Voxidyne Media LLC was aware of the possibility of such loss or damage arising) is excluded.