Commit graph

63 commits

Author SHA1 Message Date
litghost
abe064cea8 Fixes for Windows build warnings on VS2012 2013-09-27 16:31:37 +00:00
litghost
46e261796d Add variable expansion support to recover function 2013-09-24 21:10:38 -07: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
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
07dbf5e622 [bladeRF-cli] Added erase option to cli 2013-09-15 04:59:03 +00:00
Brian Padalino
46eacaa462 libbladeRF: si5338 refactored to support fractional sample rates. 2013-09-14 16:52:59 -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
Frank Jenner
2761491a58 Added support for suffixes on numeric values
Added a new conversion function that accepts a list of suffix to
multiplier mappings, and applies the appropriate multiplier to the input
value. Utilized this new conversion function in the CLI for set
bandwidth, set samplerate, and set frequency.
2013-09-04 20:37:15 -04:00
Jon Szymaniak
fe5654b9f6 bladeRF-cli: Return immediately when no args are provided. 2013-09-04 19:17:37 -04:00
Jon Szymaniak
57b61e6609 bladeRF-cli: Show usage text and exit if no arguments are provided. 2013-09-04 19:03:37 -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
Jon Szymaniak
83ec2c4cd0 bladeRF-cli: Added simple non-tecla based interactive mode support
This will allow folks without libtecla installed to use a simple (albeit
less feature-rich) interactive mode and script support. Interactive mode
is now always compiled in, and the build option, ENABLE_INTERACTIVE_TECLA
has been replaced by ENABLE_LIBTECLA.

The simple fgets-based implementation currently does not support path expansion.
2013-09-04 01:08:20 -04:00
Robert Ghilduta
03ef44b21e copy Windows DLLs into the bladeRF-cli.exe build directory 2013-09-02 12:14:03 -07:00
Jon Szymaniak
f3da3dc540 bladeRF-cli: Fixed pthreads-win32 linking issue 2013-09-03 00:19:51 -04:00
Jon Szymaniak
9252dea908 bladeRF-cli: Fixed struct field initializers and removed use of unistd.h 2013-09-03 00:19:46 -04:00
Jon Szymaniak
b30446293e Added pthreads-win32, and getopt/getopt_long to Windows build. 2013-09-03 00:19:39 -04:00
Jon Szymaniak
d04ea3967e bladeRF-cli: Bumping CLI minor rev 2013-09-02 16:40:25 -04:00
Jon Szymaniak
84873ed6e4 bladeRF-cli: Added log level verbosity as a cmd line switch
The -v or --verbosity flag can be used to set the libbladeRF verbosity.
In the future, we should also start using this to potentially supress
CLI output.

Also fixed in this commit:
    - bladerf_open() typo in help text
    - Removed "b" option from OPTSTR, as this is no longer supported
