Commit graph

2,976 commits

Author SHA1 Message Date
Rey Tucker
c490baa215 Python bindings v1.1.0 python_v1.1.0
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.
2018-10-30 16:45:24 -04:00
Rey Tucker
01e2dc6e22 MATLAB v1.0.2 matlab_v1.0.2 2018-10-30 16:41:29 -04:00
Rey Tucker
6b659c2dcc bladeRF-cli v1.7.0 bladeRF-cli_v1.7.0 2018-10-30 16:40:20 -04:00
Rey Tucker
97d0cfae2f libbladeRF v2.1.0 libbladeRF_v2.1.0 2018-10-30 16:34:14 -04:00
Rey Tucker
344e677dea host: backend/cyapi: fix cyapi_get_flash_id compile fail on Windows 2018-10-30 16:08:26 -04:00
Rey Tucker
d69b71f396 debian: update firmware pointer to v2.3.1 2018-10-30 15:24:54 -04:00
Rey Tucker
238ac3a8e7 debian: update FPGA pointer v0.8.0 -> v0.9.0 2018-10-30 15:23:35 -04:00
Rey Tucker
dc83ca473f hdl: build: add -S option to specify fitter seed
Optional argument to set the seed for a build.
2018-10-26 20:10:17 -04:00
Rey Tucker
a0f89f40ad hdl: fpga_v0.9.0 fpga_v0.9.0 2018-10-26 16:38:41 -04:00
Rey Tucker
95aa1837fb host: libbladeRF: add FPGA v0.9.0 compat 2018-10-26 16:37:24 -04:00
Rey Tucker
cb5dd4e954 hdl: bladerf-micro: weak pull-up on fx3_uart_rxd (#679)
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.
2018-10-26 16:02:01 -04:00
Rey Tucker
45bcbfafd4 host: bladeRF-cli: print ranges on sample rate, bandwidth, frequency
When printing bandwidth, frequency, and sample rate, display the
supported ranges in parantheses after the current value.
2018-10-26 15:56:50 -04:00
Rey Tucker
9640eec3b9 hdl: bladerf-micro: add false path for pwr_status 2018-10-24 14:07:49 -04:00
Brian Glod
2ffc216499
hdl: nios: README.md
Clarify import "Existing projects into Workspace"
2018-10-24 13:58:52 -04:00
Rusver
ff1650bb0b updated the year 2018-10-22 11:08:03 -04:00
Robert Ghilduta
e1d8c61c44 libbladeRF: add meta RX hardware flags for underflow, miniexp{1,2} 2018-10-21 01:20:01 -07:00
Robert Ghilduta
803768cd48 hdl: enable miniexp routing to fifo_writer 2018-10-20 20:56:41 -04:00
Robert Ghilduta
54baeb15e8 hdl: add new miniexp flags to fifo_write
fifo_writer encodes when miniexp1 and miniexp2 IO pins are asserted.
2018-10-20 20:56:41 -04:00
Robert Ghilduta
22bc0486e5 hdl: clean up metatdata flags field in GPIF
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."
2018-10-20 20:56:41 -04:00
Robert Ghilduta
0cb4ea8885 libbladeRF: fix OSX and FreeBSD compilation issue
malloc.h is not present on either OSX or FreeBSD. Avoid including it on those
platforms.
2018-10-18 23:02:05 -07:00
Robert Ghilduta
fd26dabf8b hdl: instantiate ADS-B core in bladerf-adsb revision
These are the only changes necessary to the top level design to instantiate the
ADS-B core.
2018-10-19 01:41:16 -04:00
Robert Ghilduta
cd83e18bac hdl: introduce adsb_fifo_t type to bladeRF-micro platform
adsb_fifo_t should be unified with rx_fifo_t when Quartus starts supporting
generic packages.
2018-10-19 01:41:16 -04:00
Robert Ghilduta
f8d0991041 hdl: copy adsbfifo to bladeRF-micro platform
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.
2018-10-19 01:41:16 -04:00
Robert Ghilduta
31addf6173 hdl: initial ADSB revision for bladeRF-micro
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.
2018-10-19 01:41:13 -04:00
Robert Ghilduta
6f711fbf9b hdl: introduce and use adsb_fifo_t
adsb_fifo_t should be unified with rx_fifo_t when Quartus starts supporting
generic packages.
2018-10-19 01:41:07 -04:00
Robert Ghilduta
c7efc303af hdl: build changes to bladeRF platform w/ ADSB revision 2018-10-19 01:41:00 -04:00
Rey Tucker
c9a2230cf4
host: common: include pthread.h in nanosleep.h (#669) (#671)
* 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
2018-10-08 18:04:29 -04:00
Rey Tucker
95f620cf5d
host: libbladeRF: fix wrong get_flash_id fptr in dummy.c (#670)
* host: libbladeRF: fix wrong get_flash_id fptr in dummy.c

h/t @gvanem

* also point cypress_fns.get_flash_id to an actual function
2018-10-08 18:04:01 -04:00
Rey Tucker
f38dde896b python: update _cdef with bladerf_get_fpga_source 2018-09-27 14:45:27 -04:00
Rey Tucker
75906e68e5 host: python: improve import_header.py script
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.
2018-09-27 14:45:16 -04:00
Rey Tucker
14a9677f11 bladeRF-cli: fix missing return in error case
Fixes #666
2018-09-27 14:44:52 -04:00
Rey Tucker
d73fd39ac7 host: libbladeRF/sync: extend transfer timeout to match stream timeout
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.
2018-09-26 15:35:21 -04:00
Rey Tucker
ecf2f711dd fx3: update changelog for v2.3.1 firmware_v2.3.1
Also add entry for v2.3.0
2018-09-26 15:17:45 -04:00
Rey Tucker
04bd38586b bladeRF-cli: version: display FPGA config source, if known
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.
2018-09-26 14:50:23 -04:00
Rey Tucker
fa73127ba0 host: libbladeRF: add bladerf_get_fpga_source()
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.
2018-09-26 14:50:23 -04:00
Rey Tucker
18ea3633e8 fx3: add BLADE_USB_CMD_QUERY_FPGA_SOURCE command
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.
2018-09-26 14:50:23 -04:00
Rey Tucker
939ac018ba top: CMakeLists: if enabled, always build fx3
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.
2018-09-26 12:50:48 -04:00
Rey Tucker
51bc249055 fx3: don't stop flash->fpga autoload on USB reset
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.
2018-09-26 12:44:49 -04:00
Rey Tucker
5ff42cebe7 host: libbladerf/bladerf2: implement bladerf_{set,get}_stream_timeout 2018-09-26 12:44:03 -04:00
Rey Tucker
74a876d274 host: matlab: fix tx_gain property handling in simulink
processTunedPropertiesImpl() was not updated during the migration
from tx_vga1+tx_vga2 to tx_gain.

h/t mando238

Fixes #654
2018-09-26 12:43:42 -04:00
Rey Tucker
57b111fc05 host: python: update _cdef.py 2018-09-26 12:43:16 -04:00
Rey Tucker
2e5ef31196 host: bladeRF-cli: add support for trigger signal aliases 2018-09-26 12:43:16 -04:00
Rey Tucker
fb9e6d02d0 host: libbladeRF/common: allow more accurate trigger labeling
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.
2018-09-26 12:43:16 -04:00
Brian Glod
e2daa36467 hdl: build: Cygwin compatibility
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.
2018-09-25 17:00:48 -04:00
Rey Tucker
9b6f314063 top: CMakeLists: fix fx3_firmware cmake args 2018-09-25 15:43:24 -04:00
Rey Tucker
628236b07e host: bladerf1: skip init if BLADERF_FORCE_NO_FPGA_PRESENT
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.
2018-09-24 14:54:57 -04:00
Rey Tucker
da4fe49d78 hdl: bladerf: remove unnecessary/incorrect false_paths
synchronizers are responsible for doing their own timing
constraints inline
2018-09-24 14:53:23 -04:00
Rey Tucker
961ea1b738 hdl: bladerf: hosted: fix clock crossings, add registers
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
2018-09-24 14:53:23 -04:00
Rey Tucker
80c68e1678 hdl: nuand/command_uart: add registers to improve timing
Improves the odds of timing closure by registering the
output signal (rs232_sout).
2018-09-24 14:53:23 -04:00
Rey Tucker
0f46ea6255 hdl: bladerf: constrain the unconstrained paths
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.
2018-09-24 14:53:23 -04:00