Commit graph

135 commits

Author SHA1 Message Date
litghost
abe064cea8 Fixes for Windows build warnings on VS2012 2013-09-27 16:31:37 +00:00
Robert Ghilduta
4e3f01587b libbladeRF: copy lusb_flash_read() and lusb_flash_write() functions for legacy
This commit copies lusb_flash_read() and lusb_flash_write() from the before
57116c91, thus allowing devices running <= v1.3 to upgrade properly.
2013-09-27 00:31:26 -07:00
Brian Padalino
a36ed9a5f1 libbladeRF: More backward compatibility fixes. 2013-09-25 00:31:46 -04:00
Brian Padalino
26e8f3c0c0 libbladeRF: Moved where legacy warning is printed. 2013-09-25 00:31:45 -04:00
Brian Padalino
7ef33c6ba8 libbladeRF: Fixed vendor command to enable RF. 2013-09-25 00:31:45 -04:00
Brian Padalino
d05cc61574 libbladeRF: Support for legacy config interface.
Added checks for the legacy config interface being interface 0 instead
of interface 3 which changed in the v1.4 bump.
2013-09-25 00:31:45 -04:00
Robert Ghilduta
267cbeab99 libbladeRF: fixup libusb uninitialized errors 2013-09-23 00:35:57 -07:00
Keith Rothman
0f96ab0c6e [libbladeRF] Fixed double interface 1 set and fixed return code issues in lusb_load_fpga 2013-09-22 22:52:28 +00:00
Keith Rothman
1d481cefd3 [FX3/libbladeRF] Added explicit calibration cache 2013-09-22 08:07:08 +00:00
Keith Rothman
004ea967b5 [libbladeRF] Removed incorrect free 2013-09-22 08:07:08 +00:00
Keith Rothman
57116c919a [FX3/libbladeRF] Major refactoring of FX3 application
- Split RF, FPGA load, and firmware methods into seperate .c files
 - Split several vendor requests to eliminate magic glEp0Idx and to allow
   for better error handling
   - Updated libbladeRF to use new vendor requests and properly check return
     code.
 - Changed glSpiPageSize from global to #define
 - Move OTP handling into firmware.c
 - Version bump

Conflicts:

	fx3_firmware/bladeRF.c
2013-09-22 08:06:48 +00:00
Jon Szymaniak
cc1e290422 libbladeRF: Fixed # samples parameter on initial TX callbacks (libusb backend) 2013-09-21 14:21:02 -04:00
Keith Rothman
06c204ff13 Assorted fixes for problems found via USB30CV and USB20CV
- Move and use interface numbers
 - Renumber USB_IF_CONFIG from 0 to 3
 - Introduced 0 alt-interface as a NULL interface
 - Fixed FS descriptor length
 - Implemented GET_STATUS, SET_FEATURE, CLEAR_FEATURE w.r.t. halting bulk streams
 - Added include guards for firmware_common/bladeRF.h
 - Changed guard on suspend/resume requests to key on glUsbConfiguration instead
   of glUsbAltInterface.  This is because suspend/resume requests are on
   interfaces, not endpoints.
 - Addresses github tickets #97, #98, #99
2013-09-21 14:08:29 +00:00
Jon Szymaniak
7a5961688e libbladeRF: Fixed use of uninitialized data (libusb backend)
Fixed defect introduced in 9015bdbb5c, where a device handle's device identifier information was being populated from a (most likely) uninitialized bladerf_devinfo, rather than the one fully populated by a call to lusb_get_devinfo().
2013-09-19 11:11:41 -04:00
Jon Szymaniak
9015bdbb5c libbladeRF, bladeRF-flash: Added device identifier info matching to API routines
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.
2013-09-18 23:15:48 -04:00
Brian Padalino
372fd51586 libbladeRF: Host side fix for #107.
Setting the SPI flash interface is not required for reading.  Only for writing.  Turns out, if you try to set that interface twice then things do not go so well.

I am not 100% sure if this is just a host side fix for a firmware issue, but it alleviates the problem for now.

Also fixed some tabs that snuck in there.
2013-09-18 18:37:05 -04:00
Jon Szymaniak
a79bf948c4 libbladeRF: Workaround for libusb_set_interface_alt_setting() issue in Windows
This addresses Issue #101, in which prevents FW 1.0 users from upgrading.
2013-09-16 23:03:41 -04:00
Jon Szymaniak
a5f68dfeb8 host: All build output is placed in a single directory
All executables and libraries are now placed in a single "output" directory.
For Windows builds, third-party DLLs are copied into this directory.

This commit also moves some CFLAGS changes in the top-level CMakeLists.txt
down to where some other compiler flags are set up. (Non-functional change)
2013-09-16 01:23:04 -04:00
Robert Ghilduta
512b542ac3 libbladeRF: call flash_firmware() with the correct buffer size
The buffer size is aligned to flash sector boundaries, this new size needs
to be propagated to flash_firmware().
2013-09-15 00:45:18 -04:00
litghost
c5c3cb11a2 [test_repeater] Fixed windows build 2013-09-14 23:22:11 -07:00
Robert Ghilduta
aa9c2f5777 libbladeRF: fix uninitialized warning that is now treated as an error 2013-09-14 23:00:54 -07:00
Keith Rothman
d4fda17d67 [libbladeRF] Added some missing error checking in Si5338 2013-09-15 05:51:15 +00:00
litghost
d704a99cea Assorted fixes for bugs when testing on Windows 2013-09-15 05:32:04 +00:00
Keith Rothman
75f4c18771 Handful of stragler log fixes 2013-09-15 05:32:04 +00:00
Keith Rothman
db5f990e32 Fixes found during testing of bladeRF-flash
- Looks like trying to transfer data just before a RESET doesn't complete
   Changed RESET vender request to data-less
 - Fixed some missing new line chars
2013-09-15 05:32:04 +00:00
Keith Rothman
b530c7266d Initial version of bladeRF-flash tool 2013-09-15 05:32:04 +00:00
Keith Rothman
d36f91cb7d Initial JUMP_TO_BOOTLOADER support
- 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
2013-09-15 05:32:04 +00:00
Keith Rothman
1c4fa232eb [libbladeRF/bladeRF-cli] Added support booting directly from the FX3 bootloader 2013-09-15 05:31:57 +00:00
Keith Rothman
ee37214898 [libbladeRF] Exposed erase/read/write functions 2013-09-15 04:59:03 +00:00
Jon Szymaniak
354625e809 libbladeRF: Clarified a few items in the header documentation. 2013-09-14 18:02:27 -04:00
Jon Szymaniak
ce2367c562 libbladeRF: Cleaned up a few minor Doxygen warnings 2013-09-14 17:39:43 -04:00
Jon Szymaniak
6819369b61 libbladeRF: bladerf_load_fpga no longer checks current FPGA status
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).
2013-09-14 17:14:47 -04:00
Brian Padalino
46eacaa462 libbladeRF: si5338 refactored to support fractional sample rates. 2013-09-14 16:52:59 -04:00
Jon Szymaniak
3f31d7dac2 libbladeRF: Added simple full-duplex repeater test
This test program re-transmits received data in real time (optionally on
a different frequency.)
2013-09-14 15:11:08 -04:00
Brian Padalino
3d91831170 libbladeRF: Initialize the VCTCXO trim value. 2013-09-11 18:30:00 -04:00
Brian Padalino
4cb8212f8c libbladeRF: Return invalid parameter for bad enum. 2013-09-11 18:21:08 -04:00
Brian Padalino
262d4cd39c Fix typo. 2013-09-11 08:44:10 -04:00
Jon Szymaniak
2dcae9eeb2 libbladeRF & common: Renamed logging routines to address conflicts
The common logging functions have been renamed in order to not
conflict with the library's bladerf_log_set_verbosity().
2013-09-11 00:29:14 -04:00
Jon Szymaniak
7d5129e581 Merge pull request #86 from gpaliot/fix-cmake-c-flags
Quoted CMAKE_C_FLAGS to fix build issue
2013-09-10 16:11:21 -07:00
Brian Padalino
b0366761d3 libbladeRF: Fixed return codes and checking.
Erroneously reporting bad reading information when in fact it was correct.  Fixes issue #94.
2013-09-09 18:31:21 -04:00
Adam Greig
38273dcd8a libbladeRF: Add bladerf_set/get_lpf_mode
Add functions to bypass and disable the LPF and check whether it is currently
bypassed or disabled.
2013-09-09 03:55:03 +01:00
Brian Padalino
ead582406e libbladeRF: Trim DAC writing was broken. Fixed. 2013-09-08 16:37:18 -04:00
Brian Padalino
a8b38e5cef libbladeRF: Add reporting of libusb version. 2013-09-07 13:58:11 -04:00
Brian Padalino
2928b2dad4 cli: Only disable TX and RX if the FPGA is configured.
libbladeRF: Remove the -b instruction for upgrading from legacy firmware.
2013-09-07 13:15:55 -04:00
Guido Paliot
1eab84df56 Added quotes around the C flags to avoid a linebreak in the variable 2013-09-07 09:06:56 +02:00
Brian Padalino
268a3f5392 libbladeRF: Disable RF front end modules.
Instead of toggling all of power for all the RF modules when we
disable, just turn off the RF front end circuitry.  This alleviates
issue #82 since the PLL is powered separately from the RF front end.

Tested and verified that while TX was disabled, setting a new
frequency does have the spectrum show up at the appropriate place.
2013-09-05 20:16:22 -04:00
Jon Szymaniak
c4edf608a0 libbladeRF: Unblock stream deinit polling loop for "done" OR "idle" 2013-09-05 00:49:46 -04:00
Jon Szymaniak
56693c0675 libbladeRF: Changed bladerf_stream parameters, refactored stream init
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.
2013-09-05 00:06:14 -04:00
Jon Szymaniak
77b71a2f1a libbladeRF: Added 200 ms delay in FPGA poll loop, yielding a 2s timeout 2013-09-04 15:42:16 -04:00
Jon Szymaniak
c59ba0080c libbladeRF & bladeRF-cli: Fixed potentially uninitialized variables
If a flash calibration or OTP section are either corrupted or not set
the serial, trim, and FPGA size will not be read back. Under these
conditions, some "dummy" values are populated in the device structure,
to avoid uninitialized variables being thrown around.
2013-09-04 13:55:29 -04:00