SDR Nodes

An SDR node at ExPECA is a USRP E320 which is powered over ethernet.

Make sure the following configurations are done before deplyment. You need to have connect to the SDR with a micro USB cable. Prepare a SD card reader as well.

Download NI Reference Design version 4.3.0.0

NOTE: make sure you disable conda environment conda deactivate if there is any before the following commands.

In order to change the UHD version on the radio, you must first install the desired UHD version on your host.

sudo apt install -y libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools cmake build-essential

git clone https://github.com/EttusResearch/uhd.git ~/uhd
cd ~/uhd
git checkout v4.3.0.0
cd host
mkdir build
cd build
cmake ../
make -j $(nproc)
make test # This step is optional
sudo make install
sudo ldconfig

Use uhd_images_downloader to pull the relevant sd image and fpga bitstream.

Clean Copy NI Reference Design to SD Card

Insert E320's SD card and unmount all partitions. Running the command lsblk again will show these partitions have been unmounted. If they are not (MOUNTPOINT is specified) unmount them.

We write the SD card image using dd to write the disk image, if the sdimg is located on the PC, run

  • there is no indication of progress. So be patient.

If the sdimg is located on a USB stick, run

To ensure the disk is synchronized, run the sync command:

Copy all the files inside boot partition to the host. Download micro-controller's new firmware.

Re-partition the SD card

In order to make an E320 dual boot, we need to copy Mangocomm's boot files into the boot partition alongside the reference boot files. However, boot partition is too small and it needs to be resized. The approach is to append some storage from data partition which is almost free to boot partition.

We use Linux's GParted tool. Install it using the package manager and open the SD card using it. NI E320 SD card by default comes with 4 partitions:

Note that partition 1 is named boot, its type is FAT16 and has boot and lba flags.

Make a backup from both boot and data partitions that we want to resize. For the boot partition you can copy the files with cp command. But for the data partition use dd to create an image. We do that to avoid modifing the files permissions on this partition.

Run GParted, unmount all partitions.

Apply the following changes using GParted

  1. Shrink /dev/sda4 to 10.7G (400MB will be freed)

  2. Delete /dev/sda1.

  3. Create a new FAT16 partition with the label boot located after /dev/sda4 using the freed space.

Apply the operations, then don't forget to add the flags: 4. Add flags boot and lba to /dev/sda1

The result should look like this

Mount the new BOOT partition

Copy from the host, boot partition files that you saved before to the new boot partition. Also create mango_bootbin and ni_bootbin folders on this partition. Copy NI's boot.bin file to its folder.

Create and Copy Mangocomm boot files

Create FPGA image

TODO

Create petalinux image

For each device, a new petalinux image must be built with a new MAC address for the rj45 port. Follow the instructions here to create the petalinux project.

Open the project folder

  1. Modify /etc/network/interfaces file for the static ip of eth0

Note that auto eth0 is important, otherwise the interface won't come up.

  1. Build ifupdown module

  1. Change ethernet MAC address

Open the petalinux-config

Then proceed to "Subsystem AUTO Hardware Settings" -> "Ethernet Settings" for setting the ethernet MAC address and static ip. Set the MAC to randomized address generation and static ip without gateway. Then, save the settings and exit the configuration. Return to the config's "Ethernet Settings" and check the generated MAC address. Write it down.

NOTE: the project creates u-boot with Xilinx's automatic configurations. However, the project does not compile successfully in Ubuntu 18.04. To bypass that, open petalinux-config and save it again without any change :D. Then build the project again.

  1. Build the project

Copy Mango boot files

From petalinux project

From Xilinx SDK

Finally boot should be like:

Note that we keep boot.bin files in seperate folders for later use.

Unmount the BOOT partition

Bring up and Configure NI design

Now insert back the SD card and turn on the device with micro usb connected to the host. Establish UART connection using the screen tool.

Setup NI design's static ips by editting these files and restarting the networking deamon:

  1. Set the eth0 and sfp0 ip addresses using these commands:

For example eth0 file should be like:

sfp0 should be like:

  1. Check the eeprom by using eeprom-dump command on the USRP.

Write down eth_addr0 address to set in the next step for eth0.

  1. Create a systemd link file for the eth0 to change the MAC address policy to none and set the mac address, speed, and duplex modes.

Replace the mac address with the one from eeprom:

You can check link file and test it via

  1. Remove all tmp backup files created by vim or anythin else in the folder.

  1. Restart systemd-networkd and reboot

Network troubleshoot and checking instructions

Check all interfaces status

Check eth0 network config. Verify that it is using 10-eth0.link and 40-eth0.network network file.

Check advertised link speeds and connection staatus via:

Update E320 FPGA on NI design

In this section we update the FPGA image to version 4.3.0.0 and the XG version to work with the SFP port and 9000 mtu. Put back the sd card into E320, load NI design if you haven't and make sure the host is connected to it via network. Load fpga image by running the following command on the host

Probe the Device from host if you needed

Enable autoboot

This should be done on NI design. Enable autoboot on the SDR as show here: kb.ettus.com/E320_Getting_Started_Guide#Autoboot.

You need to upgrade the embedded controller's firmware so it honors the autoboot setting.

Type y on both questions. Then reboot shutdown -r now.

Verify that autoboot is enabled by unplugging and replugging the PoE cable. The SDR must boot up without the need to press the power button.

Switch to Mango Deign and check it

Open UART screen or use SSH to run the following commands.

Switch to Mango WLAN from NI:

Switch back to NI Reference design from Mango:

Then, run a reboot.

Check the eth static ip:

Run WiFi on Mango Design

Every time mango design boots up, modprobe should be run to bring up the wlan driver, then we change the mac address from default to another one in order to resolve mac address conflicts.

Fix UART preventing boot in Mango design

Mango design does not boot without a micro USB cable (UART) connected. In order to resolve that, we use the following hack:

  • Prepare a microUSB to USB cable, where the +5V wire and GND wire are untouched but data wires are grounded (solder them to the GND wire).

  • Connect the USB socket to E320's USB port, connect the microUSB socket to E320's microUSB port.

  • This way the E320's UART transciver which should be powered externally comes up, but since data pins are grounded, it finds nothing and continues.

Read more here: https://support.xilinx.com/s/question/0D52E00006iHma8SAC/zc702-booting-stops-without-uart?language=en_US

Use sdr-tools package to control the SDR

The sdr-tools Python package is developed to control the ExPECA SDRs from any device with network connection to the management port. We show how to do that on the controller node. It is containerized:

For example to change the design on SDR 3 to mango, run the following on the controller:

Tenant Network Configuration

When the device is ready to be attached to the network, there will be 2 connections to the tenants switch: one rj45 and one sfp. Write down which ports they are connected to e.g. "te1/0/28" and "te2/0/15". Later, we register these two ports as one network segment in Openstack after deployment. Therefore, you must make sure that on the tenant switch, they are cleared of any default/native access VLANs. This is necessary to avoid access from other open ports on the switch.

Last updated