Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/EttusResearch/uhd/llms.txt

Use this file to discover all available pages before exploring further.

Configuration in UHD flows through the same --args string used to identify a device. After UHD locates the device using identifier keys such as type or serial, it passes any remaining key/value pairs to the device as initialization-time settings. This means a single argument string can both select a B200 and set its master clock rate in one step.

Device Configuration via Address String

Any key/value pair not used for identification is forwarded to the device during initialization. For example:
rx_samples_to_file --args type=b200,master_clock_rate=16e6
This first finds a B200/B210 by type, then applies master_clock_rate=16e6 before the device is ready for use.

Common Configuration Keys

The table below covers the most frequently used configuration options. Individual device manuals may document additional device-specific keys.
KeyDescriptionSupported DevicesExample Value
master_clock_rateMaster clock rate in HzX3x0, X4x0, B2x0, B1x0, E3xx, E1x0, N3xxmaster_clock_rate=16e6
dboard_clock_rateDaughterboard clock rate in HzX3x0dboard_clock_rate=50e6
system_ref_rateFrequency of external reference in HzX3x0system_ref_rate=11.52e6
fpgaPath to alternative FPGA bitfileAll USB devices, X3x0 (PCIe), E310, E1x0fpga=/path/to/bitfile.bit
fwPath to alternative firmwareAll USB devices, X3x0fw=/path/to/fw.bin
ignore-cal-fileIgnore existing device calibration filesAll devices with cal-file supportignore-cal-file=1
mcrOverride master clock rate (USRP1 external clock)USRP1mcr=52e6
niusrprpc_portRPC port for NI USRP RIOX3x0niusrprpc_port=5445
self_cal_adc_delayRun ADC transfer delay self-calibrationX3x0self_cal_adc_delay=1
ext_adc_self_testRun an extended ADC self-testX3x0ext_adc_self_test=1
serialize_initForce serial initialization of motherboardsX3x0, all MPM devicesserialize_init=1
force_reinitForce reinitialization of deviceN3x0, X4x0force_reinit=1
force_mtuSkip MTU detection and use this fixed valueX3x0, E3x0, N3x0, X4x0force_mtu=8000
recover_mb_eepromDisable version checks for EEPROM recoveryX3x0recover_mb_eeprom=1
blank_eepromCaution: Erases EEPROM and can damage deviceX3x0blank_eeprom=1
blank_eeprom=1 will erase the motherboard EEPROM. Only use this key if you fully understand the consequences — it can render the device unusable.
force_mtu is only recommended when automatic MTU detection fails due to a restrictive network configuration. For per-link MTU control, prefer the mtu stream argument instead.

Subdevice Specification

A subdev spec string tells UHD which daughterboard slot and frontend to activate on a given motherboard. The format is:
<motherboard slot name>:<daughterboard frontend name>
For example, to select a WBX daughterboard in slot B:
B:0
Most configurations use a single slot/frontend pair:
# Use the A-side slot, frontend 0
--subdev "A:0"

# Use the B-side slot, frontend 0
--subdev "B:0"
A subdev spec string always pertains to a single USRP. When running multiple USRPs together, set a subdev spec for each device individually.

Slot Names

All USRP family motherboards have at least one slot named A:. The USRP1 and X3x0 have two slots, A: and B:. On devices where only one slot is declared in the subdev spec, the other slot is treated as unused.

Stream Args Configuration

When creating a streamer with get_rx_stream() or get_tx_stream(), you must provide a uhd::stream_args_t object. It has four components:

cpu_format

Format of samples in host memory (e.g., fc32, sc16)

otw_format

Format of samples over the wire (e.g., sc16, sc8)

args

Additional key/value pairs (e.g., spp=200)

channels

List of device channel indices to include in the stream

CPU Format

The CPU format describes how samples are stored in the host application’s memory buffers.
StringC++ TypeNotes
fc64std::complex<double>Complex double-precision
fc32std::complex<float>Complex single-precision (most common)
sc16std::complex<int16_t>Complex signed 16-bit integer
sc8std::complex<int8_t>Complex signed 8-bit integer
f32floatSingle-precision real
s16int16_tSigned 16-bit real
s8int8_tSigned 8-bit real

Over-the-Wire (OTW) Format

The OTW format describes how samples are packed for transport between host and device.
StringSupporting DevicesNotes
sc16B2xx, N2xx, N3xx, E3xx, X3xx, X4xxDefault; best dynamic range
sc12B2xxIntermediate precision
sc8B2xx, N2xxDoubles available bandwidth at reduced dynamic range
fc32B2xxComplex float over the wire

Additional Stream Args

Pass extra settings via stream_args.args as key/value string pairs:
stream_args.args["spp"] = std::to_string(200);    // samples per packet
stream_args.args["underflow_policy"] = "next_burst"; // TX underflow recovery
stream_args.args["fullscale"] = "1.0";             // float full-scale level
stream_args.args["streamer"] = "replay_buffered";  // use Replay block DRAM buffering
stream_args.args["throttle"] = "50%";              // limit rate to 50%

