Main Content

sdruload

Load FPGA and firmware images to USRP radio

Description

example

sdruload(Device = "radio") loads the default FPGA and UHD™ firmware images to the specified radio radio. The devices can be:

  • "x300" or "x310"— For X3xx devices, this syntax loads the default images to the radio at IP address 192.168.10.2.

    Note

    sdruload uses the uhd_image_loader utility, which is already installed as a part of Communications Toolbox™ Support Package for USRP™ Radio for burning firmware images to the device.

  • "USRP2"— For a USRP2™ radio, this syntax prompts you to select an SD card and loads the images to that card.

    Note

    sdruload uses the usrp2_card_burner.py Python script provided by Ettus Research™ for burning firmware images to the device.

    Warning

    When using the card burner script to burn images with the Python script, it is possible to overwrite your hard drive. To avoid accidentally overwriting the wrong drive, carefully select the correct drive for the radio.

    The firmware images are the UHD versions compatible with the Communications Toolbox Support Package for USRP Radio.

    You can obtain the compatible UHD version number by entering getSDRuDriverVersion at the MATLAB® command prompt.

sdruload(Device = "radio", Name = Value), specifies additional name-value arguments.

status = sdruload(___) returns the status of the sdruload function. Use this syntax in combination with any of the input arguments in the previous syntaxes.

Examples

collapse all

Load the default FPGA image to an X300 device at IP address 192.168.30.5 and return the status of the operation. You are prompted to continue before the program uploads the image.

status = sdruload(Device = "X310", IPAddress = '192.168.30.5')
Checking radio connections...
Ready to write default FPGA image to x300 device at 192.168.30.5.
Would you like to continue? [yes/no]: yes
Writing FPGA image using uhd_image_loader...
This may take a few minutes...
Do NOT interrupt this process. Otherwise your device may be bricked.
Image was written successfully. Power-cycle your radio to use the new image.


status =

  logical

   1

Input Arguments

collapse all

USRP radio, specified as "USRP2", "x300", or "x310".

  • If you specify an invalid device, MATLAB throws an error and displays the list of valid devices.

  • If the device you specify does not match any device connected to your machine, MATLAB throws an error, lists the connected device name, and prompts you to specify the connected device or to connect another device.

    You must install additional software before executing sdruload to load firmware for a "USRP2" radio. For more information, see Update USRP2 Radio Firmware.

Example: Device = "x300"

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: sdruload(Device = "USRP2")

IP address where the X3xx series radio is located, specified as a character vector.

Example: IPAddress = '192.168.10.2'

Data Types: char | str

Valid SD card drive for USRP2 device, specified as a character vector. When Device is specified as"USRP2", sdruload loads the images for a USRP2 radio to an SD card at the SD card drive specified. If you do not specify a value for Drive, the function searches for possible SD card drives and prompts you to select one.

This option uses theusrp2_card_burner.py Python script provided by Ettus Research. For more information, see Update USRP2 Radio Firmware.

Example: Drive = "S:"

Data Types: char

FPGA image, specified as a character vector. Use this option to load an FPGA image that is compatible with the UHD version supported by MATLAB and Simulink®.

You can use this option to load custom FPGA images, including images you generate using the HDL workflow advisor. For more information, see HDL Coder™.

Note

You cannot upload custom FPGA images to X300 or X310 devices.

Firmware image file, specified as a character vector. Use this option to load the UHD firmware image that is compatible with a UHD version supported by MATLAB and Simulink.

Note

You cannot upload custom firmware images to X300 or X310 devices.

Output Arguments

collapse all

Status of firmware upload, returned as logical 1 or 0. A 1 indicates a successful upload.

Data Types: logical

Version History

Introduced in R2013b