[USRP-users] sdimage version for RFNoc

Nicolas Cuervo nicolas.cuervo at ettus.com
Mon Jul 3 06:39:55 EDT 2017


Hello Hu Chaoran,

The precompiled SD images do not contain as of now a suitable set up for
RFNoC right out of the box. The reason behind this is the constant and
rapid change/improvement that RFNoC is undergoing. In order to have a SD
image for RFNoC you have to compile it yourself. We are putting together
the documentation that covers this whole process, which will be soon part
of our applications notes. Attached to this email you will find the
step-by-step process that you can follow in order to build the image with
RFNoC successfully.

Regards,
- Nicolas



On Sun, Jul 2, 2017 at 10:00 AM, Hu Chaoran via USRP-users <
usrp-users at lists.ettus.com> wrote:

> Hello,
>
> I'm a new user of the usrp e312, I want to use the RFNoc function, but on
> here http://files.ettus.com/e3xx_images/ there are many sdimage versins
> ,I read the document ' README', but I still can't know which image can
> support the RFNoc well, and is the image already build rfnoc and ettus or I
> need to  build them by myself.
> files.ettus.com:/e3xx_images/ <http://files.ettus.com/e3xx_images/>
> files.ettus.com
> files.ettus.com/e3xx_images/ Name Last modified Size Description
>
> Thank u.
> <http://files.ettus.com/e3xx_images/>
>
>
> _______________________________________________
> USRP-users mailing list
> USRP-users at lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20170703/293e0cb2/attachment-0002.html>
-------------- next part --------------
Switch your default shell on the host computer from Dash to Bash. In some Linux distributions (e.g. Ubuntu) dash is set as default shell, which may cause some issues. It is recommended to set the shell to bash by running the following commands in the terminal. Choose <No> when prompted by the first command and the second command will validate the that bash will be used.

$ sudo dpkg-reconfigure dash

Verify Bash is the default shell.

$ ll /bin/sh

Expected Output:

lrwxrwxrwx 1 root root 4 Apr  2 22:00 /bin/sh -> bash*

Make a working directory on host computer. This is where we will clone, download, cross compile and install all files.

$ mkdir -p ~/e300

Make a src/ directory within the working directory. 

$ mkdir -p ~/e300/src


Download the OE SDK for the E31x release into the src/ directory: 

$ cd ~/e300/src
$ wget http://files.ettus.com/e3xx_images/e3xx-release-4/oecore-x86_64-armv7ahf-vfp-neon-toolchain-nodistro.0.sh

Next, install the SDK to the ~/e300 directory. Enter "~/e300" for the installation directory when prompted.

$ bash oecore-x86_64-armv7ahf-vfp-neon-toolchain-nodistro.0.sh 

Expected Output:

Enter target directory for SDK (default: /usr/local/oecore-x86_64): ~/e300
You are about to install the SDK to "/home/user/e300". Proceed[Y/n]?y
Extracting SDK...done
Setting it up...done
SDK has been successfully set up and is ready to be used.

Your "~/e300" directory should have a structure such as below:

$ ls ~/e300
environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi  src       version-armv7ahf-vfp-neon-oe-linux-gnueabi
site-config-armv7ahf-vfp-neon-oe-linux-gnueabi        sysroots

Source the environment setup file:

$ cd ~/e300
$ source ./environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi 

Verify the environment has been setup correctly. 

$ echo $CC

Expected Output:
arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon --sysroot=/home/user/e300/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi

* Note: If you open a new terminal at any point, you will need to re-run the source command above to initialize the environment. The compiling environment setup is only needed for terminals that are cross compiling the sources. The terminals used later in this application note which are using SSH to connect to other devices do not need to have the compiling environment initialized. 

Next, download the rfnoc-devel branch of UHD, v3.7.10.2 GNU Radio, and master branch of gr-ettus:

$ cd ~/e300/src
$ git clone -b rfnoc-devel https://github.com/EttusResearch/uhd.git
$ git clone -b master https://github.com/EttusResearch/gr-ettus.git
$ git clone -b v3.7.10.2 --recursive https://github.com/gnuradio/gnuradio.git 

Next, we will cross compile the rfnoc-devel branch of UHD.

$ cd uhd/host
$ mkdir build 
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../host/cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_E300=ON ..
$ make -j4
$ make install DESTDIR=~/e300
$ make install DESTDIR=~/e300/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/


