| libbladeRF 2.6.0-git-fcf94233-dirty Nuand bladeRF library

Loading...
Searching...
No Matches
Functions
Firmware and FPGA

## Description

These functions provide the ability to load and program devices on the bladeRF board.

Care should be taken with bootloader recovery functions to ensure that devices operated on are indeed a bladeRF, as opposed to another FX3-based device running in bootloader mode.

These functions are thread-safe.

## Functions
API_EXPORT int CALL_CONV | bladerf_flash_firmware (struct bladerf *dev, const char *firmware)
API_EXPORT int CALL_CONV | bladerf_load_fpga (struct bladerf *dev, const char *fpga)
API_EXPORT int CALL_CONV | bladerf_flash_fpga (struct bladerf *dev, const char *fpga_image)
API_EXPORT int CALL_CONV | bladerf_erase_stored_fpga (struct bladerf *dev)
API_EXPORT int CALL_CONV | bladerf_device_reset (struct bladerf *dev)
API_EXPORT int CALL_CONV | bladerf_get_fw_log (struct bladerf *dev, const char *filename)
API_EXPORT int CALL_CONV | bladerf_jump_to_bootloader (struct bladerf *dev)
API_EXPORT int CALL_CONV | bladerf_get_bootloader_list (struct bladerf_devinfo **list)
API_EXPORT int CALL_CONV | bladerf_load_fw_from_bootloader (const char *device_identifier, bladerf_backend backend, uint8_t bus, uint8_t addr, const char *file)

## Function Documentation

## ◆ bladerf_device_reset()

API_EXPORT int CALL_CONV bladerf_device_reset | ( | struct bladerf * | dev | ) |

Reset the device, causing it to reload its firmware from flash

Parameters

  dev | Device handle

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_erase_stored_fpga()

API_EXPORT int CALL_CONV bladerf_erase_stored_fpga | ( | struct bladerf * | dev | ) |

Erase the FPGA region of SPI flash, effectively disabling FPGA autoloading

Parameters

  dev | Device handle

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_flash_firmware()

API_EXPORT int CALL_CONV bladerf_flash_firmware | ( | struct bladerf * | dev,
|  | const char * | firmware )

Write FX3 firmware to the bladeRF's SPI flash

Note
  This will require a power cycle to take effect

Parameters

  | dev | Device handle
  [in] | firmware | Full path to firmware file

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_flash_fpga()

API_EXPORT int CALL_CONV bladerf_flash_fpga | ( | struct bladerf * | dev,
|  | const char * | fpga_image )

Write the provided FPGA image to the bladeRF's SPI flash and enable FPGA loading from SPI flash at power on (also referred to within this project as FPGA "autoloading").

Parameters

  | dev | Device handle
  [in] | fpga_image | Full path to FPGA file

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_get_bootloader_list()

API_EXPORT int CALL_CONV bladerf_get_bootloader_list | ( | struct bladerf_devinfo ** | list | ) |

Get a list of devices that are running the FX3 bootloader.

After obtaining this list, identify the device that you would like to load firmware onto. Save the bus and address values so that you can provide them to bladerf_load_fw_from_bootloader(), and then free this list via bladerf_free_device_list().

Parameters

  [out] | list | Upon finding devices, this will be updated to point to a list of bladerf_devinfo structures that describe the identified devices.

Returns
  Number of items populated in list, or an error value from the Error codes list on failure

## ◆ bladerf_get_fw_log()

API_EXPORT int CALL_CONV bladerf_get_fw_log | ( | struct bladerf * | dev,
|  | const char * | filename )

Read firmware log data and write it to the specified file

Parameters

  | dev | Device to read firmware log from
  [in] | filename | Filename to write log information to. If set to NULL, log data will be printed to stdout.

Returns
  0 upon success, or a value from Error codes list on failure

## ◆ bladerf_jump_to_bootloader()

API_EXPORT int CALL_CONV bladerf_jump_to_bootloader | ( | struct bladerf * | dev | ) |

Clear out a firmware 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.

Parameters

  dev | Device handle

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_load_fpga()

API_EXPORT int CALL_CONV bladerf_load_fpga | ( | struct bladerf * | dev,
|  | const char * | fpga )

Load device's FPGA.

Note
  This FPGA configuration will be reset at the next power cycle.

Parameters

  | dev | Device handle
  [in] | fpga | Full path to FPGA bitstream

Returns
  0 upon successfully, or a value from Error codes list on failure

## ◆ bladerf_load_fw_from_bootloader()

API_EXPORT int CALL_CONV bladerf_load_fw_from_bootloader | ( | const char * | device_identifier,
|  | bladerf_backend | backend,
|  | uint8_t | bus,
|  | uint8_t | addr,
|  | const char * | file )

Download firmware to the specified device that is enumarating an FX3 bootloader, and begin executing the firmware from RAM.

Note
  This function does not write the firmware to SPI flash. If this is desired, open the newly enumerated device with bladerf_open() and use bladerf_flash_firmware().

Parameters

  [in] | device_identifier | Device identifier string describing the backend to use via the <backend>:device=<bus>:<addr> syntax. If this is NULL, the backend, bus, and addr arguments will be used instead.
  [in] | backend | Backend to use. This is only used if device_identifier is NULL.
  [in] | bus | Bus number the device is located on. This is only used if device_identifier is NULL.
  [in] | addr | Bus address the device is located on. This is only used if device_identifier is NULL.
  [in] | file | Filename of the firmware image to boot

Returns
  0 on success, value from Error codes list on failure