Verifying the Operation of the USRP Using UHD and GNU Radio
Contents
- 1 Application Note Information
- 2 Authors
- 3 Abstract
- 4 Overview
- 5 Proper Care and Handling
- 6 Finding the Device
- 7 UHD Programs
- 8 Benchmarking your system
- 9 Receiving Samples
- 10 Transmitting Samples
- 11 Terminal DFT/FFT
- 12 Transmit test signal
- 13 USRP as Spectrum Analyzer using uhd_fft
- 14 USRP as Signal Generator using uhd_siggen and uhd_siggen_gui
- 15 Additional UHD Utilities
Application Note Information
AN-936
Authors
Neel Pandeya and Siddhant Dhawan
Abstract
This AN explains how to use UHD and GNU Radio, once installed, to verify the correct operation of the USRP. Several test procedures are explained in detail. Several tests make use of an optional spectrum analyzer and signal generator.
Overview
This application note will cover testing your USRP to verify it is operational. You will need to have a working installation of UHD to preform the following steps to verify your USRP. If you do not have UHD installed, please reference the Building and Installing the USRP Open-Source Toolchain (UHD and GNU Radio) on Linux, OS X and Windows Application Notes.
Alternatively, you may use the Live SDR Environment to perform the following steps. More information about the Live SDR Environment is available at the Live SDR Environment Getting Started Guides page.
Proper Care and Handling
All Ettus Research products are individually tested before shipment. The USRP™ is guaranteed to be functional at the time it is received by the customer. Improper use or handling of the USRP™ can easily cause the device to become non-functional. Listed below are some examples of actions which can prevent damage to the unit:
- Never allow metal objects to touch the circuit board while powered.
- Always properly terminate the transmit port with an antenna or 50Ω load.
- Always handle the board with proper anti-static methods.
- Never allow the board to directly or indirectly come into contact with any voltage spikes.
- Never allow any water, or condensing moisture, to come into contact with the boards.
- Always use caution with FPGA, firmware, or software modifications.
| Never apply more than -15 dBm of power into any RF input | |
| Always use at least 30dB attenuation if operating in loopback configuration |
Finding the Device
- Report detailed information on UHD-supported Software Radio Peripherals attached by USB, network, or embedded configuration. Details include unit names, revision numbers, and available sensors on all attached USRP motherboards and daughterboards.
uhd_usrp_probe
Example output from uhd_usrp_probe:
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:~$ uhd_usrp_probe [INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76 [INFO] [X300] X300 initialization sequence... [INFO] [X300] Maximum frame size: 1472 bytes. [INFO] [X300] Radio 1x clock: 200 MHz _____________________________________________________ / | Device: X-Series Device | _____________________________________________________ | / | | Mboard: X310 | | revision: 11 | | revision_compat: 4 | | product: 30720 | | mac-addr0: 00:80:2f:21:9b:fa | | mac-addr1: 00:80:2f:21:9b:fb | | gateway: 192.168.10.1 | | ip-addr0: 192.168.10.3 | | subnet0: 255.255.255.0 | | ip-addr1: 192.168.20.2 | | subnet1: 255.255.255.0 | | ip-addr2: 192.168.30.2 | | subnet2: 255.255.255.0 | | ip-addr3: 192.168.40.2 | | subnet3: 255.255.255.0 | | serial: 30A0656 | | FW Version: 6.1 | | FPGA Version: 39.2 | | FPGA git hash: 6a990d9 | | RFNoC capable: Yes | | | | Time sources: internal, external, gpsdo | | Clock sources: internal, external, gpsdo | | Sensors: temp_fpga, ref_locked | _____________________________________________________ | / | | RFNoC blocks on this device: | | | | * 0/DDC#0 | | * 0/DDC#1 | | * 0/DUC#0 | | * 0/DUC#1 | | * 0/Radio#0 | | * 0/Radio#1 | | * 0/Replay#0 | _____________________________________________________ | / | | Static connections on this device: | | | | * 0/SEP#0:0==>0/DUC#0:0 | | * 0/DUC#0:0==>0/Radio#0:0 | | * 0/Radio#0:0==>0/DDC#0:0 | | * 0/DDC#0:0==>0/SEP#0:0 | | * 0/Radio#0:1==>0/DDC#0:1 | | * 0/DDC#0:1==>0/SEP#1:0 | | * 0/SEP#2:0==>0/DUC#1:0 | | * 0/DUC#1:0==>0/Radio#1:0 | | * 0/Radio#1:0==>0/DDC#1:0 | | * 0/DDC#1:0==>0/SEP#2:0 | | * 0/Radio#1:1==>0/DDC#1:1 | | * 0/DDC#1:1==>0/SEP#3:0 | | * 0/SEP#4:0==>0/Replay#0:0 | | * 0/Replay#0:0==>0/SEP#4:0 | | * 0/SEP#5:0==>0/Replay#0:1 | | * 0/Replay#0:1==>0/SEP#5:0 | _____________________________________________________ | / | | TX Dboard: 0/Radio#0 | | ID: UBX-TDD (0x0202) | | Serial: 322248F | | Revision: 2 | | _____________________________________________________ | | / | | | TX Frontend: 0 | | | Name: UBX TX | | | Antennas: TX/RX, CAL | | | Sensors: lo_locked | | | Freq range: 10.000 to 6000.000 MHz | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz | | | Connection Type: QI | | | Uses LO offset: No | _____________________________________________________ | / | | RX Dboard: 0/Radio#0 | | ID: UBX-TDD (0x0203) | | Serial: 322248F | | Revision: 2 | | _____________________________________________________ | | / | | | RX Frontend: 0 | | | Name: UBX RX | | | Antennas: TX/RX, RX2, CAL | | | Sensors: lo_locked | | | Freq range: 10.000 to 6000.000 MHz | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz | | | Connection Type: IQ | | | Uses LO offset: No | _____________________________________________________ | / | | TX Dboard: 0/Radio#1 | | ID: CBX-120 (0x0084) | | Serial: 313BF2A | | Revision: 1 | | _____________________________________________________ | | / | | | TX Frontend: 0 | | | Name: CBX-120 TX | | | Antennas: TX/RX, CAL | | | Sensors: lo_locked | | | Freq range: 1200.000 to 6000.000 MHz | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | Bandwidth range: 120000000.0 to 120000000.0 step 0.0 Hz | | | Connection Type: QI | | | Uses LO offset: No | _____________________________________________________ | / | | RX Dboard: 0/Radio#1 | | ID: CBX-120 (0x0085) | | Serial: 313BF2A | | Revision: 1 | | _____________________________________________________ | | / | | | RX Frontend: 0 | | | Name: CBX-120 RX | | | Antennas: TX/RX, RX2, CAL | | | Sensors: lo_locked | | | Freq range: 1200.000 to 6000.000 MHz | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | Bandwidth range: 120000000.0 to 120000000.0 step 0.0 Hz | | | Connection Type: IQ | | | Uses LO offset: No
- Find UHD-supporting Software Radio Peripherals attached by USB, network or embedded configuration. Uses broadcast packets for discovery. Often blocked by routers, switches, firewalls.
uhd_find_devices
Example output from uhd_find_devices:
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76
--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
serial: 30A0656
addr: 192.168.10.3
fpga: HG
name:
product: X310
type: x300
--------------------------------------------------
-- UHD Device 1
--------------------------------------------------
Device Address:
serial: 345D72B
name: PBU_USRP_2901
product: B210
type: b200
--------------------------------------------------
-- UHD Device 2
--------------------------------------------------
Device Address:
serial: 352F061
name: B206i
product: B206mini
type: b200
- View firewall settings with:
sudo iptables -L
UHD Programs
The example programs included with the UHD driver will be located at:
$install_prefix/lib/uhd/examples
On Linux, the default installation prefix location is /usr/local.
The example programs are located in the folder:
/usr/local/lib/uhd/examples
On OSX, the configuration is similar to Linux, however the default installation prefix location is /opt/local.
The example programs will be located in the folder:
/opt/local/lib/uhd/examples
On Windows, the default installation prefix will be C:\Program Files\UHD\.
The example programs will be located in the folder:
C:\Program Files\UHD\lib\uhd\examples
Before executing the following commands, change directory to the appropriate location.
Benchmarking your system
- Benchmarks interface with device.
./benchmark_rate --rx_rate 10e6 --tx_rate 10e6 --args "type=x300"
Example output from benmark_rate:
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:/usr/local/lib/uhd/examples$ ./benchmark_rate --rx_rate 10e6 --tx_rate 10e6 --args "type=x300"
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76
[00:00:00.000330] Creating the usrp device with: type=x300...
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
Using Device: Single USRP:
Device: X-Series Device
Mboard 0: X310
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: UBX RX
RX Channel: 1
RX DSP: 1
RX Dboard: B
RX Subdev: CBX-120 RX
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: UBX TX
TX Channel: 1
TX DSP: 1
TX Dboard: B
TX Subdev: CBX-120 TX
[00:00:02.315579022] Setting device timestamp to 0...
Setting TX samples per packet (spp) to 364
Setting TX samples per burst (spb) to 364
[00:00:02.318249157] Testing receive rate 10.000000 Msps on 1 channels
[00:00:02.320136063] Testing transmit rate 10.000000 Msps on 1 channels
[00:00:12.332582703] Benchmark complete.
Benchmark rate summary:
Num received samples: 99999647
Num dropped samples: 0
Num overruns detected: 0
Num transmitted samples: 100113832
Num sequence errors (Tx): 0
Num sequence errors (Rx): 0
Num underruns detected: 0
Num late commands: 0
Num timeouts (Tx): 0
Num timeouts (Rx): 0
Done!
Receiving Samples
- Saves samples to file
./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 usrp_samples.dat
Example output from rx_samples_to_file:
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:/usr/local/lib/uhd/examples$ sudo ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 --args "type=x300" usrp_samples.dat
[sudo] password for ettus-24-02:
Creating the usrp device with: type=x300...
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
Using Device: Single USRP:
Device: X-Series Device
Mboard 0: X310
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: UBX RX
RX Channel: 1
RX DSP: 1
RX Dboard: B
RX Subdev: CBX-120 RX
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: UBX TX
TX Channel: 1
TX DSP: 1
TX Dboard: B
TX Subdev: CBX-120 TX
Setting RX Rate: 5.000000 Msps...
Actual RX Rate: 5.000000 Msps...
Setting RX Freq: 98.000000 MHz...
Setting RX LO Offset: 0.000000 MHz...
Actual RX Freq: 98.000000 MHz...
Setting RX Gain: 20.000000 dB...
Actual RX Gain: 20.000000 dB...
Locking LO on channel 0
Waiting for "lo_locked": ++++++++++ locked.
Press Ctrl + C to stop streaming...
Done!
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:/usr/local/lib/uhd/examples$ sudo ./rx_samples_to_file --freq 98e6 --rate 5e6 --gain 20 --duration 10 --args "type=b200,product=B206mini" usrp_samples.dat
Creating the usrp device with: type=b200,product=B206mini...
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76
[INFO] [B200] Detected Device: B206mini
[INFO] [B200] Operating over USB 3.
[INFO] [B200] Initialize CODEC control...
[INFO] [B200] Initialize Radio control...
[INFO] [B200] Performing register loopback test...
[INFO] [B200] Register loopback test passed
[INFO] [B200] Setting master clock rate selection to 'automatic'.
[INFO] [B200] Asking for clock rate 16.000000 MHz...
[INFO] [B200] Actually got clock rate 16.000000 MHz.
Using Device: Single USRP:
Device: B-Series Device
Mboard 0: B206mini
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: FE-RX1
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: FE-TX1
Setting RX Rate: 5.000000 Msps...
[INFO] [B200] Asking for clock rate 40.000000 MHz...
[INFO] [B200] Actually got clock rate 40.000000 MHz.
Actual RX Rate: 5.000000 Msps...
Setting RX Freq: 98.000000 MHz...
Setting RX LO Offset: 0.000000 MHz...
Actual RX Freq: 98.000000 MHz...
Setting RX Gain: 20.000000 dB...
Actual RX Gain: 20.000000 dB...
Locking LO on channel 0
Waiting for "lo_locked": ++++++++++ locked.
Press Ctrl + C to stop streaming...
Done!
Example of file size output from rx_samples_to_file:
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:/usr/local/lib/uhd/examples$ ls -al usrp_samples.dat -rw-r--r-- 1 root root 200000000 Jun 16 23:53 usrp_samples.dat
Transmitting Samples
- Transmits samples from file
./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 --args "type=x300" usrp_samples.dat
Example of output from tx_samples_from_file:
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:/usr/local/lib/uhd/examples$ ./tx_samples_from_file --freq 915e6 --rate 5e6 --gain 10 --args "type=x300" usrp_samples.dat
Creating the usrp device with: type=x300...
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
Using Device: Single USRP:
Device: X-Series Device
Mboard 0: X310
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: UBX RX
RX Channel: 1
RX DSP: 1
RX Dboard: B
RX Subdev: CBX-120 RX
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: UBX TX
TX Channel: 1
TX DSP: 1
TX Dboard: B
TX Subdev: CBX-120 TX
Setting TX Rate: 5.000000 Msps...
Actual TX Rate: 5.000000 Msps...
Setting TX Freq: 915.000000 MHz...
Setting TX LO Offset: 0.000000 MHz...
Actual TX Freq: 915.000000 MHz...
Setting TX Gain: 10.000000 dB...
Actual TX Gain: 10.000000 dB...
Checking TX: TXLO: locked ...
[WARNING] [0/Radio#0] Attempting to set tick rate to 0. Skipping.
Done!
Terminal DFT/FFT
- Creates ASCII/Ncurses FFT
./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --args "type=x300" --ref-lvl -30
Example output from rx_ascii_art_dft:
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:/usr/local/lib/uhd/examples$ ./rx_ascii_art_dft --freq 98e6 --rate 5e6 --gain 20 --bw 5e6 --args "type=x300" --ref-lvl -30
Creating the usrp device with: type=x300...
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
Using Device: Single USRP:
Device: X-Series Device
Mboard 0: X310
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: UBX RX
RX Channel: 1
RX DSP: 1
RX Dboard: B
RX Subdev: CBX-120 RX
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: UBX TX
TX Channel: 1
TX DSP: 1
TX Dboard: B
TX Subdev: CBX-120 TX
Setting RX Rate: 5.000000 Msps...
Actual RX Rate: 5.000000 Msps...
Setting RX Freq: 98.000000 MHz...
Actual RX Freq: 98.000000 MHz...
Setting RX Gain: 20.000000 dB...
Actual RX Gain: 20.000000 dB...
Setting RX Bandwidth: 5.000000 MHz...
Actual RX Bandwidth: 160.000000 MHz...
Checking RX: RXLO: locked ...
Example screenshot of rx_ascii_art_dft running:
Transmit test signal
- Transmits specific waveform
./tx_waveforms --freq 915e6 --rate 5e6 --gain 0 --args "type=b200,product=B206mini"
Example output from tx_waveforms:
ettus-24-02@ettus-24-02-Dell-Pro-16-PC16255:/usr/local/lib/uhd/examples$./tx_waveforms --freq 915e6 --rate 5e6 --gain 0 --args "type=b200,product=B206mini"
Creating the usrp device with: type=b200,product=B206mini...
[INFO] [UHD] linux; GNU C++ version 13.3.0; Boost_108300; UHD_4.9.0.HEAD-0-g006d7f76
[INFO] [B200] Detected Device: B206mini
[INFO] [B200] Operating over USB 3.
[INFO] [B200] Initialize CODEC control...
[INFO] [B200] Initialize Radio control...
[INFO] [B200] Performing register loopback test...
[INFO] [B200] Register loopback test passed
[INFO] [B200] Setting master clock rate selection to 'automatic'.
[INFO] [B200] Asking for clock rate 16.000000 MHz...
[INFO] [B200] Actually got clock rate 16.000000 MHz.
Using Device: Single USRP:
Device: B-Series Device
Mboard 0: B206mini
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: FE-RX1
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: FE-TX1
Setting TX Rate: 5.000000 Msps...
[INFO] [B200] Asking for clock rate 40.000000 MHz...
[INFO] [B200] Actually got clock rate 40.000000 MHz.
Actual TX Rate: 5.000000 Msps...
Setting TX Gain: 0.000000 dB...
Actual TX Gain: 0.000000 dB...
Setting device timestamp to 0...
Setting TX Freq: 915.000000 MHz...
Setting TX LO Offset: 0.000000 MHz...
Actual TX Freq: 915.000000 MHz...
Checking TX: LO: locked ...
Press Ctrl + C to stop streaming...
^C
Done!
USRP as Spectrum Analyzer using uhd_fft
Receives signals and acts as a spectrum analyzer. The uhd_fft utility receives samples from a USRP, performs an FFT, and displays the power spectrum (frequency versus power).
You can find this utility under:
/usr/local/bin
Example:
Go to the directory:
/usr/local/bin
Run the following command:
uhd_fft --args "addr=192.168.10.2" --freq 915e6 -s 20e6 -g 25
Note: We have generated a CW signal at 915 MHz using the uhd_siggen_gui example, which is discussed in the next section. This signal is received and displayed using uhd_fft.
USRP as Signal Generator using uhd_siggen and uhd_siggen_gui
uhd_siggen is a USRP signal generator utility provided by UHD (USRP Hardware Driver). It can generate test signals or continuous wave (CW) transmissions using any UHD-supported USRP device.
It provides a simple software-based RF signal generator without requiring a custom application or GNU Radio flowgraph.
Example:
Go to the directory:
/usr/local/bin
Run the following command:
uhd_siggen --args "type=b200" --freq 915e6 -g 40
The uhd_siggen_gui utility provides the same functionality as uhd_siggen but includes a graphical user interface that allows parameters to be adjusted dynamically during operation.
Example:
Go to the directory:
/usr/local/bin
Run the following command:
uhd_siggen_gui --args "type=b200" --freq 915e6 -g 40
Additional UHD Utilities
- Downloads FPGA images for the currently installed UHD version.
sudo uhd_images_downloader
Example output from uhd_images_downloader:
$ [sudo] uhd_images_downloader Images destination: /usr/local/share/uhd/images Downloading images from: http://files.ettus.com/binaries/images/uhd-images_003.010.000.000-release.zip Downloading images to: /tmp/tmpPYd_5J/uhd-images_003.010.000.000-release.zip 58959 kB / 58959 kB (100%) Images successfully installed to: /usr/local/share/uhd/images
- Flashes an image onto the X300/X310 FPGA.
usrp_x3xx_fpga_burner
- Reads and writes motherboard EEPROM.
usrp_burn_mb_eeprom
- Reads and writes daughterboard EEPROM.
usrp_burn_db_eeprom