Next, we will create an environment setup file that will set the correct system variables to point to our new installation when ran on the E31x.

$ cd ~/e300
$ touch setup_env.sh
$ nano setup_env.sh

Add the following lines to setup_env.sh

LOCALPREFIX=~/newinstall/usr
export PATH=$LOCALPREFIX/bin:$PATH
export LD_LOAD_LIBRARY=$LOCALPREFIX/lib:$LD_LOAD_LIBRARY
export LD_LIBRARY_PATH=$LOCALPREFIX/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$LOCALPREFIX/lib/python2.7/site-packages:$PYTHONPATH
export PKG_CONFIG_PATH=$LOCALPREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export GRC_BLOCKS_PATH=$LOCALPREFIX/share/gnuradio/grc/blocks:$GRC_BLOCKS_PATH
export UHD_RFNOC_DIR=$LOCALPREFIX/share/uhd/rfnoc/
export UHD_IMAGES_DIR=$LOCALPREFIX/share/uhd/images



Next, we will need to SSH into the E31x and will mount the ~/e300 folder using SSHFS in order to test our new installation.

* Note: This tutorial assumes you're using the default IP address of 192.168.10.2 for your E31x device, and that your host has the IP address of 192.168.10.1. If you're using different IP addresses, the commands below will need to be updated to reflect the correct IPs.

Open a new terminal and verify that you can ping the E31x:

$ ping 192.168.10.2

Next, SSH into the E31x.

$ ssh root at 192.168.10.2

For this next step, your host computer will need to have OpenSSH Server installed.

Open a third terminal window on the host and run: 

$ sudo apt-get install openssh-server

Returning to the terminal which you're connected to the E31x via SSH, mount the ~/e300 folder onto the E31x.

First create a directory to mount the remote folder to with (running these commands on the E31x):

$ mkdir -p ~/newinstall
$ sshfs username at 192.168.10.1:e300 newinstall/

* Note: The "username" in the above command needs to be updated to reflect your user on the host machine.

When prompted, enter the password of your user to complete the mounting of the remote file system.

Verify the mount was successful, your directory structure should match ~/e300 on the host machine.

$ ls ~/newinstall/

Expected output:
environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi
setup_env.sh
site-config-armv7ahf-vfp-neon-oe-linux-gnueabi
src
sysroots
usr
version-armv7ahf-vfp-neon-oe-linux-gnueabi


Next, we will need to setup the system environment on the E31x to use the newly compiled version of UHD.

We will first verify that the E31x is using the existing UHD installation, using the "which" command:

$ which uhd_usrp_probe

Expected output:

/usr/bin/uhd_usrp_probe

Next, source the setup_env.sh file:

$ cd ~/newinstall
$ source ./setup_env.sh

Now we will verify that the newly compiled UHD is being used, again using the "which" command:

$ which uhd_usrp_probe

Expected output:

/home/root/newinstall/usr/bin/uhd_usrp_probe

Next, we must download the correct FPGA images for the new installation. Run the utility "uhd_images_downloader", since the E3xx is not connected to the internet, this will throw an error:

$ uhd_images_downloader

Expected output:

UHD_IMAGES_DIR environment variable is set.
Default install location: /home/root/newinstall/usr/share/uhd/images
Images destination:      /home/root/newinstall/usr/share/uhd/images
Downloading images from: http://files.ettus.com/binaries/images/uhd-images_4.0.0.rfnoc-devel-238-g39a41476.zip
Downloading images to:   /tmp/tmpS1uIFt/uhd-images_4.0.0.rfnoc-devel-238-g39a41476.zip
Downloader raised an unhandled exception: ('Connection aborted.', gaierror(-2, 'Name or service not known'))
You can run this again with the '--verbose' flag to see more information
If the problem persists, please email the output to: support at ettus.com

Note the URL to the FPGA images package which is trying to access. Copy this URL and return to a terminal that is on your host machine and download it into the ~/e300/src folder.

On the host machine run:

$ cd ~/e300/src
$ wget http://files.ettus.com/binaries/images/uhd-images_4.0.0.rfnoc-devel-238-g39a41476.zip

* Note, This FPGA image package will vary depending upon the current version of UHD you are using. You must use the URL that is shown in the above output when trying to run uhd_images_downloader.


