Accommodates the following warning issued by CMake v3.27.1.
CMake Deprecation Warning:
Compatibility with CMake < 3.5 will be removed from a
future version of CMake.
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.
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.
Allows the SPI flash manufacturer ID and device ID to be reported to the
host. Useful for determining the architecture (density, page size, etc.)
of the flash chip used on the board.
When ending a loopback test (e.g. with
libbladeRF_test_digital_loopback), a spurious 0x40 error occurred from
trying to clear the glChHandlePtoU DMA channel, which does not get set
up if loopback is enabled.
If the USB interface is not connected, CyU3PUsbGetSpeed() returns
CY_U3P_NOT_CONNECTED. Previously we treated this as an error, which
caused failures when loading an FPGA bitstream from flash in a headless
configuration.
We now assume a reasonable DMA size and skip the USB configuration
altogether if there is no USB connection.
Squashed commit of the following:
fx3_firmware: update CHANGELOG for 2.1.0
libbladeRF: add fw 2.1.0 to compatibility tables
fx3: version number bump 2.0.0 -> 2.1.0
fx3: clean up CMakeLists.txt, add config switches
fx3: copyright date bump
fx3: move USB descriptors to own linker section
fx3: move descriptor consts to board-specific files
fx3: add support for bladeRF 2.0
The combination of CMake and a custom Makefile/toolchain.mk was messy.
This change is to achieve better consistency with the CMake-oriented
workflow of the remainder of the project software and to make it easier
to maintain and change in the future. (CMake options may be used to
enable/disable features.)
A simple event logger has been added to the firmware to replace
the use of CyU3PDebugPrint() calls. This is intended to provide access
to errors and diagnostic information without requiring JTAG access.
Added note about FX3 SDK 1.3.3 not yet being tested yet.
Review of the 1.3.3 release notes indicates that some source-level and build-script changes may be needed.
This "device ready" status is used to denote that the device is
ready to be configured and used. Until the device becomes "ready"
all control requests will return an error.
This provides libbladeRF with a means to query when the device is done
loading an FPGA from flash, as well as any other firmware-based
initializations that may be needed in the future.
Stale RX and TX samples have been reported (issue #255). This occurs
because the CyU3PResetEp() call does not reset DMA channels and their
underlying DMA buffers, nor does it clear the DMA buffers associated
with an endpoint.
Use of the existing ClearDMAChannel() as is would have required some
ridiculous shoehorning, so some cleanup was done:
- Endpoint halt & ACK operations have been removed from
ClearDMAChannel(). These operations are outside of the scope
of clearing DMA buffers, and have been moved to their respective
locations in handling set/clear halt endpoint requests.
- reset_endpoint() has been added to the NuandApplication function
table. Internally, this operation is now used in performing
the halt_endpoint() operation.
- Misc return value checks added. Granted, these don't help much
as there's no accessible debug log.