Commit graph

1,025 commits

Author SHA1 Message Date
Jon Szymaniak
d53d9d1ae4 bladeRF-cli: Updated 'calibrate' help text and removed no-arg execution. 2014-06-30 00:04:37 -04:00
Jon Szymaniak
5edecd9234 bladeRF-cli: Fixed use of uninitialized variable in error path
There's no need to jump to the 'out' label if the 'rx_samples'
allocation fails; nothing else has been allocated or started yet.
2014-06-30 00:04:37 -04:00
Jon Szymaniak
a579d155ba bladeRF-cli: Addressed 'uninitialized variable' warning
Removed the n == 0 short circuit check in favor of initializing min_i
and min_q. This should keep compilers happy and be a bit more readable.
2014-06-30 00:04:37 -04:00
Jon Szymaniak
32ca018a33 bladeRF-cli: Removed unused function to alleviate build warning 2014-06-30 00:04:37 -04:00
Jon Szymaniak
aa572861d0 bladeRF-cli: Fixed 'cal dc_tx', broken in c0941d9 2014-06-30 00:04:37 -04:00
Jon Szymaniak
6a8a4cbe00 bladeRF-cli: Attempt to narrow RX DC auto cal value, removed dummy RX 2014-06-30 00:04:37 -04:00
Jon Szymaniak
e6f94263ca bladeRF-cli: cal dc_rx/tx no longer perform LMS calibration 2014-06-30 00:04:37 -04:00
Jon Szymaniak
29c5a6c65c libbladeRF: Perform LMS RX DC cal during device initialization 2014-06-30 00:04:37 -04:00
Jon Szymaniak
8c31580c9d libbladeRF: Disable LNA while performing LMS DC tuning 2014-06-30 00:04:36 -04:00
Jon Szymaniak
57c2d88b3e bladeRF-cli: Added RX DC cal option that skips LMS calibration 2014-06-30 00:04:36 -04:00
Jon Szymaniak
1f02665720 bladeRF-cli: Fixed uninitialized error value for TX DC cal 2014-06-30 00:04:36 -04:00
Brian Padalino
1f94d67ffe bladeRF-cli: Extend out DC, GAIN and PHASE max/min. 2014-06-30 00:04:36 -04:00
Brian Padalino
8b8f2dc101 libbladeRF: Be explicit with RXVGA2 cal.
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.
2014-06-30 00:04:36 -04:00
Jon Szymaniak
8c2041826d bladeRF-cli: Check for divide-by-zero in interpolation function 2014-06-30 00:04:36 -04:00
Jon Szymaniak
3ddf50a2d4 bladeRF-cli: Added TX DC cal operation. Further cleanup required. 2014-06-30 00:04:36 -04:00
Jon Szymaniak
f7981118b1 bladeRF-cli: Use fewer buffers for dc cal, start with cal at 0,0 2014-06-30 00:04:36 -04:00
Jon Szymaniak
44ec2ec627 bladeRF-cli: First cut at RX DC auto calibration
Includes a workaround for convergence issues - further investigation
required. General cleanup and documentation changes still required.
2014-06-30 00:04:36 -04:00
Jon Szymaniak
cfa916c942 libbladeRF: Added register settings from LMS FAQ to DC calibration fns
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
2014-06-30 00:04:36 -04:00
Jon Szymaniak
d4b79cddba libbladeRF: Moved LPF DC tuning value write into address loop
This is just for readability. There's no functional change, since
there's only 1 address to loop over anyway.
2014-06-30 00:04:36 -04:00
Brian Padalino
e03a1144b0 Calibration update. 2014-06-30 00:04:36 -04:00
Brian Padalino
f5fb4617ef Modify the RXVGA2 calibration routines to enable test mode signals 2014-06-30 00:04:36 -04:00
Jon Szymaniak
1bb3c857a3 bladeRF-cli: Fixed invalid memset length when zero-padding a buffer
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.
2014-06-28 15:20:08 -04:00
Jon Szymaniak
15340770ca Merge pull request #264 from rtucker/win-mingw-fixes-inttypes
Support Windows builds with MinGW
2014-06-21 14:13:52 -04:00
Ryan Tucker
c9f3945d18 update debian/copyright to match inttypes_msvc.h rename 2014-06-21 13:49:37 -04:00
Ryan Tucker
b24cf702b6 Support Windows builds with MinGW
- 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.
2014-06-21 13:41:44 -04:00
Jon Szymaniak
d685097fb9 Merge pull request #262 from argilo/master
Add note about pybombs interfering with nios2.
2014-06-21 13:38:42 -04:00
Jon Szymaniak
ee89b799b8 Merge pull request #263 from rtucker/win-mingw-fixes-bladerf-flash
bladeRF-flash: cast callback fn to proper type
2014-06-21 13:37:27 -04:00
Ryan Tucker
e8225ab23a bladeRF-flash: cast callback fn to proper type
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 *)'
2014-06-21 13:15:17 -04:00
Clayton Smith
09c72f912a Add note about pybombs interfering with nios2. 2014-06-21 12:51:45 -04:00
Jon Szymaniak
4455994904 libbladeRF: Minor API header touch-ups and Doxygen fixes 2014-06-20 00:13:33 -04:00
Jon Szymaniak
588c8602bd libbladeRF: Fixed Windows build issue (warning + /WX)
Removed narrowing assignment from double to unsigned int.
2014-06-19 00:14:16 -04:00
Jon Szymaniak
a9d2e4cd4e bladeRF-cli: Added "pretty print" of LMS reg readback to poke command 2014-06-19 00:05:24 -04:00
Jon Szymaniak
0ec9c9c41a libbladeRF: Removed incorrect usage of error_conv()
In this case, status is already a libbladeRF error value.

