This document assumes a basic understanding of the Linux command line (or “shell”) environment. The reference(s)
in Table 1 can be used as an overview of OpenCPI and may prove useful.
Acronyms and DefinitionsANGRYVIPER TeamAcronyms_and_Definitions.pdf
OverviewOpenCPIhttp://opencpi.github.io/
Overview.pdf
Table 1: References
4
Ettus E3XX Getting Started GuideANGRYVIPER Team
2Overview
This document provides steps for configuring a factory provided Ettus USRP E310 with the OpenCPI runtime
environment for executing applications, configuring a development system to build OpenCPI bitstreams targeting
the e3xx platform, and examples of executing applications on the OpenCPI configured E310.
3Prerequisites
This guide assumes that, at a minimum, the following RPMs are installed:
RPM NameDescription
All prerequisite RPMsThese packages have OpenCPI-specific patches and are provided
as RPMs. This packaging ensures they will not conflict with
other installed copies by using a nonstandard installation location of /opt/opencpi/prerequisites.
angryviper-ide-*.x86 64.rpmThe ANGRYVIPER IDE (Eclipse with plugins).See RPM
Installation Guide.pdf, Appendix D for an alternative method
to set up the IDE using an existing Eclipse installation.
opencpi-*.x86_64.rpmBase installation RPM includes the runtime portion of the
Component Development Kit (CDK) and the source for the
ocpi.core and ocpi.assets Projects containing framework essential components, workers, platforms, etc.
opencpi-devel-*.x86_64.rpmAdditional header files and scripts for developing new assets as
HDL and/or RCC.
opencpi-sw-platform-xilinx13_4-*.noarch.rpmAdditional files necessary to build the framework targeting spe-
cific RCC/software platforms, independent of the final deployed
hardware.
opencpi-hw-platform-e3xx-*.noarch.rpmAdditional files necessary to build the framework targeting spe-
cific hard-ware platform "X" when running RCC platform "Y"
("Y" can be "no sw"). This RPM also includes hardware-specific
SD Card images when applicable.
3.1Installation of provided projects: core, assets and bsp_e310
This guide assumes the user has executed ocpi-copy-projects, accepting the default settings, to copy and register the
core, assets, and bsp_e310 projects from the /opt/opencpi/projects for building bitstreams for the E310. Referencethe Getting Started Guide for details on ocpi-copy-projects. Although the projects are registered by
ocpi-copy-projects, changes to the registry can be made via ocpidev un/register project or the ANGRYVIPER
GUI.
$ ocpi-copy-projects
...
$ ls ~/ocpi_projects
assets bsp_e310 core
$ ocpidev show registry
Project registry is located at: /opt/opencpi/cdk/../project-registry
The platform that is expected to be used is the Ettus Research/National Instruments Universal Software Radio
Peripheral (USRP) E310 (or E3XX) SDR (e.g. e3xx). This OpenCPI-enabled platform provides the capability of
deploying hardware and software workers while using Xilinx’s 13.4 distribution of Linux.
The synthesizers and cross-compilers required to build HDL and RCC Workers for this Platform are installed by
following the instructions found in the OpenCPI FPGA Vendor Tools Installation Guide. This document assumes
that the user has installed the appropriate versions of Vivado and the Xilinx SDK.
3.3Building Required Projects
The core, assets, and bsp_e310 projects must be built in a specific order for this platform. This section outlines
how to build the relevant projects and provides the commands to do so.
For this document, the projects should be built as follows:
1. Build core for the xilinx13_4 RCC Platform and the e3xx HDL Platform, but omit assemblies
2. Build assets for the xilinx13_4 RCC Platform and the e3xx HDL Platform, but omit assemblies
3. Build the bsp_e310 project for these same platforms
4. Build the testbias assembly from the assets project. This will be used later in this guide.
Once the HDL Platform is built in the BSP project, assemblies can be built for that HDL platform
Note: replace “<user>” with your username in the commands above.
Each of these build commands can also be performed via the ANGRYVIPER IDE as follows:
To perform this operation within the IDE:
1. Open the ANGRYVIPER Perspective
2. Select the asset from OpenCPI Project View
3. Import to AV Operations Panel using “>” button
4. Select the RCC and/or HDL platforms for the build (use
5. Click “Build”
See the ANGRYVIPER Team’s Getting Started Guide for additional information concerning the use of ocpidev
and the ANGRYVIPER IDE to build OpenCPI assets.
Ctrlfor multiple selection)
3.4Hardware Setup
• Ettus USRP E3XX
It is expected that this SDR package includes a power supply, micro-USB to USB cable and standard SD card
(4GB or larger).
OpenCPI has been tested on the Ettus USRP E310.
The micro-USB serial port located on the back E310 labeled CONSOLE (Figure 2) can be used to access the
serial connection with the processor.
6
Ettus E3XX Getting Started GuideANGRYVIPER Team
Figure 2: Back Panel
• Ethernet cable: An Ethernet port is available on the E310 (Figure 2) and is required when the Network
mode (discussed later) environment is used. The OpenCPI BSP for the E310 is configured for DHCP.
Figure 3: Front Panel
• Access to a network which supports DHCP. (Network Mode)
• SD card: As mentioned earlier, a 4GB or larger SD card should come with the SDR. The bootable SD card
slot is located on the front of the unit (Figure 3) and ejects by gently pushing it in and releasing.
• SD card reader
• Further information on front panel: Also found on the front panel of the SDR are six labeled SMB (50
Ohm) connectors: TRX-A, RX2-A, RX2-B, TRX-B, GPS, and SYNC (Figure 3). The upper connections are
7
Ettus E3XX Getting Started GuideANGRYVIPER Team
split into two individual channels referred to as “Front End A” and “Front End B.” Specific details can be
found in the vendor manuals.
4SD Card Setup
4.1Make a backup image of factory SD card (assumes Linux host)
This section provides the steps for creating an SD card backup image. The subsequent subsections assume the SD
card is empty.
• Determine the device file name for the SD card by executing dmesg command below. It will likely be something
like /dev/sdb or /dev/mmcblk0.
$ dmesg | tail -n 15
• Run the following dd command to make a backup image, where DEVICENAME was determined above. This
step should take ∼ 15 minutes depending on the card size.
$ dd if=DEVICENAME of=backup.image
To restore the card back to the original contents, run the command “dd of=DEVICENAME if=backup.image” (Do
not do this step unless you want the original contents back on the SD card.)
4.2Format the SD card
• Format the SD card with a single FAT32 partition.
4.3Copy OpenCPI files to SD card
This section provides the simplest instructions for copying files over to the SD card. Appendix B contains more
involved instructions for copying only the necessary files to the SD card for each mode.
WARNING: The user must ensure that the contents of the SD, match the version of the OpenCPI release that the
artifacts were built against.
When using the factory SD card, all files can be ignored or deleted. Any files/directories copied to SD card will
appear at /mnt/card on the E310.
The final SD Card artifacts are distributed in /opt/opencpi/cdk/e3xx/ via RPM as noted previously. The end user
is not required nor expected to generate the files, but the process is documented below in Appendix A.
8
Ettus E3XX Getting Started GuideANGRYVIPER Team
5Script Setup
There are two type of setups or modes for running applications on any embedded radio: Network and Standalone.
In Network mode, a development system hosts the OpenCPI tree as an NFS server to the E310 which is an NFS
client. This configuration provides quick and dynamic access to all of OpenCPI, and presumably any applications,
components and bitstreams. In Standalone mode, all the artifacts are located on the SDR’s local storage (e.g. SD
card) and no network connection is required. This may be more suited for deployment scenarios in which network
connection is not possible or practical. Network mode is generally preferred during the development process.
5.1Setting up the Network and Standalone Mode scripts
For each mode, a startup script is used to configure the environment of the embedded system. The OpenCPI
framework provides a default script for each mode. The default scripts are to be copied and modified per the user’s
requirements.
1. In mynetsetup.sh, uncomment the following lines which are necessary for mounting core and assets project:
mkdir -p /mnt/ocpi_core
mount -t nfs -o udp,nolock,soft,intr $1:/home/user/ocpi_projects/core /mnt/ocpi_core
mkdir -p /mnt/ocpi_assets
mount -t nfs -o udp,nolock,soft,intr $1:/home/user/ocpi_projects/assets /mnt/ocpi_assets
2. Edit /home/user/ocpi_projects/core and /home/user/ocpi_projects/assets to reflect the paths to the
core and assets project on the host, e.g.:
mkdir -p /mnt/ocpi_core
mount -t nfs -o udp,nolock,soft,intr $1:/home/johndoe/ocpi_projects/core /mnt/ocpi_core
mkdir -p /mnt/ocpi_assets
mount -t nfs -o udp,nolock,soft,intr $1:/home/johndoe/ocpi_projects/assets /mnt/ocpi_assets
5.1.2Standalone Mode
In this mode, all OpenCPI artifacts that are required to run any application on the E310 must be copied onto the
SD card. Building the provided projects to obtain such artifacts is discussed in Section 3.3. Once the artifacts have
been created, they must be copied to the SD card in Section 4. In general, any required .so (RCC workers),
.bit.gz (hdl assemblies), and application XMLs or executables must be copied to the ATLAS partition of the SD
card.
Unlike Network mode, there is no required modifications to this script.
3) Copy any additional artifacts to SD card’s opencpi/xilinx13_4/artifacts/ directory
9
Ettus E3XX Getting Started GuideANGRYVIPER Team
5.2Setup system time reference
If Linux system time is not required to be accurate, this step may be skipped.
For either Network or Standalone mode, the following settings that are passed by mynetsetup.sh/mysetup.sh to
the zynq_net_setup.sh/zynq_setup.sh scripts may require modification:
• Identify the system that is to be used as a time server, where the default is “time.nist.gov” and is set in
/mnt/card/opencpi/ntp.conf. A valid time server must support ntp.
• Identify the current timezone description, where the default is “EST5EDT,M3.2.0,M11.1.0”. Change this if
required for the local timezone. See man tzset on the host PC for more information.
• If a time server is not required, or cannot connect to a time server, the user is required to manually set the
time at start up. Use the date command to manually set the Linux system time. See man date on the host
PC for more information.
5.3“rsync” provided binary
An ARM-compiled version of “ rsync” is provided in the included SD card image for xilinx13_4. This tool allows
the use of standalone mode while shortening the required developer time to synchronize the artifacts being
developed. For command-line usage, see the rsync home page. The easiest usage is to have the radio “pull” from the
developer’s workstation; this does not need any additional command-line arguments.
Implementation Details
Unfortunately, the “rsync” executable is not in the default path because when called remotely, it requests a
non-interactive shell. For this reason, a “pull” approach is recommended. If a user for some reason requires a “push”
from the workstation to the radio, the local “rsync” executable must be told the remote location of the rsync
executable to call, e.g. rsync –rsync-path=/mnt/card/opencpi/xilinx13_4/bin/rsync
6Development Host Setup - Network Mode ONLY
6.1Network Mounting Mode
The NFS server needs to be enabled on the host in order to run the SDR in Network Mode. The following sections
are directions on how to do this for both CentOS 6 and CentOS 7 host operating systems.
6.1.1CentOS 6
From the host, install the necessary tools using yum:
% sudo yum install nfs-utils nfs-utils-lib
% sudo chkconfig nfs on
% sudo service rpcbind start
% sudo service nfs start
From the host, add the following lines to the bottom of /etc/exports and change “XX.XX.XX.XX/MM” to a valid
netmask for the DHCP range that the SDR will be set to for your network (e.g. 192.168.0.0/16).
Define the export by creating a new file that has the extension “exports”. If it does not have that extension, it
will be ignored. Add the following lines to that file and replace “XX.XX.XX.XX/MM” with a valid netmask for the
DHCP range that the SDR will be set to for your network (e.g. 192.168.0.0/16).
* Note: Some of the “enable” commands may fail based on your package selection, but should not cause any problems.
NOTE: You will need to add the ocpi.bsp.e310 project to your list of exports (in /etc/exports.d/user_ocpi.exports).
1
nfs-utils-lib was rolled into nfs-utils starting with CentOS 7.2, if using eariler versions of CentOS 7, nfs-utils-lib will need
to be explicitly installed
2
You can use getsebool to see if these values are already set before attempting to set them. Some security tools may interpret the
change attempt as a system attack.
11
Ettus E3XX Getting Started GuideANGRYVIPER Team
7Configuring the runtime environment on the platform
7.1Network Mode
1. Plug in an Ethernet cable to a network configured for DHCP
2. Ensure a micro-USB to USB cable is connected between the E310’s serial port and development host
3. Apply power to the E310
4. Use a serial terminal application to establish a serial connection, for example:
$ sudo screen /dev/ttyUSB0 115200
5. After a successful boot to PetaLinux, login to the system, using “ root” for user name and password
6. Setup the OpenCPI environment on remote system
Each time the SDR is booted, the OpenCPI environment must be setup. By sourcing the mynetsetup.sh
script, the remote system’s environment is configured for OpenCPI and NFS directories are mounted for
Network mode.3. The user must provide the network address of the development system to the script as its
only argument:
$ . /mnt/card/opencpi/mynetsetup.sh XX.XX.XX.XX
where XX.XX.XX.XX is the IP address of the NFS host (i.e. that development host, e.g. 192.168.1.10). A
successful run should output the following:
An IP address was detected.
Setting the time from time server: time.nist.gov
My IP address is: XX.XX.XX.XX, and my hostname is: zynq
Running login script. OCPI_CDK_DIR is now /mnt/net/cdk.
Executing /home/root/.profile
No reserved DMA memory found on the linux boot command line.
The mdev config has no OpenCPI rules. We will add them to /etc/mdev.conf
NET: Registered protocol family 12
Driver loaded successfully.
OpenCPI ready for zynq.
Discovering available containers...
Available containers:
Attempting to set the time from time server
Alarm clock
ntp was unable to set time using servers in ntp.conf. For more information see Section 5.2
3
This script calls the zynq_net_setup.sh script, which should not be modifiable by the user.
12
Ettus E3XX Getting Started GuideANGRYVIPER Team
7.2Standalone Mode
1. (Not required for OpenCPI in this mode) Plug in an Ethernet cable to a network configured for DHCP
2. Ensure a micro-USB to USB cable is connected between the E310’s serial port and development host
3. Apply power to the E310
4. Use a serial terminal application to establish a serial connection, for example:
$ sudo screen /dev/ttyUSB0 115200
5. After a successful boot to PetaLinux, login to the system, using “ root” for user name and password
WARNING: Applications (including XML-only ones) fail if there is not an IP address assigned to the platform,
6.
even when in “standalone mode.” When the Ethernet port is not connected to a network configured with
DHCP, a temporary IP address must be set:
$ ifconfig eth0 192.168.244.244
7. Setup the OpenCPI environment on remote system
Each time the SDR is booted, the OpenCPI environment must be setup. By sourcing the mysetup.sh script,
the remote system’s environment is configured for OpenCPI4. There are no arguments for this script.
$ . /mnt/card/opencpi/mysetup.sh
A successful run should output the following:
Attempting to set the time from time server: time.nist.gov
Setting the time from time server: time.nist.gov
Running login script. OCPI_CDK_DIR is now /mnt/card/opencpi.
Executing /home/root/.profile
No reserved DMA memory found on the linux boot command line.
The mdev config has no OpenCPI rules. We will add them to /etc/mdev.conf
NET: Registered protocol family 12
Driver loaded successfully.
OpenCPI ready for zynq.
Discovering available containers...
Available containers:
Attempting to set the time from time server
Alarm clock
ntp was unable to set time using servers in ntp.conf. For more information see Section 5.2
4
This script calls the zynq_setup.sh script, which should not be modifiable by the user.
13
Ettus E3XX Getting Started GuideANGRYVIPER Team
8Build an application
The setup of the platform can be verified by running an application that uses both RCC and HDL workers. A
simple application that requires two RCC and one HDL worker is located in assets/applications/bias.xml, but
only the RCC artifacts are provided with the installation of RPMs, and are availble on the SD card (Standard
Mode) or mounted CDK directory (Network Mode). The remaining task is to build an assembly, or bitstream for
loading the FPGA, which contains the HDL worker.
9Run an Application
9.1Network Mode
The default setup script sets the OCPI_LIBRARY_PATH variable to include the RCC workers that are required to
execute the application, but it must be updated to include to the assembly bitstream that was built. After running
the mynetsetup.sh script, navigate to /mnt/ocpi_assets/applications, then update the OCPI_LIBRARY_PATH
variable using the following command:
The default setup script sets the OCPI_LIBRARY_PATH variable to include the all of the artifacts that are required to
execute the application. Specifically, all three of the artifacts that are located on the SD card are mounted at
/mnt/card/opencpi/xilinx13_4/artifacts. After running mysetup.sh, navigate to /mnt/card/opencpi/xml.
Run the application using the following command:
$ ocpirun -v -t 1 -d -m bias=hdl bias.xml
The output should be similar to the output shown in Section 9.1.
Run the following commands to view the input and output, and reference Section 9.1 for the expected results:
$ hexdump test.input | less
$ hexdump test.output | less
10Running Reference Applications
Now that you have set up OpenCPI and the E310 radio, you can run one of the reference applications. Navigate to
bsp_e310/applications/FSK or bsp_e310/applications/rx_app and follow the instructions in the corresponding
documents (FSK_App_Getting_Started_Guide_E3XX.pdf and FSK_app_e3xx.pdf, or RX_app_e3xx.pdf ).
17
Ettus E3XX Getting Started GuideANGRYVIPER Team
Appendices
AGenerating Boot Artifacts
In normal use cases, the SD card should be createdable and usable via the simple steps in Section 4. This section
outlines the steps required to regenerate the artifacts used in previous sections for solely informational purposes and
is not expected for users to have to complete these steps.
A.1BOOT.bin and u-boot.img
The original first and second stage bootloader artifacts that come installed on the E310 SD card are not suitable
for the Petalinux build OpenCPI uses for its software platform as those artifacts are expecting a uImage kernel with
a separate filesystem partition, while the Petalinux build uses a separate ramdisk image file. The BOOT.bin and
u-boot.img files were rebuilt in order to support booting into this style of Linux images from Ettus’s and Xilinx’s
repositories. In summary, the repositories were cloned and checked out to the proper branch, according to the release
for the e310 and the bitbake recipe, and subsequently cross-compiled for ARM using the Xilinx toolchain. The steps
are shown below.
$ git clone https://github.com/EttusResearch/meta-ettus.git
$ cd meta-ettus && git checkout e300-daisy && cd ..
$ git clone https://github.com/Xilinx/u-boot-xlnx.git
$ cd u-boot-xlnx && git checkout 664820b231b129552e963e1a96b45ac7196ccc81 && cd ..
$ cp meta-ettus/e300-bsp/recipes-bsp/u-boot/ettus-e300/* u-boot-xlnx/
$ cd u-boot-xlnx
$ mv ps7_init.{c,h} board/xilinx/zynq/
$ git apply 0001-E300-Uses-UART0-for-console.patch
$ git apply 0002-E300-Disable-QSPI.patch
$ git apply 0003-Read-mac-address-from-i2c-EEPROM.patch
$ git apply 0001-e300-Added-memory-test.patch
$ source {xilinx-install-dir}/Xilinx/SDK/2013.4/settings64.sh
$ make zynq_zc70x_config CROSS_COMPILE=arm-xilinx-linux-gnueabi$ make CROSS_COMPILE=arm-xilinx-linux-gnueabi-
A.2devicetree.dtb
The device tree needed to be modified in order to register the hardware devices with the correct hardware device
driver in the Petalinux kernel. In summary, the device tree provided by Ettus was decompiled to a device tree source
(dts) file using the device tree compiler (dtc), modified the text file by adding the proper "compatible" strings to
the devices, and subsequently compiled back into a device tree blob (dtb). The steps shown below assume dtc is in
your $PATH and the original device tree blob is in the current working directory.
Note: The full source for the modified devicetree.dts can be found at <BSPproject>/hdl/platforms/e3xx/sd_
card_source/devicetree.dts
A.3uImage and uramdisk.image.gz
The uImage and uramdisk.image.gz image files come directly from the default 13_4 OpenCPI software platform.
The 13_3 software platform could not be used due to the SD card driver in 13_3 not supporting the E310’s SD card
device.
18
Ettus E3XX Getting Started GuideANGRYVIPER Team
BCopying only required files to SD card
B.1Copy embedded OS and boot files to SD card
Copy the following files/directories onto the SD card:
After performing the steps from B.1, copy the entire opencpi directory to the SD card, then copy the relevant
bitstreams, artifacts into the artifacts directory and application XMLs into the applications directory. For this
getting started guide, only one bitstream is required to be copied onto the SD cards, where as the required artifacts
and application XML where copied to the SD along with the entire opencpi directory.