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.
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.
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.
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.
Addresses CID: 113696 - 1133700, which consist of potential NULL pointer
dereferences, dead code, and invalid memory access (clobbered a NUL
terminator).
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.
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.
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.
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
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
```
- 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
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.
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.
"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.
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.