Fixes #257
2014-06-17 19:39:46 -04:00
Robert Ghilduta
4b16347c05 hdl: bump FPGA version to 0.0.5 fpga_v0.0.5 2014-06-17 09:49:12 -07:00
Robert Ghilduta
0228b730d4 hdl: fixup pin assignment for exp_spi_clock 2014-06-17 09:48:00 -07:00
Robert Ghilduta
164f1b7e8b hdl: swap XB SPI pins
To match the design of the XB-200 these pins will now be changed. This change is
backward compatible.
2014-06-17 09:48:00 -07:00
Robert Ghilduta
6f04429824 hdl: add XB-200 support
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.
2014-06-17 09:48:00 -07:00
Robert Ghilduta
e7b2fabaa2 bladeRF-cli: add initial support for XB-200 2014-06-17 09:47:59 -07:00
Robert Ghilduta
cb0af5a16c libbladeRF: add initial XB-200 transverter support 2014-06-17 09:47:59 -07:00
Jon Szymaniak
923e242484 libbladeRF: Removed end_fpga_programming() call from FPGA load
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.
2014-06-11 22:46:58 -04:00
Jon Szymaniak
28b8ca516c bladeRF-cli: For 'peek lms', show field info about LMS regs, where applicable
Many thanks to LazyDodo for providing the scraped register info from the
LMS data sheet.
2014-05-31 23:13:34 -04:00
Jon Szymaniak
04498cd4dd bladeRF-cli: Removed unimplemented commands, help text cleanup
Stubbed out print/set commands have been removed. Help text has been
updating and slightly re-arranged.
2014-05-31 14:15:45 -04:00
Jon Szymaniak
d6682e54c2 libbladeRF: Addressed items identified by Clang scan
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.
2014-05-28 21:33:33 -04:00
Jon Szymaniak
588650ecff bladeRF-cli: Cleaned up items reported by Clang static analysis
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.
2014-05-28 21:33:33 -04:00
Jon Szymaniak
c99a686adf bladeRF-cli: Differentiate between file "not found" and I/O errors 2014-05-28 21:33:32 -04:00
Jon Szymaniak
e0f6ee0eea bladeRF-cli: Added -e <command> support
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
2014-05-28 21:33:27 -04:00
Jon Szymaniak
782a45f3b7 bladeRF-cli: Changed CMD_RET_* -> CLI_RET_* and similar fn renaming
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().
2014-05-25 13:36:58 -04:00
Jon Szymaniak
67417e5fc5 bladeRF-cli: Renamed input interface functions
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.
2014-05-25 13:29:10 -04:00
Jon Szymaniak
ce1fcb9602 libbladeRF: Added "File not found" API return code
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.
2014-05-25 00:51:18 -04:00
Jon Szymaniak
425239863b libbladeRF: Fixed leak in FPGA flashing failure case (CID 1104234) 2014-05-23 13:44:52 -04:00