Channel Mapping

The channels field maps streamer port indices to device channel indices. This is most useful when you want to stream from a non-default channel or swap channel ordering.
// Two-channel stream: streamer port 0 → device channel 0, port 1 → device channel 1
stream_args.channels = {0, 1};

// Swap order
stream_args.channels = {1, 0};

// Single-channel stream from the B-side radio only
stream_args.channels = {1};

Two-Stage Tuning

Every USRP has two stages of tuning in its signal chain:
  1. RF front-end — the local oscillator (LO) translates between RF and IF
  2. DSP — the CORDIC on the FPGA shifts between IF and baseband
In the default automatic mode, UHD tunes the RF stage as close as possible to the requested center frequency and uses the DSP stage to correct the remaining error. The uhd::tune_request_t object gives you explicit control over both stages.
1

Simple frequency set (automatic tuning)

For most applications, a direct frequency set is sufficient:
// Tune RX chain to 915 MHz
usrp->set_rx_freq(915e6);

// Tune TX chain to 915 MHz
usrp->set_tx_freq(915e6);
2

Tune with an LO offset

Shifting the LO away from the center frequency moves the DC component out of your passband:
double target_freq  = 915e6;
double lo_offset    = 5e6;   // LO sits 5 MHz above center

uhd::tune_request_t tune_req(target_freq, lo_offset);
usrp->set_rx_freq(tune_req);
3

Force integer-N tuning

Integer-N mode reduces spurs at the cost of tuning resolution. Supported on WBX, SBX, CBX, UBX, and their variants:
uhd::tune_request_t tune_req(915e6);
tune_req.args = uhd::device_addr_t("mode_n=integer");
usrp->set_rx_freq(tune_req);
4

Multi-channel shared-LO tuning

On devices that share one LO per daughterboard (e.g., N300/N310), offset each channel so they share the same LO frequency:
// Channel 0: 806 MHz, LO offset -5 MHz → LO at 801 MHz
uhd::tune_request_t tune_req_ch0(806e6, -5e6);
usrp->set_tx_freq(tune_req_ch0, 0);

// Channel 1: 796 MHz, LO offset +5 MHz → LO at 801 MHz (shared)
uhd::tune_request_t tune_req_ch1(796e6, 5e6);
usrp->set_tx_freq(tune_req_ch1, 1);

LO Lock and Settling Time

After any tune command, the RF front-end needs time for the LO to lock before you start streaming. Either poll the sensor or sleep for a conservative interval:
usrp->set_rx_freq(915e6);
while (!usrp->get_rx_sensor("lo_locked").to_bool()) {
    // sleep a few milliseconds between polls
}
// Now safe to issue stream command
usrp->issue_stream_cmd(stream_cmd);

Setting Gain, Rate, and Bandwidth

// Set sample rate (UHD will find the nearest valid rate)
usrp->set_rx_rate(10e6);   // 10 Msps RX
usrp->set_tx_rate(10e6);   // 10 Msps TX

// Set gain (0 to max_gain, device-dependent)
usrp->set_rx_gain(30.0);   // 30 dB RX gain
usrp->set_tx_gain(20.0);   // 20 dB TX gain

// Set analog bandwidth (optional, device-dependent)
usrp->set_rx_bandwidth(8e6);  // 8 MHz analog filter
usrp->set_tx_bandwidth(8e6);
Sample rates must satisfy master_clock_rate / desired_sample_rate = integer. On devices with a fixed master clock (USRP1, USRP2, N2xx), fewer valid rates are available. On B2xx and E3xx, UHD can automatically select a compatible master clock rate.

MPM Configuration Files

For MPM-based devices (N3xx, E320, E31x), additional defaults can be set in the device’s MPM configuration file and overridden by UHD at runtime.
KeyDescriptionDevicesExample
enable_gpsPower the GPSDO on/offN3xx, E320enable_gps=0
enable_fp_gpioEnable/disable power to the front-panel GPIOsN3xx, E320enable_fp_gpio=0
clock_sourceDefault clock sourceN3xx, E320, E31xclock_source=external
time_sourceDefault time sourceN3xx, E320, E31xtime_source=external
rx_lo_sourceDefault RX LO sourceN310rx_lo_source=external
tx_lo_sourceDefault TX LO sourceN310tx_lo_source=external
pps_exportDefault PPS export valueN3xxpps_export=0
forward_ethSet forwarding policy for Ethernet packetsN3xxforward_eth=1
forward_bcastSet forwarding policy for broadcast packetsN3xxforward_bcast=1
master_clock_rateDefault master clock rateN3xx, E320, E31xmaster_clock_rate=1e6
skip_boot_initDefer device init to first UHD runN3xxskip_boot_init=1
no_reload_fpgaDon’t load idle image after session endsE31xno_reload_fpga=1

Build docs developers (and LLMs) love