Interactive console's argc wasn't being checked, resulting in
a bogus "Unexpected command:" and often segfaults.
In other news, I failed to note in the previus changeset that at
least half the cli changes were authored by Brian Padalino...so
doing that here - ec54e4e409
The CLI now supports flashing the FX3 and loading the FPGA from the
command line and through the interactive console.
To flash the firmware from the command line:
./bin/bladerf -b -f ./path/to/img -d /dev/bladerf1
To load the firmware from the command line:
./bin/bladerf -b -l ./path/to/rbf -d /dev/bladerf1
To flash/load interactively either run with -d /dev/bladerf1, or
use the open command to attach to a device:
bladeRF> open /dev/bladerf1
To flash the firmware interactively:
bladeRF> load fx3 ./path/to/img
To load the FPGA interactively:
bladeRF> load fpga ./path/to/rbf
Note that a power-on-reset is currently required in between
flashing firmware and loading the FPGA.
Various commands have been stubbed out for the time being. A TODO
list has been created to keep track of desired functionality.
The simple_load and upgrade_firmware programs have been removed,
as they are no longer needed.
Credit where credit is due -- All the code here is basically
copy/paste from Robert's earlier test code, with some added error
checks and debug output.
The firmware loading now checks the write return value and
performs partial writes as needed.
Items that need to be revisited are the sanity checks on file
sizes. In the future I plan to implement a "bladeRF Image" format
that will wrap size and a hash around a firmware/bitstream. These
checks will probably go into that code.
This commit introduces LMS library support for controlling the LimeMicro
LMS6002D transceiver. The LMS library functions were originally developed by
bpadalino.
This is the first commit in a set of upcoming changes that will
move functionality from simple_load and upgrade_firmware into the
libbladeRF library and provide access to these routines through a
bladeRF cli.
Don't merge from jon-dev until I get this straightened out, or
you'll be left with something possibly unusable...
Fixed bladerf_get_device_list return value for condition where no
devices are attached. (Now returns 0, previously returned -1).
Also added a missing catch of a malloc failure and now return appropriate
error value.