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
The memset used to zero the remainder of a buffer contained an incorrect
length calculation that could result in negative value, which is then
used as an unsigned value. This resulted in at attempt to zero of a very
large region of memory.
This calculation was failing to convert samples to int16_t's, and the
final length to zero (in int16_t's) to bytes.
Thank you to drmpeg and LazyDodo for their help on debugging and
resolving this issue.
- 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.
Fixes werrors:
/bladerf/bladeRF/host/utilities/bladeRF-flash/src/main.c:240:13:
error: passing argument 7 of 'libusb_hotplug_register_callback'
from incompatible pointer type [-Werror]
/usr/i686-w64-mingw32/include/libusb-1.0/libusb.h:1928:17:
note: expected 'libusb_hotplug_callback_fn' but argument is of type
'int (*)(struct libusb_context *, struct libusb_device *, enum libusb_hotplug_event, void *)'
This commit introduce XB-200 support in HDL. XB support introduces a new
direction configurable GPIO bank that is used to control peripherals on the XB
port. The xb_mode for the XB-200 board overrides exp_goio so it is used as
a chipselect pin for the ADF4351.
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.
tx.c - Removed dead assignment, fixed leak due to incorrect status check
main.c - Memory leaks in rc_config items
conversions.c - Removed dead assignment
script.c - fileno() doesn't fail when given valid FILE*. Removed false positive.
This option allows interactive mode commands to be executed from the
command line. Multiple -e <cmd> arguments may be provided; they will be
executed in the order they are specified.
Operations/command are performed in the following order:
- Command line options (e.g., FPGA load, firmware flash)
- Commands from '-e <cmd>' arguments
- Commands from script files
- Interactive mode commands
This is another non-functional, code cleanup (yak shaving) item.
The CMD_RET_* codes are now used throughout the CLI and not just in
commands. Therefore, they have been moved to common.h and renamed
appropriately. Similar changes have been made with functions like
cmd_strerror() -> cli_strerror().
Previously this was only for interactive mode support, and has since
grown to include scripting support. Following commits will include
support for commands specified via the command. As such, this renaming
is intended to clear up misnomers before further adding to any
confusion.
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.