2013-09-02 16:35:19 -04:00
Frank Jenner
3655b3d516 Added variable-level logging mechanism
Added a mechanism to log messages with different priority levels, and to
filter which messages are output by setting a threshold level. The
function to set the current log level/verbosity is exposed through
libbladeRF.h, while the logging function/macros themselves are private
to this project, and are present in log.c/log.h. Callers should use the
convenience macros bladerf_log_[level]() to issue their log messages.
These macros piece together a format string that contains the message
priority and, for warning and higher priorities, the function and line
number on which the message was logged. Also, warning level and higher
level messages are output to stderr, rather than stdout.
2013-09-02 15:39:41 -04:00
Jon Szymaniak
34bce9b877 bladeRF-cli: Removed batch mode (-b) in favor of interactive mode (-i).
This breaks backwards compatibility, but we're still in an "unstable"
mode at this point. Please update scripts and documentation accordingly.
2013-09-02 14:44:45 -04:00
Jon
9d6db26512 Merge pull request #71 from gpaliot/issue-45
Made batch mode default, added switch for interactive, Issue #45
2013-09-02 11:19:24 -07:00
Brian Padalino
62956eb580 libbladeRF: Updated calibration routine.
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.
2013-09-02 13:54:53 -04:00
Jon Szymaniak
2687451859 bladeRF-cli: Differentiate between a failed probe and no devices found. 2013-09-01 17:07:20 -04:00
Brian Padalino
826b5888fe libbladeRF: First stab at DC offset calibration.
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.
2013-09-01 15:57:15 -04:00
Guido Paliot
f4d503a136 Made batch mode default, added switch for interactive, Issue #45 2013-09-01 19:21:01 +02:00
Brian Padalino
018430d3ea cli: Removed errant } causing linker issues. 2013-09-01 12:11:49 -04:00
Jon Szymaniak
7831c03a52 bladeRF-cli: Attempt to resolve uneccessary library dependency (Issue #69) 2013-08-31 22:16:49 -04:00
Jon Szymaniak
e1f4dcd3de bladeRF-cli: ENABLE_INTERACTIVE_TECLA set to OFF if libtecla is not found 2013-08-31 21:14:06 -04:00
Jon Szymaniak
9455581d17 bladeRF-cli: Removed binle/binbe options. Binary data is host endianness
These changes are based upon those provided by engidea for Issue #64,
with some additional little naming changes.

To avoid having to deal with compiler-specific endianness macros,
the fixup routines contain the converion macros even for the
little-endian host case, assuming these will be optimized out, given
that they are generally empty macros.
2013-08-30 01:36:03 -04:00
Jon Szymaniak
9f90fc8df1 bladeRF-cli: Made csv->binary conversion more portable.
The use of mkstemp and the /tmp/ path would pose problems on the
windows side of things -- removed this.
2013-08-30 00:33:29 -04:00
Jon Szymaniak
444dd6525c bladeRF-cli: Fixed dangling FILE*
The following scenario was resulting in the assertion at line 235.
tx_csv_to_c16's interface specifies that it modiefies the file
descriptor -- in the failure case this means that it should close it
down.

```
bladeRF> tx config file=/dev/urandom format=csv

tx: Invalid I value encountered in CSV file

bladeRF> tx config format=bin
bladeRF> tx start
```
2013-08-29 23:46:39 -04:00
Jon Szymaniak
f00b05bb09 bladeRF-cli: Reverted ee364bba3e and fixed return value issue(s)
The underlying problem for Issue #43 was a return of -1 for any
failures, rather than an apppropriate CMD_RET_* code. Since -1 ==
CMD_RET_QUIT, this error would cause the application to quit (hence the
issue being labeled a "crash")

The reworked parsing has been rolled back since the parsing was not the
source of the issue. Changes from ee364bba3e will be cherry-picked
back in as needed.
2013-08-29 23:28:12 -04:00
Brian Padalino
4d8312b59b libbladeRF: Add API to change the ADC sampling location.
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.
2013-08-28 23:48:53 -04:00
Jon Szymaniak
40aa3e6754 bladeRF-cli: Bumped patch version for path expansion fix. 2013-08-28 01:46:04 -04:00
Jon Szymaniak
25127ed782 bladeRF-CLI: Perform file expansion when in interactive mode.
This commit addresses issue #44, and is a manual merge of dragorn's pull
request.
2013-08-28 00:20:20 -04:00
Brian Padalino
e4b167adef cli: Must link against ncurses (for OSX at least). 2013-08-27 21:05:29 -04:00
Brian Padalino
e0b91de2f2 Some minor printing fixups. 2013-08-27 20:23:12 -04:00
Brian Padalino
f96bef205b Don't freak out if the calibration information is not there. 2013-08-27 20:05:57 -04:00
Damiano @ Engidea
ee364bba3e fixed parsing issues on csv data 2013-08-27 13:06:24 +02:00
Jon Szymaniak
b82952687e libbladeRF: Cleaned up a few items and issues in OTP/cal readback.
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.
2013-08-27 00:07:13 -04:00
Jon Szymaniak
06192d20e6 bladeRF-cli: Fixed bus/addr swap in probe command output 2013-08-26 20:25:24 -04:00
Brian Padalino
4d28ebd2e7 libbladeRF: __LITTLE_ENDIAN__ or __LITTLE_ENDIAN 2013-08-26 08:19:34 -04:00
Brian Padalino
e9daf09094 Revert "libbladeRF: __LITTLE_ENDIAN or __LITTLE_ENDIAN__"
This reverts commit c063473b57.
2013-08-26 08:18:39 -04:00
Brian Padalino
c063473b57 libbladeRF: __LITTLE_ENDIAN or __LITTLE_ENDIAN__ 2013-08-26 00:33:11 -04:00
Brian Padalino
b2c3d06f62 libbladeRF: Updates to work with OSX. 2013-08-26 00:14:44 -04:00
Robert Ghilduta
10ffba1b39 Add device reset functionality
This commit adds the much needed device reset functionality that allows the
device to reset after an upgrade and start running the new firmware.
2013-08-25 18:21:07 -07:00
Robert Ghilduta
33957f17c1 libbladeRF: cache calibration and OTP data reads
This commit caches the caclibration and OTP data reads, and performs them when
the USB device is "open()"ed.
2013-08-25 18:21:01 -07:00
Robert Ghilduta
ffcfc6d2ff bladeRF-cli: add a few more error messages 2013-08-25 15:16:26 -07:00
Jon Szymaniak
439e099b01 libbladeRF: Renamed configuration GPIO read/write functions
Renamed to avoid confusion with expansion board GPIO routines that
will be added in the future.
2013-08-25 12:27:25 -04:00