Next, decompress this file:

$ unzip uhd-images_4.0.0.rfnoc-devel-238-g39a41476.zip

Note, the URL/paths may be slightly different than what is shown above due to different versions, however the process is the same.

Next we must create the folder for the FPGA images.

Navigate to the folder on your host machine:

$ cd ~/e300/usr/share/uhd/

$ mkdir -p images
$ cd images/

Verify your directory with the pwd command:

$ pwd

Expected output:

/home/user/e300/usr/share/uhd/images

Now, copy the FPGA images from the decompressed FPGA zip package:

$ cp -R ~/e300/src/uhd-images_4.0.0.rfnoc-devel-238-g39a41476/share/uhd/images/* .

Verify the copy was successful:

$ ls 

Expected Output:
$ ls 
4.0.0.rfnoc-devel.tag     usrp_b200_fpga.bin            usrp_n200_fw.bin                usrp_x300_fpga_RFNOC_XG.bit
bit                       usrp_b200_fw.hex              usrp_n200_r2_fpga.bin           usrp_x300_fpga_RFNOC_XG.lvbitx
LICENSE                   usrp_b200mini_fpga.bin        usrp_n200_r3_fpga.bin           usrp_x300_fpga_XG.bit
octoclock_bootloader.hex  usrp_b205mini_fpga.bin        usrp_n200_r4_fpga.bin           usrp_x300_fpga_XG.lvbitx
octoclock_r4_fw.hex       usrp_b210_fpga.bin            usrp_n210_fw.bin                usrp_x310_fpga_HG.bit
usrp1_fpga_4rx.rbf        usrp_e100_fpga_v2.bin         usrp_n210_r2_fpga.bin           usrp_x310_fpga_HG.lvbitx
usrp1_fpga.rbf            usrp_e110_fpga.bin            usrp_n210_r3_fpga.bin           usrp_x310_fpga_RFNOC_HG.bit
usrp1_fw.ihx              usrp_e310_fpga.bit            usrp_n210_r4_fpga.bin           usrp_x310_fpga_RFNOC_HG.lvbitx
usrp2_fpga.bin            usrp_e310_fpga_RFNOC.bit      usrp_n230_fpga.bit              usrp_x310_fpga_RFNOC_XG.bit
usrp2_fw.bin              usrp_e310_fpga_RFNOC_sg3.bit  usrp_x300_fpga_HG.bit           usrp_x310_fpga_RFNOC_XG.lvbitx
usrp_b100_fpga_2rx.bin    usrp_e310_fpga_sg3.bit        usrp_x300_fpga_HG.lvbitx        usrp_x310_fpga_XG.bit
usrp_b100_fpga.bin        usrp_e3xx_fpga_idle.bit       usrp_x300_fpga_RFNOC_HG.bit     usrp_x310_fpga_XG.lvbitx
usrp_b100_fw.ihx          usrp_e3xx_fpga_idle_sg3.bit   usrp_x300_fpga_RFNOC_HG.lvbitx  winusb_driver


Next, in order to save space on the E31x when we transfer this build to the E31x, delete all non-E31x FPGA images.

$ rm -v usrp1_f*
$ rm -v usrp2_f*
$ rm -v usrp_b*
$ rm -v usrp_n2*
$ rm -v usrp_x3*
$ rm -v usrp_e1*
$ rm -v octoclock_*
$ rm -vrf winusb_driver/
$ rm -vrf bit/

Verify the folder structure:

$ ls

Expected Output:
4.0.0.rfnoc-devel.tag  usrp_e310_fpga.bit        usrp_e310_fpga_RFNOC_sg3.bit  usrp_e3xx_fpga_idle.bit
LICENSE                usrp_e310_fpga_RFNOC.bit  usrp_e310_fpga_sg3.bit        usrp_e3xx_fpga_idle_sg3.bit

Next, return to the terminal which is connected via SSH to the E31x and run uhd_usrp_probe:

$ uhd_usrp_probe

Expect output:

[INFO] [UHDlinux; GNU C++ version 4.9.2; Boost_105700; UHD_4.0.0.rfnoc-devel-369-g1908672f] 
[INFO] [E300] Loading FPGA image: /home/root/newinstall/usr/share/uhd/images/usrp_e310_fpga_sg3.bit...
[INFO] [E300] FPGA image loaded
[INFO] [E300] Initializing core control (global registers)...

[INFO] [E300] Performing register loopback test... 
[INFO] [E300] Register loopback test passed
[INFO] [RFNOC RADIO] Register loopback test passed
[INFO] [RFNOC RADIO] Register loopback test passed
[WARNING] [RFNOC] [0/fosphor_0] defines 2 input buffer sizes, but 1 input ports
[INFO] [AD936X] Performing CODEC loopback test... 
[INFO] [AD936X] CODEC loopback test passed
[INFO] [AD936X] Performing CODEC loopback test... 
[INFO] [AD936X] CODEC loopback test passed
[INFO] [CORES] Performing timer loopback test... 
[INFO] [CORES] Timer loopback test passed
  _____________________________________________________
 /
|       Device: E-Series Device
|     _____________________________________________________
|    /
|   |       Mboard: E3XX
|   |   product: 30675
|   |   revision: 6
|   |   serial: xxxxxxx
|   |   mac-addr: 00:00:00:00:00:00
|   |   FPGA Version: 255.0
|   |   FPGA git hash: f764326-dirty
|   |   RFNoC capable: Yes
|   |   
|   |   Time sources:  none, internal, external
|   |   Clock sources: internal
|   |   Sensors: temp, ref_locked
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 0
|   |   |   
|   |   |   Freq range: 0.000 to 0.000 MHz
|   |     _____________________________________________________
|   |    /
|   |   |       RX DSP: 1
|   |   |   
|   |   |   Freq range: 0.000 to 0.000 MHz
|   |     _____________________________________________________
|   |    /
|   |   |       RX Dboard: A
|   |   |   ID: E310 MIMO XCVR (0x0110)
|   |   |   Serial: xxxxxx
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Frontend: A
|   |   |   |   Name: FE-RX2
|   |   |   |   Antennas: TX/RX, RX2
|   |   |   |   Sensors: temp, rssi, lo_locked
|   |   |   |   Freq range: 50.000 to 6000.000 MHz
|   |   |   |   Gain range PGA: 0.0 to 76.0 step 1.0 dB
|   |   |   |   Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Frontend: B
|   |   |   |   Name: FE-RX1
|   |   |   |   Antennas: TX/RX, RX2
|   |   |   |   Sensors: temp, rssi, lo_locked
|   |   |   |   Freq range: 50.000 to 6000.000 MHz
|   |   |   |   Gain range PGA: 0.0 to 76.0 step 1.0 dB
|   |   |   |   Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       RX Codec: A
|   |   |   |   Name: E3x0 RX dual ADC
|   |   |   |   Gain Elements: None
|   |     _____________________________________________________
|   |    /
|   |   |       TX DSP: 0
|   |   |   
|   |   |   Freq range: 0.000 to 0.000 MHz
|   |     _____________________________________________________
|   |    /
|   |   |       TX DSP: 1
|   |   |   
|   |   |   Freq range: 0.000 to 0.000 MHz
|   |     _____________________________________________________
|   |    /
|   |   |       TX Dboard: A
|   |   |   ID: E310 MIMO XCVR (0x0110)
|   |   |   Serial: xxxxxx
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Frontend: A
|   |   |   |   Name: FE-TX2
|   |   |   |   Antennas: TX/RX
|   |   |   |   Sensors: temp, lo_locked
|   |   |   |   Freq range: 50.000 to 6000.000 MHz
|   |   |   |   Gain range PGA: 0.0 to 89.8 step 0.2 dB
|   |   |   |   Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Frontend: B
|   |   |   |   Name: FE-TX1
|   |   |   |   Antennas: TX/RX
|   |   |   |   Sensors: temp, lo_locked
|   |   |   |   Freq range: 50.000 to 6000.000 MHz
|   |   |   |   Gain range PGA: 0.0 to 89.8 step 0.2 dB
|   |   |   |   Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
|   |   |   |   Connection Type: IQ
|   |   |   |   Uses LO offset: No
|   |   |     _____________________________________________________
|   |   |    /
|   |   |   |       TX Codec: A
|   |   |   |   Name: E3x0 TX dual DAC
|   |   |   |   Gain Elements: None
|   |     _____________________________________________________
|   |    /
|   |   |       RFNoC blocks on this device:
|   |   |   
|   |   |   * Radio_0
|   |   |   * FIFO_0
|   |   |   * Window_0
|   |   |   * FFT_0
|   |   |   * fosphor_0
|   |   |   * FIFO_1
|   |   |   * FIR_0

* Note, you may see additional errors when the idle FPGA image is loaded, this is a bug that will be resolved in an upcoming rfnoc-devel release.

At this point, it's possible to run the included UHD example programs with the newly compiled UHD.

$ cd ~/newinstall/usr/lib/uhd/examples/
$ ./rx_samples_to_file --freq 100e6 --gain 0 --ant TX/RX --rate 1e6 --null


Press CTRL+C to exit the program.

Next, we will build and install GNU Radio.

On the host computer, navigate to the ~/e300/src/gnuradio directory, and build GNU Radio:

$ cd ~/e300/src/gnuradio
$ mkdir build
$ cd build

$ cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/oe-sdk_cross.cmake -DENABLE_GR_WXGUI=OFF -DENABLE_GR_VOCODER=OFF -DENABLE_GR_DTV=OFF -DENABLE_GR_ATSC=OFF -DENABLE_DOXYGEN=OFF -DCMAKE_INSTALL_PREFIX=/usr ../

$ make -j4
$ make install DESTDIR=~/e300/
$ make install DESTDIR=~/e300/sysroots/armv7ahf-vfp-neon-oe-linux-gnueabi/

Next, verify your GNU Radio installation was successful. On the E31x terminal, run the command:

$ gnuradio-config-info --version

Expected output:
3.7.10.2

Next, we will build gr-ettus. On the host machine, navigate to ~/e300/src/gr-ettus:

$ cd ~/e300/src/gr-ettus
$ mkdir build
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=~/e300/src/gnuradio/cmake/Toolchains/oe-sdk_cross.cmake -DCMAKE_INSTALL_PREFIX=/usr ..
$ make -j4
$ make install DESTDIR=~/e300/

At this point you should have a fully functional UHD RFNoC, GNU Radio and gr-ettus installation. However being that the compiled sources are not located on the E31x we will need to transfer the files to the E31x.

On the host machine navigate to your home directory:

Next, create a folder on the E31x, "localinstall"

$ mkdir -p ~/localinstall

Next, copy the etc/, setup_env.sh and usr/ folder to this new local folder:

$ cd ~/localinstall

$ cp -Rv ~/newinstall/setup_env.sh .
$ cp -Rv ~/newinstall/etc .
$ cp -Rv ~/newinstall/usr .

Verify the folder contents:

$ ls ~/localinstall

Expected Output:

etc/
setup_env.sh
usr/

Next, we will need to update the "setup_env.sh" file that is located within the ~/localinstall/ folder.

Verify your directory location with the pwd command:

$ pwd

Expected Output:

/home/root/localinstall

Edit the setup_env.sh file to update the PATH variable to point to your new installation location (/home/root/localinstall):

$ sed -i 's/newinstall/localinstall/g' setup_env.sh

Verify your edit was successful with the command "cat":

$ cat setup_env.sh

Expected Output:

LOCALPREFIX=~/localinstall/usr
export PATH=$LOCALPREFIX/bin:$PATH
export LD_LOAD_LIBRARY=$LOCALPREFIX/lib:$LD_LOAD_LIBRARY
export LD_LIBRARY_PATH=$LOCALPREFIX/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$LOCALPREFIX/lib/python2.7/site-packages:$PYTHONPATH
export PKG_CONFIG_PATH=$LOCALPREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export GRC_BLOCKS_PATH=$LOCALPREFIX/share/gnuradio/grc/blocks:$GRC_BLOCKS_PATH
export UHD_RFNOC_DIR=$LOCALPREFIX/share/uhd/rfnoc/
export UHD_IMAGES_DIR=$LOCALPREFIX/share/uhd/images

Note, the LOCALPREFIX variable has been updated to the new location.

This setup_env.sh file needs to be source in order to utilize the new ~/localinstall location.

$ source ./setup_env.sh

Verify that the environment is setup correctly:

$ which uhd_usrp_probe

Expected Output:
/home/root/localinstall/usr/bin/uhd_usrp_probe

We can now dismount the remotely connected SSHFS folder. On the E31x, run the command:

$ umount ~/newinstall







More information about the USRP-users mailing list