Initializing, extracting, and comparing device identifier information
(struct bladerf_devinfo) is now exposed through the API. Among other
things, this allow users to check if a device specifier string matches a
device they already have a handle for.
To support this, a copy of bladerf_devinfo information is now kept around in
the device handle; backends are responsible for populating this in their
open() implementation. A couple of the fields were already present, so
this only adds a couple small variables worth of overhead.
Some re-arranging of the linux and libusb probe and open calls has been done
to achieve this. A few warnings and bugs were addressed in this process:
- The Linux backend was attempting to fill in a serial number via
a cached entry.
- There was some potential for a read of an uninitialized portion
of an otp buffer.
- Missing serial # has been made non-fatal. (Some developers'
device do not have serial numbers.)
Files associated with this functionality was moved from host/common
back into the library, which should now be used instead. bladeRF-flash
has been updated to use these new API functions.
- Added method to libbladeRF
- Added new VID/PID pair to udev rule to prevent requiring root access
- Added jump_to_boot bladeRF-cli command
- Fixed most warnings in FX3 firmware
This check was only being used to print an informational message.
However, it was supposed to be used to change the return value to
indicate the FPGA being re-loaded versus loaded.
Because the caller can check the FPGA state via
bladerf_is_fpga_configured(), this check has been pulled out, and the
interface now specifies that this functions return value only indicates
success (0) or failure (error code).
Parameters have been removed from the bladerf_stream() call, because
these parameters would already have been associated with the provided
stream via the bladerf_init_stream() call.
A backend stream_init() has been added, and libusb transfer
initialization has been moved into the implementation of this
backend-specific function. This is required to ensure that
bladerf_deinit() stream can be called directly after
bladerf_init_stream(), without a call to bladerf_stream(). Such
a use case might occur if an error was detected before kicking off the
stream.
Added a mechanism to log messages with different priority levels, and to
filter which messages are output by setting a threshold level. The
function to set the current log level/verbosity is exposed through
libbladeRF.h, while the logging function/macros themselves are private
to this project, and are present in log.c/log.h. Callers should use the
convenience macros bladerf_log_[level]() to issue their log messages.
These macros piece together a format string that contains the message
priority and, for warning and higher priorities, the function and line
number on which the message was logged. Also, warning level and higher
level messages are output to stderr, rather than stdout.
Some users have shown large DC offsets. I've seen these offsets
initially but they become much more reasonable after the first
few sample buffers come out of the FPGA.
Currently DC offset appears to be +/-30 or so after running
the calibration.
In the cli, run 'cal' to run through all modules of calibration.
The ADC can be configured to sample from the internal inputs
or from the external pins. Adding the API to change the sampling
between internal and external. Also using the appropriate API
function for the CLI.
This addresses some invalid accesses reported by valgrind. However, a few issues remain:
- Accessing calibration data on a 2.0 port causes an invalid access
- The libusb backend's implemation of open() will need to be
refactored in order to support matching on serial numbers.
This is intended to simplify some portability issues, since an int
type is sufficient in the few spots where we had ssize_t.
We'll need to still add a ssize_t wrapper around the Windows
[SSIZE_T](msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx#SSIZE_T)
for use inside the library.
The _t suffix on enums has been removed, as "_t" is reserved for
POSIX types.
To avoid naming collisions, macro definitions and enumeration values are
now prefixed with at least "BLADERF_".
Also in the mix is a stubbed out "unsupported" implementation of the
stream routines for the Linux driver backend.
Added some memory allocation checks and attempts to tear down the
stream at the first sign of errors, avoiding submitting transfers
if intialization errors occurred. Also did some misc. error
code house keeping.
STREAM_ERROR has been removed. Use STREAM_SHUTTING_DOWN and the
bladerf_stream->error_code field to differentiate between a clean an
error-driven shutdown.
It appears that attempting to use the libusb backend before the FPGA is
loaded yields erroneous behavior when attempting to load the FPGA after
encountering a BLADERF_ERR_IO. (This situation requires a power on reset
of the board.) As such, an FPGA check has been added to the async test
program.
Using libusb for streams of both TX and RX. The example
tx_async test is now for both and wil save off samples
in CSV to a file. The code still needs to be audited
before it can be brought down to the mainline.