The function to create cal data now is a wrapper around
bladerf_alloc_image() which initializes the returned image with
calibration data.
The associated CLI command now allows this to be either written to a
file or to the device directly.
API header cleanup: Pushed the lower level functions to to the end of
the header, so the functions people will use more frequently will be at
the top of the generated documentation.
Also added a missing API_EXPORT and made the Doxygen color scheme a little
more blue. (Tired of grayscale ;) )
Windows cleanup: Added get_timestamp() implementation, cleaned up
warnings, address some portability issues.
These changes simplify the image format a bit; the metadata fields are
flattened into the image to simplify both image creation and manually
viewing/extracting contents from images.
The checksum has been moved to directly after the file format's magic
value (i.e., signature), to make it a bit easier to just extract data
via dd. Similar to the approach used by mkimage for U-Boot headers,
the checksum calculation is performed over the entire image, with the
checksum field zeroed out.
Touched up CLI backup/restore commands and separated <address>
and <length> to separate args.
- Verify flash pages as they are written
- Add function for initializing the calibration region in flash
- Add functions to read/write flash images with sha256 and metadata
- Add support for unaligned read/program
Where possible (and with contributor permission), items have been
changed to LGPLv2.1 or MIT licenses to avoid issues with any proprietary
libraries from vendors (HDL and FW), allow static linking (with headless
mode operation in mind), and to generally present users with more
permissive licenses.
File headers and the COPYING have been updated accordingly. Third party
sources have been either removed, replaced, or relocated in the source
tree, in accordance with the licenses decided upon for each part of the tree.
Contributor Assignment Agreements have been added, and it is required
that these be submitted before significant patches and pull requests
are accepted.
CMake option added to disable log.c for libbladeRF. Adjustments made
to other files as needed to address warnings (becoming errors via
-Werror and /Wx).
Removed return values for log-related functions, as these were unused
and made it slightly more annoying to make this change. The libbladeRF
minor version has been bumped to note this change in the currently
unstable series v0.x.x series.
With future license-related cleanup, all GPLv2 programs will live
in the utilities directory. As such, ezusb.c has been moved out
of the library, and the bladeRF-cli utility has been modified to
use this directly.
The rx and tx CLI commands now use the asynchronous stream interface to
yield more acceptable performance, and this code has been overhauled for
better readability. Command parameters have been added to allow for
configuration of the stream.
Although a bit overzealous, as "lock it if you use it" approach is taken
here. Optimizations may follow later..
Some rx/tx parameters now support K/M/G suffixes, where relevant.
To support sample rate sanity checks, an API function to check the
current USB speed has been added to libbladeRF. This speed is now
reported in the CLI 'info' command.
This commit adds the command line and libbladeRF support for flashing an image
to flash so that the bladeRF will auto-load the image when it boots. An rbf can
be loaded by running `bladeRF-cli -H ./hostedx40.rbf`. This will cause the FX3
firmware to load the FPGA image from flash the next time the unit boots, this
should not cause any problems reprogramming the device after it's already
loaded. To disable the auto-load feature after enabling it run
`bladeRF-cli -H X`, this destroys the FPGA image stored in flash.
The API now presents a version structure that includes major, minor, and
patch versions. It additionally provides a "describe" string which
includes these version items in a string format, with any additional
annotations (such as git revision and dirty flag).
This changeset removes the older version functions, breaking reverse
compatibility (intentionally). Bumped minor version to reflect this change.
(The 0.Y.Z series is considered unstable at this time.)
[fx3]: Use CMake to make a version string which is populated at runtime that is
very similar to the git version strings for the library and CLI.
[libbladeRF]: Added a an API call to get the string representation of the
firmware. Errors getting this string will result in '?' being populated in the
returned string.
[cli]: Added a firmware string which is printed under the actual string itself.
Resolves issue #123
host/CMakeLists.txt uses CMAKE_CURRENT_LIST_DIR, which does not exist
before 2.8.3. Updating this to avoid obscure build errors on old
machines.
Also adding a few missing cmake_minimum_required directives to avoid
a warning that likes to pop up when they're missing.
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.