Changes include:
- Added XB-200 support
- Added experimental DC calibration and DC calibration table support
- Added "software autoload" of FPGAs and DC cal tables from config directories
- Added "File not found" (BLADERF_ERR_NO_FILE) return code
- Allow tuning up to 3.8GHz
- Fixed incorrect version checks
+ This resolves issue where VCTCXO value isn't loaded when using FPGA v0.0.3
- Fixed intermittent FPGA load failures
This is a vestige of earlier code. bladerf_expansion_attach() is the
function that performs the desired functionality.
As such bladerf_xb200_attach() has been made static and renamed in xb.c.
The implementations of these were the opposite of what is described
in the associated function descriptions.
Additionally, a version check was incorrectly testing the device's
firmware version instead of the FPGA version.
The DCCAL clocks need to be enable when using DC_LOAD.
However, it appears that enabling the DCCAL clocks when reading back
values at later time yields intermittently corrupted read values
Two issues existed in the LMS LPF configuration:
(1) The LPF bypass was not being disabled when switching to
BLADERF_LPF_DISABLED. Therefore, its state would be different depending
on whether the previous state was BLADERF_LPF_BYPASSED or
BLADERF_LPF_NORMAL.
(2) BLADERF_LPF_BYPASSED was leaving the LPF powered on. According to
the TX/RX LPF block diagram (Figure 3.5, in v1.1r4) in the LMS6002D
programming guide, this implies that the LPF was enabled while its
input was shorted to its output.
This was limited due to 3.72GHz being the maximum value show in the
LMS6002D programming guide's FREQSEL table. According to a response
on the limemicro-opensource Google group, we should be able to use
the same FREQSEL value from 3.72GHz - 3.8GHz.
As noted in commit 67938789f9, the calibration tables were intended to
have a .tbl extension. However, the calibration table functionality in
the previous commits were incorrectly using a .bin extension.
On Linux and OSX, the following directories will be searched,
in the order listed:
~/.config/Nuand/bladeRF
~/.Nuand/bladeRF
/etc/Nuand/bladeRF
In Windows, %appdata%/Nuand/bladeRF will searched.
The following files will be loaded, if found in these search paths:
FPGA image: hostedx40.rbf or hostedx115.rbf, depending on the
size of the FPGA reported by the device.
DC Calibration tables: <serial>_dc_<rx|tx>.tbl
libbladeRF: Added Windows support to file_find
The DC calibration table entries' offset values are int16_t, not
uint8_t. Although the actual register values are uint8_t, the libbladeRF
interface has normalized them.
We might want to bypass this normalization to reduce the size of this
calibration table, especially if we want to fit it in flash.
In order for the DC cal tables to work, the LMS calibration values will
need to be the same as when the table was generated. Therefore, we
cannot perform these cal routines during device init.
It was seen that the VCM will sometimes come back in a bad state.
This register has a very well known value that it should be. Setting
it to be these explicit values seems to help alleviate putting the
LMS is a bad state.
Investigation is required to figure out why the VCM is coming back
scrogged.
The following changes have been added to lms_dc_cal_loop() and
lms_calibrate_dc(), based upon recommendations from the LMS 6002D FAQ
(version 1.0r10).
- Use the DC_REGVAL to determine success or failure, as DC_LOCK
is reported (in the FAQ) to be unreliable. Retry if the result is
31, setting the count to DC_CNTVAL to 0.
- Enable DC comparators during DC calibration (default), and
disable them upon completion to address linearity issues.
- Disable DACs while performing TXLPF DC calibration
- Our surrogate inttypes.h is only needed for Visual Studio 2010 and
earlier, due to the lack of C99 support.
- Move all the inttypes.h includes into host_config.h, where we can
do the ugly in a centralized location
- MinGW on Linux is case-sensitive -- reflect that when including
windows.h.
This function was causing intermittent failures because it would
return an error if it detected that that FPGA was not yet loaded,
which is a likely possibility.
Since this function no longer issues a vendor request to device to
perform a post FPGA load operation, it serves no purpose and has been
removed.
tests/test_sync/src/test.c:
Changed sample buffer type to int16_t. These alleivates noise from static
analysis tools regarding a type mismatch with sizeof(), and better
exemplifies the buffers that should be used in conjunction with the SC16 Q11
format.
tests/test_repeater/src/repeater.c:
Fixed unchecked pthread_cond_wait result.
tests/test_async/main.c:
Fixed unchecked return values, minor cleanup.
src/lms.c:
Removed dead assignment.
src/backend/usb/usb.c:
Corrected unchecked return value.
src/backuend/usb/libusb.c:
Fixed uninitialized variable in error path.
Operations that open files (e.g., firmware flash, FPGA load) now
return BLADERF_ERR_NO_FILE instead of BLADERF_ERR_IO when a file not
found. This is intended to help differentiate between user-error in the
aforementioned operations and a device-failure.
Changes since v0.14.0 tag include:
- Overhauled backend interface to decouple device logic from libusb
code. Moved code to a generic USB interface and libusb code under
that interface. This should allow host-specific drivers to be more
easily integrated.
- Addressed race conditions in the async RX/TX interface. pthreads is
now a required dependency of libbladeRF.
- Bug fixes for the sync RX/TX interface
- Windows build and compatibility fixes
- API changes:
+ Added functions:
- FPGA timestamp access (requires FPGA v0.0.4+)
- Expansion board GPIO and SPI accessors (requires FPGA v0.0.4+)
- Firmware loopback (requires FX3 FW v1.7.0+)
+ Changed SPI flash access functions
- Functions operate in units of erase blocks and pages
- Removed un-aligned accesses