Commit graph

712 commits

Author SHA1 Message Date
Jon Szymaniak
32fa7441f2 Update CMakeLists.txt 2013-12-10 00:06:44 -05:00
Jon Szymaniak
95a6c1d0e0 cmake: Fixes and cleanup for libusb detection and version checks
The version checks are now enforced. (Fixes #130)

FindLibUsb now warns if the user is using < libusb-1.0.16, as this or
1.0.17 are *highly* recommended.

The redundant version check in Windows (ver.c) has been removed. Testing
with CMake 2.8.11.2 has shown check_library_exists() to be sufficient.
2013-12-09 23:53:38 -05:00
Jon Szymaniak
009d8181e0 libbladeRF: Fixed a bad ifdef
The libusb_get_version() call here is generally helpful to have
in here, as the libusb version is one of the first things to check
when someone reports USB issues.
2013-12-07 19:47:37 -05:00
Jon Szymaniak
fabc0e89ac libbladeRF: Specified calling convention for Windows and removed unneeded externs
Misc. reformatting and a few doxygen touchups also included.
2013-12-05 23:51:48 -05:00
Jon Szymaniak
25a7fe145f host/common: Fixed leak in error path
Addresses CID 1042550
2013-12-02 21:00:06 -05:00
Jon Szymaniak
49844d5cb8 Merge pull request #184 from rtucker/fix_lintian_errors_rev2
Fix two lintian errors
2013-12-01 10:53:04 -08:00
Ryan Tucker
587682cccc Fix two lintian errors
W: bladerf source: syntax-error-in-dep5-copyright line 95: Continuation line outside a paragraph.
W: bladerf source: ancient-standards-version 3.9.2 (current is 3.9.4)

My laptop (with saucy) is somewhat pickier than my old lucid desktop.
Surprise, surprise.
2013-12-01 13:40:10 -05:00
Jon Szymaniak
2ac53aec7c host: CID fixes for ezusb.c - Unchecked return values and user-provided values
Addressing items picked up by the Coverity scan:
    CID 1042551, 1042552, 1042546, 1042537

These items consisted of unchecked return values, and using some
length/size values provided in file headers directly.

Added return value checks and some quick sanity checks on length values.

Did some misc. cleanup on debug output.
2013-11-30 16:40:56 -05:00
Jon Szymaniak
695c7fc892 libbladeRF, bladeRF-cli: Fixed defects reported by Converity Scan
Addresses CID: 113696 - 1133700, which consist of potential NULL pointer
dereferences, dead code, and invalid memory access (clobbered a NUL
terminator).
2013-11-29 14:36:56 -05:00
Jon Szymaniak
55dc4b5389 libbladeRF: Decreased verbosity of library outputs
In the future, we'll need to standardize the situations in which we use
the log_* functions.  For the time being, it is preferred to err on the
side of less verbosity.

Here's a preliminary list of intended usages:

log_error():
    Unexpected and severe failures.

log_warning():
    Failures and situations that may yield unexpected behavior (e.g.,
    truncation)

log_info(), log_debug(), log_verbose():
    Information about what's going on under the hood. log_info() is the
    least verbose, log_verbose is the most.
2013-11-28 22:53:51 -05:00
Jon Szymaniak
348e208bad host: Version bumps for added flash backup, restore, and cal init bladeRF-cli_v0.9.0 libbladeRF_v0.10.0 v0.10.0 2013-11-28 16:12:42 -05:00
Jon Szymaniak
0ab08662c0 libbladeRF: Typo fix in API header 2013-11-28 15:40:49 -05:00
Jon Szymaniak
edce92671d bladeRF-cli: Renamed flash backup, restore & init_cal commands
Also included, some minor fixes.
2013-11-28 15:40:16 -05:00
Jon Szymaniak
3cb8c1f9dc bladeRF-cli: Address address and length to flash_image output 2013-11-28 14:15:53 -05:00
Jon Szymaniak
5bb9e5c6e3 bladeRF-cli: Removed debug output, handle invalid timestamp cleanly 2013-11-28 14:15:53 -05:00
Jon Szymaniak
30997a9f61 libbladeRF, bladeRF-cli: Reworked cal data generation and misc cleanup
The function to create cal data now is a wrapper around
bladerf_alloc_image() which initializes the returned image with
calibration data.

The associated CLI command now allows this to be either written to a
file or to the device directly.

API header cleanup: Pushed the lower level functions to to the end of
the header, so the functions people will use more frequently will be at
the top of the generated documentation.

Also added a missing API_EXPORT and made the Doxygen color scheme a little
more blue. (Tired of grayscale ;) )

