libbladeRF  2.2.1
Nuand bladeRF library
Configuration File

libbladeRF supports an optional configuration file. This feature is useful for specifying preferred default settings, or for configuring options that aren't yet supported by a third-party application. If found, the configuration file is parsed immediately after a bladeRF is opened and initialized by libbladeRF.

A configuration file may be named either bladeRF.conf (preferred) or bladerf.conf. libbladeRF uses the same search path it uses for finding FPGA images and calibration tables, defined by file_find() in file_ops.c:

Linux and OSX:

Windows:

Note: libbladeRF will only find and process the first configuration file it finds. Any other files appearing later in the search path will be ignored.

A valid configuration file may contain:

The below example loads an FPGA image from /home/user/hostedx40.rbf, set the trim DAC value to 592, and set the frequency to 2.4 GHz, when any bladeRF is opened:

# Load the hostedx40.rbf FPGA image, set the trim DAC, and
# configure the frequency
fpga /home/user/hostedx40.rbf
trimdac 592
frequency 2.4G

Restrictions

Options may be restricted to bladeRFs that match a particular description. A restriction applies to all options following it, until the next restriction (or the end of the file). When iterating through the configuration file, a given option will be applied if the target bladeRF matches the most recent restriction (or if there are no restrictions). If it does not, the option will be silently ignored.

Matching by FPGA size

The following restrictions are based on the FPGA size on the bladeRF board:

The following example would program the FPGA with /home/user/hostedx40.rbf when initializing a bladeRF x40, but would program it with /home/user/hostedx115.rbf if the bladeRF is an x115 model.

trimdac 592
frequency 2.4G
[x40]
fpga /home/user/hostedx40.rbf
[x115]
fpga /home/user/hostedx115.rbf

Matching by Device Identifier String

A restriction of [<device identifier string>] will limit the following options to bladeRFs matching that string. Under the hood, any square-bracketed string that is not otherwise recognized gets passed to bladerf_devstr_matches() as a possible device identifier string.

The general form of a device identifier string is:

<backend>:[device=<bus>:<addr>] [instance=<n>] [serial=<serial>]

Note: Please see bladerf_open() for a complete description of device identifier strings.

The below example is similar to the above examples. However, it will apply different trimdac values to two specific boards, which are identified by serial number.

trimdac 592
frequency 2.4G
[x40]
fpga /home/user/hostedx40.rbf
[x115]
fpga /home/user/hostedx115.rbf
[*:serial=febe585efb9e3f36c87c3e4db1b2adee]
trimdac 440
[*:serial=07dea50449172fcd63e711d7e5fe9bb4]
trimdac 498

Matching any device

Finally, a wildcard ([*]) or empty ([]) restriction will match any device, and may be used to "cancel" a previous restriction.


Options

Options (unless ignored due to a restriction) will be applied sequentially, immediately following initialization of the bladeRF.

Note: If the same option key is specified more than once, it will be applied more than once; e.g. specifying frequency 2.4G and then frequency 400M will first tune the frequency to 2.4 GHz, and then to 400 MHz.

Suffixes

Where noted above, the following suffixes are supported: