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.
Add a weak pull-up on fx3_uart_rxd
This is a bus used for both FPGA-to-FX3 UART data and FX3-to-Flash
SPI data, and without something driving it, it tends to float around
0.55 volts (which is very much a low/asserted signal for the UART).
When the FX3 SPI interface has the bus, it puts the FPGA into reset
via fx3_ctl(7), and fx3_uart_rxd goes high-Z accordingly.
I suspect what we're running into is a race condition between the FX3
reconfiguring the pin to UART mode and bringing the FPGA out of reset,
and the FPGA shifting from high-Z to high/idle, given:
- All of the "junk bytes" seen so far have been all ones followed by
all zeroes, e.g. 0xF0, 0xFC, etc
- Being low for 5 clocks and then going high is indistinguishable from
a start bit followed by 0xF0 followed by a stop bit.
Thus, by maintaining a constant weak pull-up on this bus, we can
ensure it's a logic high when idle.
There are possible side effects when the bus is in its SPI MOSI role,
but I believe they are minor. The FX3 is not expecting a pull-up/down
on this signal, and this is a critical pin for flash access. But,
C5's R_pu is 25 kohms, which means sinking 1.4 mA to pull it low, and
the FX3's absolute maximum output current is 20 mA, so I think we are
good here.
The 16 LSBs of the flag word are overwritten by the GPIF state machine. The
other half is under control by the fifo_writer. Care should be taken when
appropriating new bits.
Bit 1 now encodes no "underrun", and bit 0 continues to encode "underrun."
There is a case to say that this file should not be duplicated and kept in
common/. However the platform common directory is more much more abstract pieces
of code.
bladerf-adsb.vhd is a direct copy of bladerf-hosted.vhd. rx-adsb.vhd is a direct
copy of rx.vhd. These files will be modified to instantiate and enable the ADS-B
core.
* 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.
Adds a BLADE_USB_CMD_QUERY_FPGA_SOURCE command, which is used
to query the source of the currently-running FPGA program, if
known.
Increment version number to 2.3.1.
CMake assumes that external projects are not modified. However,
this is not always the case. (e.g. if you're modifying both fw
and host simultaneously and want to use your IDE's build system
interface)
There do not seem to be any side effects from this, and though
we generally recommend building host/ and fx3_firmware/
separately, this is still a useful capability to have.
When libbladeRF is built with ENABLE_USB_DEV_RESET_ON_OPEN, a
USB port reset is performed on open, to work around some xHCI
controller bugs.
This hits the CyFxbladeRFApplnUSBEventCB() callback with an
event type of CY_U3P_USB_EVENT_RESET, which is then dispatched
to StopApplication(), which calls NuandRFLink.stop() or
NuandFpgaConfig.stop() or does nothing, depending on what the
glAppMode is.
Unfortunately, if the FX3 is loading an FPGA bitstream from the
SPI flash to the FPGA, NuandFpgaConfig.stop() also stops that
dead, and bladeRFAppThread_Entry() progresses forward and we end
up with an unconfigured FPGA. In that case, libbladeRF will then
go through the FPGA autoloading process.
This is essentially a race condition: which FPGA image is loaded,
if any, depends on the time between plugging in the bladeRF and
opening it. Kinda gross.
A reasonable workaround for this is implemented thus: if there's
a valid autoload image (glAutoLoadValid is true) and we haven't
yet made it through bladeRFAppThread_Entry() (glDeviceReady is
false), and we're in glAppMode == MODE_FPGA_CONFIG, then take no
action in StopApplication().
This seems to work OK with some limited power-cycle testing on
both an x40 and an xA4.
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.
The use of 'readlink' with 'quartus_sh' results in bogus paths when
inside a Cygwin environment. Use of 'readlink' was determined to be
unnecessary and was removed.
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.
synchronizes and/or registers:
lms_rx_enable_qualified, into rx_clock
xb_gpio_dir and dac_csx, into 80MHz
fx3_uart_cts, into fx3_pclk_pll
Improves timing closure probability
This commit updates the timing constraints for the bladerf1 to
constrain a number of previously-unconstrained paths:
fx3_uart_cts
lms_sclk
exp_{spi_clock,spi_mosi,gpio[*],clock_in}
mini_exp{1,2}
It also fixes the false_path for the TX FIFO ACLRs.