Also updated the calibration routine in the CLI. The CLI might need rethinking since, for the calibration to be successful, the module must be enabled. Currently unless we're actively transmitting or receiving, the module is disabled.
Need to add a way to figure out if the module is enabled before trying to calibrate it.
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.
Lagecay mode support allows libbladeRF to upgrade and downgrade the firmware to
and from any version. All other features such as streaming samples, and talking
to any of the on-board devices will not work; the user has to upgrade the
firmware to the latest version before anything else can be done. The command
line now prints a message when legacy mode is enabled, and asks the user to
upgrade to the latest version.
This commit was introduced because the change over to using USB alternate
settings causes the libusb to change the device to its first alt-interface when
it is released. This basically means that as soon as the command line is closed
the device goes back to alt-interface 0. This commit figures out when this
happens and manually goes back to RFLink mode, alt-interface #1.
This commit correctly changes the bladeRF's behavior by using mutually exclusive
alternate interface settings. Interfaces are not guaranteed to be exist one at a
time, thus they are unfit for use as an operating mode index.
This merge introduces libusb-1.0 support into libbladeRF. This is now
preferred over the Linux driver backend for the time being, as it will
allow quicker ports to Windows and OSX. The Linux driver will be
significantly refactored and improved at a later time; it is not
recommended for use with this set of changes.
As of this commit, Windows and OSX builds are still works in progress.
Linux builds have been tested and verified.
** Important **
This branch also introduces CMake support, code base reorganization, and
significant API changes. Please review the updated API header (best viewed
via the Doxygen-generated html files.)
If you've been working out of the bladerf branch, it is recommended that
you clean up the following:
1. Uninstall Linux kernel module, if you have it loading at boot
2. Remove installed libbladeRF files (libbladeRF.h, pkg-config, files, .so's)
3. Remove installed CLI program
4. Remove udev rules
Please review the new "Getting started" text and the instructions in the
README.md and host/README.md files for the new build procedure.
Manually resolved Conflicts:
README.md
host/drivers/linux/bladeRF.c
host/utilities/bladeRF-cli/src/interactive/interactive.h
linux/lib/src/bladerf.c
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.
This changeset includes changes suggested by maggo1404 in the
following pull request.
https://github.com/Nuand/bladeRF/pull/52
These suggestions were reworked a bit to avoid having #ifdef
blocks throughout the codebase and to alleviate the need to copy items
between utilitie and library code.
Moved common -> firmware_common to avoid confusion with the upcoming
host/common directory.
API changes were not incorporated into the linux backend in changeset
8cc9f2a4b5 - this is addressed in this
changeset.
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.