Sifive Freedom E310 Arty Fpga Dev Kit Getting Started Guide
Sifive Freedom E310 Arty Fpga Dev Kit Getting Started Guide
Guide
c SiFive, Inc.
Copyright Notice
Copyright
c 2017, SiFive Inc. All rights reserved.
Information in this document is provided as is, with all faults.
SiFive expressly disclaims all warranties, representations and conditions of any kind, whether ex-
press or implied, including, but not limited to, the implied warranties or conditions of merchantabil-
ity, fitness for a particular purpose and non-infringement.
SiFive does not assume any liability rising out of the application or use of any product or circuit, and
specifically disclaims any and all liability, including without limitation indirect, incidental, special,
exemplary, or consequential damages.
SiFive reserves the right to make changes without further notice to any products herein.
Release Information
Version Date Changes
1.0.6 April 11, 2017 Some helpful hints for udev/screen
1.0.5 Jan 3, 2017 Corrections to udev rules
1.0.4 Dec 21, 2016 Corrections to Software Development Flow
1.0.3 Dec 19, 2016 Add Arduino IDE Instructions
1.0.2 Dec 10, 2016 Updates to match 1.0.2 of the MCS
1.0 Nov 29, 2016 First release
i
ii SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Contents
1 Required Hardware 1
1.1 Xilinx Artix-7 35T Arty FPGA Evaluation Kit . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 USB A to Micro-B Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Olimex ARM-USB-TINY-H Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.4 USB A to B Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.5 Male-To-Female Jumper Cables (10) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Board Setup 3
2.1 Connecting the USB Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Connecting the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
iii
iv SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
5.1 Adding the SiFive Dev Kits Board URL to your Arduino IDE . . . . . . . . . . . . . . 16
5.2 Selecting Freedom E310 Arty FPGA Dev Kit in the Arduino IDE . . . . . . . . . . . . 17
v
vi SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Chapter 1
Required Hardware
The Freedom E310 Arty FPGA Dev Kit requires the following hardware:
1
2 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
http://www.digikey.com/product-detail/en/assmann-wsw-components/AK672-2-1/AE1462-
ND/930247
Board Setup
3
4 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Figure 2.1: Debugging Connections between Olimex ARM-USB-TINY-H and Arty Board’s PMOD
header JD
Figure 2.4: Photo of the Arty Board showing USB and Debug Connections
6 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Chapter 3
The Xilinx Artix-7 XC7A35T FPGA configures on power-on from an on-board quad SPI flash chip.
The Freedom E310 Arty FPGA SPI flash programming file can be downloaded from:
https://dev.sifive.com/develop/freedom-e310-arty-dev-kit-v1-0
Use the “Configuration Memory File (.mcs)” download link.
The Xilinx Vivado Design Suite is used for flash programming. Both the Vivado Lab Edition and
WebPACK Edition 2016.1 support Artix-7 devices free of charge.
To program the SPI flash with Vivado:
1. Launch Vivado
2. Open Hardware Manager, open target board
3. Right click on the FPGA device and select ”Add Configuration Memory Device”
4. Select
Part n25q128-3.3v
Manufacturer Micron
Family n25q
Type spi
Density 128
Width x1 x2 x4
5. Click OK to ”Do you want to program the configuration memory device now?”
6. Add freedom-e310-arty-1-0-2.mcs
7. Select OK
8. Once the programming completes in Vivado, press the “PROG” Button on the Arty Board to
load the image into the FPGA.
7
8 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Chapter 4
The MCS file includes software for a simple demo program. This program is loaded to the SPI
Flash along with the FPGA image. On reset, the RISC-V core will execute a simple demo program
which prints a message over the UART and uses interrupts to blink and change the LEDs. This
program will be overwritten in the SPI Flash when you program new software into the board with
the SDK, but the FPGA image will not be modified.
9
10 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Using a terminal emulator such as GNU screen on Linux, open a console connection from the host
computer to the Freedom E310 Arty FPGA Dev Kit.
Set the following parameters:
Speed 115200
Parity None
Data bits 8
Stop bits 1
Hardware Flow None
You can use Ctrl-a k to “kill” (exit) the running screen session.
Depending on your setup, you may need additional drivers or permissions to communicate over
the USB port.
If you are running on Ubuntu-style Linux, the below is an example of steps you may need to follow
to access your dev kit without sudo permissions:
1. With your board’s debug interface connected, make sure your device shows up with the
lsusb command:
> lsusb
...
Bus XXX Device XXX: ID 0403:6010 Future Technology Devices
International, Ltd FT2232C Dual USB-UART/FIFO IC
2. Set the udev rules to allow the device to be accessed by the plugdev group:
Add the following lines and save the file (if they are not already there):
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403",
ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev"
# These are for the Olimex Debugger for use with E310 Arty Dev Kit
Copyright
c 2017, SiFive Inc. All rights reserved. 11
SUBSYSTEM=="usb", ATTR{idVendor}=="15ba",
ATTR{idProduct}=="002a", MODE="664", GROUP="plugdev"
SUBSYSTEM=="tty", ATTRS{idVendor}=="15ba",
ATTRS{idProduct}=="002a", MODE="664", GROUP="plugdev"
3. See if your board shows up as a serial device belonging to the plugdev group:
> ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1
(If you have other serial devices or multiple boards attached, you may have more devices
listed). For serial communication with the UART, you will always want to select the higher
number of the pair, in this example /dev/ttyUSB1.
> ls -l /dev/ttyUSB1
crw-rw-r-- 1 root plugdev 188, 1 Nov 28 12:53 /dev/ttyUSB1
4. Add yourself to the plugdev group. You can use the whoami command to determine your
user name.
> whoami your user name > sudo usermod -a -G plugdev your user name
5. Log out and log back in, then check that you’re now a member of the plugdev group:
> groups
... plugdev ...
Now you should be able to access the serial (UART) and debug interface without sudo permis-
sions.
12 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
SIFIVE, INC.
5555555555555555555555555
5555 5555
5555 5555
5555 5555
5555 5555555555555555555555
5555 555555555555555555555555
5555 5555
5555 5555
5555 5555
5555555555555555555555555555 55555
55555 555555555 55555
55555 55555 55555
55555 5 55555
55555 55555
55555 55555
55555 55555
55555 55555
55555 55555
555555555
55555
5
The Freedom E310 Arty FPGA Dev Kit’s boot code contains a jump to the external SPI Flash on
the board, at address 0x20400000. You can change the program which the dev kit runs by using
the debug/programming interface to flash a new compiled program into the SPI Flash.
SiFive supports two methods of obtaining the software development toolchain: compiling the Free-
dom E SDK from source, and installing precompiled tools using the Arduino IDE. The two tech-
niques will install the same set of tools, but the install paths and associated software libraries are
different.
Install all the necessary packages described in the repository’s README.md file.
To build the software toolchain:
cd freedom-e-sdk
make tools
13
14 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
cd freedom-e-sdk
git pull origin master
git submodule update --init --recursive
make tools
cd freedom-e-sdk
make software PROGRAM=demo gpio BOARD=freedom-e300-arty
cd freedom-e-sdk
make software PROGRAM=dhrystone BOARD=freedom-e300-arty
cd freedom-e-sdk
make upload PROGRAM=<your desired program> BOARD=freedom-e300-arty
cd freedom-e-sdk
make run debug PROGRAM=<your desired program> BOARD=freedom-e300-arty
This will automatically launch OpenOCD and GDB, connect to the board, and halt the currently
running program. You can step through the running program with stepi, or load the new program
using load. The usual suite of GDB commands are available to set breakpoints, examine and
modify memory, continue execution, etc.
5.3.1 Installing the Freedom E310 Arty FPGA Dev Kit Board Package
1. Download and install the Arduino IDE, following the instructions at
https://www.arduino.cc/en/Guide/HomePage
3. Navigate to File → Preferences and add the SiFive additional Board Manager URL as
shown in Figure 5.1:
http://static.dev.sifive.com/bsp/arduino/package_sifive_index.json
4. Add the SiFive development kit boards using the Board Manager:
Tools → Board → Board Manager.
Search for “SiFive” and click Install to download and install the package. Restart your Arduino
IDE, then find the Freedom E310 Arty FPGA Dev Kit under Tools → Board, as shown in
Figure 5.2.
Figure 5.1: Adding the SiFive Dev Kits Board URL to your Arduino IDE
Copyright
c 2017, SiFive Inc. All rights reserved. 17
Figure 5.2: Selecting Freedom E310 Arty FPGA Dev Kit in the Arduino IDE
18 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Chapter 6
The Freedom E310 Arty FPGA Dev Kit source code is fully open sourced, and you can use the
repository to create different Freedom E300 variants. You can find the code and scripts to re-create
the source RTL and MCS file at http://github.com/sifive/freedom.
19
20 SiFive Freedom E310 Arty FPGA Dev Kit Getting Started Guide 1.0.6
Chapter 7
Additional information, the latest version of this guide, and supporting files can be found at https:
//dev.sifive.com.
21