Note: an erroneous python_v1.0.2 tag was created, which is basically
identical to this, but had the wrong version number. I apologize for any
confusion this may cause.
* host: common: include pthread.h in nanosleep.h (#669)
default header sort on nanosleep.c puts nanosleep.h above
pthread.h, which creates an implicit definition of struct
timespec.
Fixes#669
* host: common/nanosleep: cleanup includes
fixes:
- Script will now look in the same dir as the input file
(e.g. ../../../libbladeRF/include/) for other headers. This
is specifically to let it find bladeRF1.h and bladeRF2.h
more expeditiously.
- Create a stoplist of lines to not include in the output.
This largely consists of typedefs from pycparser's fake
system header files.
In a case where we have a long stream timeout, e.g. when using
triggered receive, the long stream timeout is being rendered
ineffective by the per-transfer timeout, which defaults to
1000 ms.
This adds two functions to async, for setting and getting the
transfer timeout:
int async_set_transfer_timeout(struct bladerf_stream *stream,
unsigned int transfer_timeout_ms);
int async_get_transfer_timeout(struct bladerf_stream *stream,
unsigned int *transfer_timeout_ms);
This also calls async_set_transfer_timeout in sync_worker_init,
setting it to either the BULK_TIMEOUT_MS from usb.h (1000 ms)
or the timeout_ms for the stream (user-specified), whichever is
longer.
Calls bladerf_get_fpga_source, and if it's a valid answer, appends
a description of the source to the printed FPGA version string.
Example output:
bladeRF-cli version: 1.6.1-git-9b6f3140-dirty
libbladeRF version: 2.0.2-git-9b6f3140-dirty
Firmware version: 2.3.1-git-9b6f3140-dirty
FPGA version: 0.8.0 (configured from SPI flash)
Also refactor version.c for cleaner flow.
Adds a new API call, bladerf_get_fpga_source(), which queries
the firmware for the source of the most recent FPGA programming.
This requires firmware v2.3.1 or later. Using an older firmware
will result in BLADERF_ERR_UNSUPPORTED.
This adds two new values for the bladerf_trigger_signal enum,
BLADERF_TRIGGER_J51_1 and BLADERF_TRIGGER_MINI_EXP_1, as well
as the necessary backend processing to make them work.
It turns out that it doesn't actually matter which one is chosen;
they all behave identically and interchangeably once they're passed
to the Nios interface functions.
The reason for this change is to reduce confusion, as the bladeRF
x40/x115 use J71-4 for mini_exp[1] and the bladeRF xA4/xA9 use
J51-1.
On the bladerf2, we have a comparatively long initialization process,
and thus we skip the init if we're "just" loading an FPGA, e.g. with
the -l option to bladeRF-cli.
This adds the same bypass to bladerf1.
In the event a device is already open (e.g. the user started
bladeRF-cli -i, then did "probe"), distinguish this in the list
of returned devices.
If the device couldn't be opened because of an access denial,
also distinguish this and omit the missing information.
In the event libusb_open fails with a LIBUSB_ERROR_ACCESS, pass
back the info we do have instead of simply ignoring the device.
This will be indicated by the serial number being, literally,
"ANY".
There are a few functions which are used very often, resulting in
a lot of unnecessary bloat on the verbose logging.
Unless ENABLE_LIBBLADERF_NIOS_ACCESS_LOG_VERBOSE is defined, the
following functions will no longer print verbose logging output:
nios_si5338_read
nios_si5338_write
nios_lms6_read
nios_lms6_write
nios_ad9361_spi_read
nios_ad9361_spi_write
nios_adi_axi_read
nios_adi_axi_write
nios_rffe_control_read
nios_rffe_control_write
parse.c is releasing memory for strings, after it assigns the memory location to a struct. This results in the memory potentially being overwritten by subsequent allocations before it's referenced.
Fixes#643
MSVC is a stickler about how structs are populated, and
so we need to put something in libusb.c and cyapi.c even
though get_flash_id is actually handled in usb.c
bladerf_open() will retrieve the SPI flash ID information from
the FX3 and decode it to get the flash density, page size, and other
architectural information required for flash interaction.
If the FX3 firmware does not support flash ID readback, assumptions will
be made based on the FPGA size. If FPGA size is not available, sane
defaults will be used. This should be sufficient to read calibration and
other important data from flash for board operation. Flashing an FPGA,
however, may not work depending on the device specifics.
Adds a bladerf_get_serial_struct function, which is similar
in functionality to bladerf_get_serial, but instead of requiring
a user-supplied buffer of at least BLADERF_SERIAL_LENGTH bytes,
it expects a pointer to a struct bladerf_serial which itself has
a buffer of BLADERF_SERIAL_LENGTH bytes as a member.
This turns BLADERF_SERIAL_LENGTH into an API-internal value,
instead of something that API users have to be intently aware of.
Fixes#382
on the bladerf2, bladerf_trigger_arm was calling fpga_trigger_fire
instead of fpga_trigger_arm, creating a situation where the triggers
were not being armed.
Fixes#632
Renames a couple static functions to clarify their usage
Changes a couple more uint64_t to bladerf_frequency
Remove __FUNCTION__ from a few warnings/errors where it is just
clutter
Adds 'manufacturer' and 'product' members to the
bladerf_devinfo struct, and ensures they are properly
initialized and populated during enumeration.
These contain the human-readable manufacturer and
product names from the USB device descriptor.