Windows cleanup: Added get_timestamp() implementation, cleaned up
warnings, address some portability issues.
2013-11-28 14:14:38 -05:00
Jon Szymaniak
11c84b023d libbladeRF: Fixed length of FPGA region of flash in API header 2013-11-28 14:08:13 -05:00
Jon Szymaniak
5d8d23d8df bladeRF-cli: Split backup and restore commands, misc cleanup 2013-11-28 14:07:49 -05:00
Jon Szymaniak
a3a02d41a0 bladeRF-cli: flash_image timestamp shown in human-readable format 2013-11-28 14:07:49 -05:00
Jon Szymaniak
ad3faf9dd7 bladeRF-cli: Added flash_image command and alphabetized commands 2013-11-28 14:07:49 -05:00
Jon Szymaniak
fd7af2edc6 libbladeRF, bladeRF-cli: Simplified flash image format and handling
These changes simplify the image format a bit; the metadata fields are
flattened into the image to simplify both image creation and manually
viewing/extracting contents from images.

The checksum has been moved to directly after the file format's magic
value (i.e., signature), to make it a bit easier to just extract data
via dd. Similar to the approach used by mkimage for U-Boot headers,
the checksum calculation is performed over the entire image, with the
checksum field zeroed out.

Touched up CLI backup/restore commands and separated <address>
and <length> to separate args.
2013-11-28 14:05:54 -05:00
Jon Szymaniak
5dc11f196f bladeRF-cli: Help text and error message touch-ups 2013-11-28 13:58:29 -05:00
Daniel Gröber
6abbec9138 Add debian/copyright entries for new code 2013-11-28 13:58:09 -05:00
Daniel Gröber
a512c15297 bladeRF-cli: Add init_cal command
Initializes the calibration region in the flash

Usage:
```
bladeRF> help init_cal

Initializes the calibration region in the flash with new values
init_cal fpga_size vctcxo_trim

   <fpga_size>       Either 40 or 115 depending on the device model.
   <vctcxo_trim>     VCTCXO/DAC trim value (0x0-0xffff)
```

Conflicts:
	host/utilities/bladeRF-cli/src/cmd/cmd.c
2013-11-28 13:58:08 -05:00
Daniel Gröber
035eb81c83 bladeRF-cli: Add backup and restore commands
Usage:

```
bladeRF> help backup

backup <file> [address,len]

Backup a flash data to a file.
   `address'     defaults to the address of the calibration data.
   `len'         defaults the size of the calibration data  (256 bytes).

bladeRF> help restore

restore file [address,len]

Restore flash data from a file.

   <address>   defaults to the address of the factory calibration data or the
               address stored in the metadata section of the image if it exists

   <len>       defaults the size of the factory calibration data (256 bytes) or
               the length of the image given
```
2013-11-28 13:58:08 -05:00
Daniel Gröber
bb0128e15e libbladeRF: Supporting changes for backup/restore of flash
- Verify flash pages as they are written
- Add function for initializing the calibration region in flash
- Add functions to read/write flash images with sha256 and metadata
- Add support for unaligned read/program
2013-11-28 13:58:08 -05:00
Daniel Gröber
cae59d8900 common: Add sha256 code from FreeBSD 2013-11-28 13:58:08 -05:00
Daniel Gröber
0518009046 common: add BE32 <-> HOST endian conversion 2013-11-28 13:58:08 -05:00
Brian Padalino
9126eac65e Fixing time getting for OSX. 2013-11-24 18:12:59 -05:00
Brian Padalino
b1045f5d97 Adding time.h for timespec. 2013-11-24 17:51:45 -05:00
Jon Szymaniak
fc1f673a2a host: Updated README.md to include CMake TREAT_WARNINGS_AS_ERRORS option 2013-11-24 17:08:13 -05:00
Jon Szymaniak
1d3e2bd9a6 host: Added option to disable "warnings as errors" in builds
Developers should always build with -Werror or /WX. However, we've had a
few cases with different compiler versions throwing errors that devs
didn't see, breaking master for users. The intention of this change is
to give those users a quick workaround, rather than requiring them to
hack around the warning in the source.
2013-11-24 16:53:56 -05:00
Jon Szymaniak
a3b5e9e8af Merge branch 'dev-issue165-use-help2man-rev3' from https://github.com/rtucker/bladeRF 2013-11-24 16:23:17 -05:00
Jon Szymaniak
6cf5efbbc9 bladeRF-cli: Added a clock_gettime() implementation for OSX 2013-11-24 16:08:34 -05:00
Jon Szymaniak
5cdefd5c47 libbladeRF: Corrected documentation commands in README.md 2013-11-23 19:14:57 -05:00
Ryan Tucker
8957eda839 Use help2man to generate man pages (fixes #165)
A little more lightweight than the doxygen approach,
and keeps the documentation harmonized with --help.

h/t to A. Maitland Bottoms for pointing me to this.
2013-11-16 16:25:58 -05:00
Jon Szymaniak
4ca28fed8a bladeRF-cli: Additional help text cleanup 2013-11-12 23:00:29 -05:00
Jon Szymaniak
79fa480200 bladeRF-cli: Merged rtucker's 'fix_bladerf_cli_help_consistency' branch 2013-11-12 22:33:35 -05:00
Nuand
0120d5ba1e Initializing uninitialized variable. 2013-11-12 09:57:26 -05:00
Jon Szymaniak
470dbd7e48 bladeRF-cli: Wait for transition from INIT to IDLE in rxtx_startup()
This fixes issue #171, as we ensure we start up before attempting
to issue shutdown requests.
2013-11-12 00:09:57 -05:00
Jon Szymaniak
8f5a45a8ca bladeRF-cli: Version bump for script support and quoted params bladeRF-cli_v0.8.0 2013-11-11 22:31:47 -05:00
Jon Szymaniak
89fab7f58f bladeRF-cli: Added rx/tx "wait" command with optional timeout
"rx wait" and "tx wait" may be used in conjunction with scripts to wait
a specified amount of time before exiting, or to wait until the
configured number of samples are received/transmitted before exiting.
2013-11-11 22:14:54 -05:00
Jon Szymaniak
12a4313cc1 bladeRF-cli: Improved script support, quoted param support, misc. cleanup
Scripts can be invoked from within other scripts, using the "run"
command. An error is reported if a recursive loop is detected.

An "echo" command has been added for debug purposes.

Parameters may now be surrounded in double quotes to include spaces.

Removed extraneous error messages from main(); The preceding functions
print error messages if needed.

Removed error-out if no device is attached. This allows scripts to be
run if the device is not attached. Commands already verify that a device
is attached, if required.
2013-11-11 22:14:53 -05:00
Jon Szymaniak
dafcd5f55e libbladeRF: Removed prototype for removed function. 2013-11-08 19:56:09 -05:00
Jon Szymaniak
3752bddcec bladeRF-cli: Fixed incorrect write size (rx, binary SC16Q12) bladeRF-cli_v0.7.1 2013-11-08 00:54:55 -05:00
Ryan Tucker
2f3c866dce bladeRF-cli: Fix mixed-up between --version and --lib-version
--version was reporting the libbladeRF version, while
--lib-version was reporting the bladeRF-cli version.
2013-11-04 21:07:16 -05:00
Ryan Tucker
14517e4ecd Additional cleanup to interactive help 2013-11-04 19:17:19 -05:00
Ryan Tucker
e7307d9b78 Clean up the help output a small bit
Still kinda messy, but this may help with auto-generating
man pages and other documentation just a bit...
2013-11-03 21:29:49 -05:00
Brian Padalino
1d5aa6e2a4 Merge pull request #170 from cde-/master
on Mac OS X, make sure libbladeRF.0.dylib is prefixed with the full installation path
2013-11-03 10:19:54 -08:00
Christophe Devine
a0271ae5ec on Mac OS X, make sure libbladeRF.0.dylib is prefixed with the full installation path 2013-11-01 15:59:24 +01:00