Bailing out immediately upon failing to open or claim a device prevents
us from being able to open any available device if one or more is
already in use.
FPGA build artifacts are now copied to a <rev>x<size>-<timestamp>
directory. The .rbf, SHA256 & MD5 checksums, and reports/summaries are
copied into this directory.
This is intended to help keep files with their associated FPGA images, as
items in work/ are clobbered with each invocation of build_bladerf.sh.
Changing the LMS SPI component to have a clock phase/polarity of
[0,0] instead of [1,1], modifying the SDC to constrain the interface
which was done by mistake and caused timing errors and missed bits.
Also increasing the SCLK frequency to 40MHz.
FindLibUSB.cmake presents issues with its try_compile() invocation
when using some dated CMake versions, such as 2.8.7 and 2.8.11, while
operating fine with more recent versions (e.g., 2.8.12.2, 3.0.0).
Using try_run() is a cleaner solution than a combination of try_compile() and
execute_process(). However, in Windows we need to stage libusb-1.0.dll in the
directory containing the resulting libusb_version.exe. As try_run() creates a
a temporary build directory and deletes it when done, this originally
posed a challenge to copying libusb-1.0.dll to the correct directory.
To address both of these challenges, the Windows version of this program now
explicitly links libusb at runtime, provided the path to the libusb DLL.
OSX and Linux variants assume libusb is in the library path, and link against
the library at compile-time.
Instructing the users to notify developers isn't helpful if the user is
simply on an older libbladeRF version. These messages have been changed
to just describe the situation.
These are now also INFO rather than WARNING to be less obnoxious in
cases where users are already aware of the situation and know that
their FPGA/Firmware is compatible, but cannot update libbladeRF.
(For example, they're running a live image and want some FPGA fixes.)
ENABLE_LIBBLADERF_SYNC is no longer used, as this interface is now
always present. Since this CMake variable is no longer set, this was
preventing ENABLE_LIBBLADERF_SYNC_LOG_VERBOSE from taking effect.
The existing bladerf_sync_rx() snippet in the libbladeRF API docs has
been replaced by a more complete snippet in libbladeRF/doc/examples.
From now on, major snippets and examples to be included in
Doxygen-generated documentation shall now be placed in the
libbladeRF/doc/examples directory, and must be buildable and testable.
The Doxygen "snippet" command to shall be used to include the relevant
code from the example program.
libbladeRF: [WIP] Use a simple delay to wait for TX samples in example
API support for timestamp metadata has been introduced. This is made
available when using the newly introduced BLADERF_FORMAT_SC16_Q11_META
format value.
When using the synchronous interface, metadata is exchanged between the
caller and the API via the updated bladerf_metadata structure. Users of
the asynchronous interface must currently manually manage the metadata
headers as desired, as documented in libbladeRF.h.
When using the BLADERF_FORMAT_SC16_Q11_META format in conjunction with
the synchronous interface, it is possible to retrieve the timestamp for
received samples and an indication of overrun. An RX operation may also
be scheduled for at a specific timestamp value the future. Similarly,
bursts of samples can be scheduled to be transmitted at a specific
timestamp value, or at the first available timestamp ("now").
Adding a zero sample to the beginning of the burst tests so initial
power out from the LMS is minimized.
I tried adding a single sample to the DAC output but it didn't seem
to want to work appropriately, so there is around 700us worth of output
power after an initial boot of the board and loading of the FPGA.
This revision introduces an FPGA-based ATSC transmitter to offload the
pilot insertion, filtering, and shift to baseband.
This design expects that 4-bit ATSC symbols are written to the device in
little-endian 32-bit words, as shown below.
|<------- 32 Bit Word ------->|
Bit |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
Symbol [ X| 7 ][X| 6 ][X| 5 ][X| 4 ][X| 3 ][X| 2 ][X| 1 ][X| 0 ]
The FPGA transmits Symbol 0 first, and Symbol 7 last. The three
least-significant bits in each symbol's nibble contain values 0 to 7,
mapping to values of -7 to 7, with the most-significant bit left unused.
This FPGA image may be built by specifying the "atsc_tx" image to the
build_bladerf.sh script. The resulting output files will be
atsc_txx40.rbf and atsc_txx115.rbf for the x40 and the x115,
respectively.
Transmitting a pre-made stream on channel 14-1 can be achieved with the
following commands in the bladeRF-cli:
set frequency 473000000
set samplerate 32286713 2867 10000
set txvga1 -4
set txvga2 20
tx config file=<path to file> repeat=0 delay=0
tx start
When debugging the FX3, NIOS, or FPGA, it's helpful if the host
side isn't constantly timing out. These can be disabled by defining:
LIBBLADERF_DISABLE_USB_TIMEOUTS=Yes
FindLibUSB.cmake now fetches the libusb version via libusb_get_version()
so that we can warn (or error out) about the system containing an
outdated libusb version.
The following policies have been based upon support experiences and the
libusb changelog:
Windows: Error out for libusb < 1.0.19
v1.0.19 provides Windows 8 SuperSpeed detection support,
and appears to address a number of issues bladeRF users
have reported with v1.0.18 and earlier.
We force users to update here, given that some of the failures
on earlier versions were yielding corrupted samples.
OSX: Warn for libusb < 1.0.18:
v1.0.16 - v1.0.18 introduced SuperSpeed and 64-bit support,
as well as fixes for compile-time and run-time issues.
Linux: Warn for libusb < 1.0.16:
This is largely based upon feedback from bladeRF users. While
older versions may work, a number of users reported that issues
appeared to be resolved after updating libusb to >= 1.0.16.
(It isn't always clear if the reported update included Linux
distro upgrades that included kernel updates.)
The version check may be skipped via LIBUSB_SKIP_VERSION_CHECK=Yes.
This is intentionally not noted in the warnings/errors, as it's
preferred that users update libusb rather than just skip the check.
There's no point in starting these threads up if we're performing
operations from command line flags that will cause the program to
exit, rather than enter the main input loop, which may execute
the rx or tx commands.
This is a workaround for issue (#324).
We appear to have a lock ordering issue with our stream->lock and the underlying
libusb event lock. When a libusb event occurs, it acquires its event lock and
then our callback acquires a stream lock. When we asynchronously submit a
transfer, we acquire the stream lock and then libusb acquires its event lock
under the hood. If a callback occurs while we're submitting a transfer on the
same stream, deadlock ensues, due to the above asymmetry in lock acquisition.
Ultimately, we'll need to review our locking scheme and libusb event handle to
address underlying design issues here, and potentially trim some fat.
For now, the lock is just dropped after all metadata has already been updated,
and reacquired after submission.
The help text reports the usage of the mimo command to be:
mimo [master | slave]
Since there was no alternative to argv[1] being anything other than "clk"
this was dropped so the invocation matches the help text.
If an error occurred, this command was returning a libbladeRF status
code directly, instead of returning a CLI_RET code. This has been fixed.
The preferred output format for commands is a leading newline, content
indented two spaces, and a trailing newline. Sub-levels should be
indented an additional two spaces.
Example:
bladeRF> my_cmd arg1 arg2
Info1: Something about arg1
Info2: Something about arg2
Subinfo 1: abc
Subinfo 2: xyz
bladeRF> my_cmd badarg arg2
Error: Message about badarg
bladeRF>
Setting this environment variable forces libbladeRF to always report
that no FPGA is loaded, rather than query the device.
This is intended for debugging and to provide a workaround for
issue #327, where users with a pre-v0.0.1 FPGA being autoloaded from SPI
flash are unable to open a device handle because the FPGA does not
supply a version number (which is now required by libbladeRF).
This addresses an error where 'make uninstall' would fail with:
CMake Error at cmake_uninstall.cmake:4 (message):
Cannot find install manifest:
"<path>/build/host/install_manifest.txt".
The problem was that using CMAKE_CURRENT_BINARY_DIR in
cmake_uninstall.cmake wasn't really appropriate in our particular case,
as the "current" directory would be host/ once CMake dove into that
subdirectory. This has been changed to CMAKE_BINARY_DIR to ensure
we're reference the top-level of the build.
Removed switch() on sample format and replaced it with a call to the
new async_stream_buf_bytes(). This will become more relevant in upcoming
changesets when new formats are added.
Other changes are just aesthetic house-cleaning items. Shortening some
lines and long variable names.
The libusb and Cypress backends are now defaulted to ON if they are
detected on the system, and OFF otherwise.
The deprecated Linux kernel driver option has been removed. It will
be re-added if and when this code is updated/rewritten.
The "detach kernel module" libusb option has been removed, as it was
unused anyway.
libusb appears to return a "not supported" error if a device is currently
associated with a different driver, such as CyUSB3.
We'll want to continue looking for libusb devices rather than bail out
if we encounter this error, as we may have hit a device belonging to
our CyUSB backend
A USB backend based atop of the Cypress CyAPI (which is based atop the
Cypress CyUSB3 driver) has been introduced. This is intended to provide
Windows users with an additional driver to use if they encounter issues
with their USB host controller and libusb.
To build and use this backend, the Cypress FX3 SDK must be installed and
the following CMake flags should be provided:
-DENABLE_BACKEND_CYAPI=Yes -DFX3_SDK_PATH=<path to SDK>
A modified cyusb3.inf is provided in host/drivers/windows/cyusb3. Upon
performing a build this inf file and the associated driver files from
the FX3 SDK will be copied into the "output" directory along with the
bladeRF.dll and bladeRF-cli.exe. To install the driver, point the
Windows driver update to this location and accept the warning about the
driver being unsigned; this occurs because the Cypress driver wasn't
signed with bladeRF VID/PID values.
The libbladeRF device string for this backend is: "cypress"
Many thanks go out to LazyDodo for all his efforts in spearheading the
development of this backend -- much of this code is either his doing or
is directly based upon his efforts.