BLADERF-CLI(1) User Commands BLADERF-CLI(1) NAME bladeRF-cli - command line interface and test utility SYNOPSIS bladeRF-cli DESCRIPTION The bladeRF-cli utility is used to flash firmware files, load FPGA bitstreams, and perform other tasks on the nuand bladeRF software- defined radio system. For more information on obtaining or building firmware files and FPGA bitstreams, please visit http://nuand.com/. bladeRF command line interface and test utility (1.9.0-git) OPTIONS -d, --device Use the specified bladeRF device. -f, --flash-firmware Write the provided FX3 firmware file to flash. -l, --load-fpga Load the provided FPGA bitstream. -L, --flash-fpga Write the provided FPGA image to flash for autoloading. Use -L X or --flash-fpga X to disable FPGA autoloading. -p, --probe Probe for devices, print results, then exit. A non-zero return status will be returned if no devices are available. -e, --exec Execute the specified interactive mode command. Multiple -e flags may be specified. The commands will be executed in the provided order. -s, --script Run provided script. -i, --interactive Enter interactive mode. --lib-version Print libbladeRF version and exit. -v, --verbosity Set the libbladeRF verbosity level. Levels, listed in increasing verbosity, are: critical, error, warning, info, debug, verbose --version Print CLI version and exit. -h, --help Show this help text. --help-interactive Print help information for all interactive commands. Notes: The -d option takes a device specifier string. See the bladerf_open() documentation for more information about the format of this string. If the -d parameter is not provided, the first available device will be used for the provided command, or will be opened prior to entering interactive mode. Commands are executed in the following order: Command line options, -e , script commands, interactive mode commands. When running 'rx/tx start' from a script or via -e, ensure these commands are later followed by 'rx/tx wait [timeout]' to ensure the program will not attempt to exit before reception/transmission is complete. INTERACTIVE COMMANDS bladeRF-cli supports a scriptable interactive mode. Run bladeRF-cli --interactive to enter this mode. Type "help" for a listing of all commands, or "help " for more information about . calibrate Usage: calibrate [options] Perform the specified transceiver calibration operation. Available operations: o LMS internal DC offset auto-calibrations o calibrate lms [show] o calibrate lms tuning [value] o calibrate lms txlpf [ ] o calibrate lms rxlpf [ ] o calibrate lms rxvga2 [ ] Perform the specified auto-calibration, or all of them if none are provided. When values are provided, these are used instead of the results of the auto-calibration procedure. Use lms show to read and print the current LMS calibration values. For rxvga2, I1 and Q1 are the Stage 1 I and Q components respectively, and I2 and Q2 are the Stage 2 I and Q components. o RX and TX I/Q DC offset correction parameter calibration o calibrate dc [ ] o calibrate dc Calibrate the DC offset correction parameters for the current frequency and gain settings. If a I/Q values are provided, they are applied directly. cal rxtx is shorthand for cal rx followed by cal tx. o RX and TX I/Q balance correction parameter calibration o calibrate iq Set the specified IQ gain or phase balance parameters. o Generate RX or TX I/Q DC correction parameter tables o calibrate table dc [ [f_inc]] Generate and write an I/Q correction parameter table to the current working directory, in a file named _dc_.tbl. f_min and f_max are min and max frequencies to include in the table. f_inc is the frequency increment. By default, tables are generated over the entire frequency range, in 10 MHz steps. o Generate RX or TX I/Q DC correction parameter tables for AGC Look Up Table o calibrate table agc [ [f_inc]] Similar usage as calibrate table dc except the call will set gains to the AGC's base gain value before running calibrate table dc. clear Usage: clear Clears the screen. echo Usage: echo [arg 1] [arg 2] ... [arg n] Echo each argument on a new line. erase Usage: erase Erase specified erase blocks SPI flash. o - Erase block offset o - Number of erase blocks to erase flash_backup Usage: flash_backup ( |
) Back up flash data to the specified file. This command takes either two or four arguments. The two-argument invocation is generally recommended for non-development use. Parameters: o - Type of backup. This selects the appropriate address and length values based upon the selected type. Valid options are: Option Description -------------------------------------------------------------------- cal Calibration data fw Firmware fpga40 Metadata and bitstream for 40 kLE FPGA fpga115 Metadata and bitstream for 115 kLE FPGA fpgaA4 Metadata and bitstream for 49 kLE (A4) FPGA fpgaA5 Metadata and bitstream for 77 kLE (A5) FPGA fpgaA9 Metadata and bitstream for 301 kLE (A9) FPGA o
- Address of data to back up. Must be erase block-aligned. o - Length of region to back up. Must be erase block-aligned. Note: When an address and length are provided, the image type will default to raw. Examples: o flash_backup cal.bin cal Backs up the calibration data region. o flash_backup cal_raw.bin 0x30000 0x10000 Backs up the calibration region as a raw data image. flash_image Usage: flash_image [output options] Print a flash image's metadata or create a new flash image. When provided with the name of a flash image file as the only argument, this command will print the metadata contents of the image. The following options may be used to create a new flash image. o data= File to containing data to store in the image. o address= Flash address. The default depends upon type parameter. o type= Type of flash image. Defaults to raw. Valid options are: Option Description -------------------------------------------------------------------- cal Calibration data fw Firmware fpga40 Metadata and bitstream for 40 kLE FPGA fpga115 Metadata and bitstream for 115 kLE FPGA fpgaA4 Metadata and bitstream for 49 kLE (A4) FPGA fpgaA5 Metadata and bitstream for 77 kLE (A5) FPGA fpgaA9 Metadata and bitstream for 301 kLE (A9) FPGA raw Raw data. The address and length parameters must be provided if this type is selected. o serial= Serial # to store in image. Defaults to zeros. flash_init_cal Usage: flash_init_cal [] Create and write a new calibration data region to the currently opened device, or to a file. Be sure to back up calibration data prior to running this command. (See the flash_backup command.) o Either 40 or 115, depending on the device model. o VCTCXO/DAC trim value (0x0-0xffff) o File to write calibration data to. When this argument is provided, no data will be written to the device's flash. flash_restore Usage: flash_restore [
] Restore flash data from a file, optionally overriding values in the image metadata. o
Defaults to the address specified in the provided flash image file. o Defaults to length of the data in the provided image file. fw_log Usage: fw_log [filename] Read the contents of the device's firmware log and write it to the specified file. If no filename is specified, the log content is written to stdout. help Usage: help [] Provides extended help, like this, on any command. info Usage: info Prints the following information about an opened device: o Serial number o VCTCXO DAC calibration value o FPGA size o Whether or not the FPGA is loaded o USB bus, address, and speed o Backend (Denotes which device interface code is being used.) o Instance number jump_to_boot Usage: jump_to_boot Clear out a FW signature word in flash and jump to FX3 bootloader. The device will continue to boot into the FX3 bootloader across power cycles until new firmware is written to the device. load Usage: load Load an FPGA bitstream or program the FX3's SPI flash. xb Usage: xb [parameters] Enable or configure an expansion board. Valid values for board_model: o 100 XB-100 GPIO expansion board o 200 XB-200 LF/MF/HF/VHF transverter expansion board o 300 XB-300 amplifier board Common subcommands: o enable Enable the XB-100, XB-200, or XB-300 expansion board. XB-200 subcommands: o filter [rx|tx] [50|144|222|custom|auto_1db|auto_3db] Selects the specified RX or TX filter on the XB-200 board. Below are descriptions of each of the filter options. o 50 Select the 50-54 MHz (6 meter band) filter. o 144 Select the 144-148 MHz (2 meter band) filter. o 222 Select the 222-225 MHz (1.25 meter band) filter. Realistically, this filter option is actually slightly wider, covering 206 MHz - 235 MHz. o custom Selects the custom filter path. The user should connect a filter along the corresponding FILT and FILT-ANT connections when using this option. Alternatively one may jumper the FILT and FILT-ANT connections to achieve "no filter" for reception. (However, this is _highly_ discouraged for transmissions.) o auto_1db Automatically selects one of the above choices based upon frequency and the filters' 1dB points. The custom path is used for cases that are not associated with the on-board filters. o auto_3db Automatically selects one of the above choices based upon frequency and the filters' 3dB points. The custom path is used for cases that are not associated with the on-board filters. XB-300 subcommands: o [on|off] Enable or disable the power amplifier (PA), low-noise amplifier (lna) or auxillary LNA (aux). The current state if the specified device is printed if [on|off] is not specified. Note: The auxillary path on the XB-300 is not populated with components by default; the aux control will have no effect upon the RX signal. This option is available for users to modify their board with custom hardware. o Read the current Power Detect (PDET) voltage and compute the output power. o trx The default XB-300 hardware configuration includes separate RX and TX paths. However, users wishing to use only a single antenna for TRX can do so via a modification to resistor population options on the XB-300 and use this command to switch between RX an TX operation. (See R8, R10, and R23 on the schematic.) Examples: o xb 200 enable Enables and configures the XB-200 transverter expansion board. o xb 200 filter rx 144 Selects the 144-148 MHz receive filter on the XB-200 transverter expansion board. o xb 300 enable Enables and configures the use of GPIOs to interact with the XB-300. The PA and LNA will disabled by default. o xb 300 lna on Enables the RX LNA on the XB-300. LED D1 (green) is illuminated when the LNA is enabled, and off when it is disabled. o xb 300 pa off Disables the TX PA on the XB-300. LED D2 (blue) is illuminated when the PA is enabled, and off when it is disabled. mimo Usage: mimo [master | slave] Modify device MIMO operation. IMPORTANT: This command is deprecated and has been superseded by "print/set smb_mode". For usage text, run: "set smb_mode" open Usage: open [device identifiers] Open the specified device for use with successive commands. Any previously opened device will be closed. The general form of the device identifier string is: :[device=:] [instance=] [serial=] See the bladerf_open() documentation in libbladeRF for the complete device specifier format. peek Usage: peek
[num_addresses] The peek command can read any of the devices hanging off the FPGA. This includes the: o bladeRF 1: LMS6002D transceiver, VCTCXO trim DAC, Si5338 clock generator o bladeRF 2: AD9361 transceiver, VCTCXO trim DAC, ADF4002 frequency synthesizer If num_addresses is supplied, the address is incremented by 1 and another peek is performed for that many addresses. Valid Address Ranges: Device Address Range --------------------------- rfic 0 to 0x3F7 (1015) pll 0 to 3 dac 0 to 255 lms 0 to 127 si 0 to 255 Example: o peek si ... poke Usage: poke
The poke command can write any of the devices hanging off the FPGA. This includes the: o bladeRF 1: LMS6002D transceiver, VCTCXO trim DAC, Si5338 clock generator o bladeRF 2: AD9361 transceiver, VCTCXO trim DAC, ADF4002 frequency synthesizer Valid Address Ranges: Device Address Range --------------------------- rfic 0 to 0x3F7 (1015) pll 0 to 3 dac 0 to 255 lms 0 to 127 si 0 to 255 Example: o poke lms ... print Usage: print [parameter] The print command takes a parameter to print. Available parameters are listed below. If no parameter is specified, all parameters are printed. Common parameters: Parameter Description ------------------------------------------------------------------------ bandwidth Bandwidth settings frequency Frequency settings agc Automatic gain control loopback Loopback settings rx_mux FPGA RX FIFO input mux setting gain Gain settings samplerate Samplerate settings trimdac VCTCXO Trim DAC settings tuning_mode Tuning mode settings hardware Low-level hardware status BladeRF1-only parameters: Parameter Description ------------------------------------------------------------------------ gpio FX3 <-> FPGA GPIO state lnagain RX LNA gain, in dB (deprecated) rxvga1 RXVGA1 gain, in dB (deprecated) rxvga2 RXVGA2 gain, in dB (deprecated) txvga1 TXVGA1 gain, in dB (deprecated) txvga2 TXVGA2 gain, in dB (deprecated) sampling External or internal sampling mode smb_mode SMB clock port mode of operation vctcxo_tamer Current VCTCXO tamer mode xb_gpio Expansion board GPIO values xb_gpio_dir Expansion board GPIO direction (1=output, 0=input) BladeRF2-only parameters: Parameter Description ------------------------------------------------------------------------ clock_sel System clock selection clock_out Clock output selection rssi Received signal strength indication clock_ref ADF4002 chip status refin_freq ADF4002 reference clock frequency biastee Current bias-tee status filter RFIC FIR filter selection probe Usage: probe [strict] Search for attached bladeRF device and print a list of results. Without specifying strict, the lack of any available devices is not considered an error. When provided the optional strict argument, this command will treat the situation where no devices are found as an error, causing scripts or lists of commands provided via the -e command line argument to terminate immediately. quit Usage: quit Exit the CLI. recover Usage: recover [
] Load firmware onto a device running in bootloader mode, or list all devices currently in bootloader mode. With no arguments, this command lists the USB bus and address for FX3-based devices running in bootloader mode. When provided a bus, address, and path to a firmware file, the specified device will be loaded with and begin executing the provided firmware. In most cases, after successfully loading firmware into the device's RAM, users should open the device with the "open" command, and write the firmware to flash via "load fx3 " run Usage: run