Commit graph

2,816 commits

Author SHA1 Message Date
Rey Tucker
134ae20216 debian: update for firmware v2.2.0 2018-08-07 18:09:25 -04:00
Rey Tucker
3c8990ee62 debian: update FPGA images to 0.7.3 2018-08-07 17:48:18 -04:00
Rey Tucker
7a0aeaba38 host: libbladeRF: add FPGA 0.7.3 compat 2018-08-07 17:46:09 -04:00
Rey Tucker
c114f03ce6 hdl: update changelog, set version 0.7.3 fpga_v0.7.3 2018-08-07 15:25:25 -04:00
Robert Ghilduta
5efc05eec7 test_repeater: fixup test 2018-08-07 11:22:19 -05:00
Robert Ghilduta
75836c52f3 test_peripheral_timing: add testing for RFIC 2018-08-07 11:22:19 -05:00
Robert Ghilduta
591c32581c bladeRF-cli: fixup erase command argument 2018-08-07 11:22:19 -05:00
Robert Ghilduta
de0cf95199 matlab: update Simulink block
The Simulink block is updated to work with the latest libbladeRF.
2018-08-07 11:22:19 -05:00
Robert Ghilduta
b98a1fee79 matlab: update bladeRF_rx_gui
Massive changes to bladeRF_rx_gui to allow it to work with the new gain methods
and also allow it to properly inform the user of problems setting gains when
the gain mode (AGC) is set to automatic.
2018-08-07 11:22:19 -05:00
Robert Ghilduta
124bffe86a matlab: add BladeRF_Misc for miscellaneous measurements and controls
Some platforms have power and temperature monitoring, provide a way for them to
be exposed in matlab. To read the temperature of a device run the following:

> b = bladeRF()
> b.misc.temperature

misc.dc_power can be used to read the current power consumption
misc.dc_source be used to determine if the power is coming from USB or AC
2018-08-07 11:22:19 -05:00
Robert Ghilduta
3510033997 matlab: update bladeRF_XCVR
bladeRF_XCVR has to catch up to the new way of doing things in libbladeRF. Low
level gain settings like directly RXLNA, RXVGA1, RXVGA2, TXVGA1, and TXVGA2 have
all been removed to make way for the unified gain setting based on
bladerf_set_gain(). Setting the gain value to 60 for RX indicates maximum RX
gain, while a value of 60 for TX indicates a output power of 0dBm.
2018-08-07 11:22:19 -05:00
Robert Ghilduta
1815ec7695 matlab: identify new boards and FPGA sizes
Adding the new A4 and A9 boards. Currently some decisions are being made by
identifying the generation of the device. In the future this should be replaced
with a feature and capability mask.
2018-08-07 11:22:19 -05:00
Robert Ghilduta
eeb6253657 matlab: update libbladeRF_proto
Add or update the definitions for the following functions:

bladerf_enable_module
bladerf_set_gain
bladerf_set_gain_mode
bladerf_get_gain_mode
bladerf_set_sample_rate
bladerf_set_rational_sample_rate
bladerf_get_sample_rate
bladerf_get_rational_sample_rate
bladerf_set_bandwidth
bladerf_get_bandwidth
bladerf_set_lpf_mode
bladerf_get_lpf_mode
bladerf_select_band
bladerf_set_frequency
bladerf_schedule_retune
bladerf_cancel_scheduled_retunes
bladerf_get_frequency
bladerf_get_quick_tune
bladerf_set_loopback
bladerf_get_loopback
bladerf_trigger_init
bladerf_set_correction
bladerf_get_correction
bladerf_xb200_set_filterbank
bladerf_xb200_get_filterbank
bladerf_xb200_set_path
bladerf_xb200_get_path
bladerf_get_timestamp
bladerf_stream
bladerf_set_stream_timeout
bladerf_get_stream_timeout
bladerf_sync_config
bladerf_sync_tx
bladerf_read_trigger
bladerf_write_trigger
bladerf_get_board_name
bladerf_get_channel_count
bladerf_get_gain
bladerf_get_gain_modes
bladerf_get_gain_range
bladerf_set_gain_stage
bladerf_get_gain_stage
bladerf_get_gain_stage_range
bladerf_get_gain_stages
bladerf_get_sample_rate_range
bladerf_get_bandwidth_range
bladerf_get_frequency_range
bladerf_set_rf_port
bladerf_get_rf_port
bladerf_get_rf_ports
bladerf_get_loopback_modes
bladerf_is_loopback_mode_supported
bladerf_interleave_stream_buffer
bladerf_deinterleave_stream_buffer
bladerf_trim_dac_write
bladerf_trim_dac_read
bladerf_get_tuning_mode
bladerf_get_bias_tee
bladerf_set_bias_tee
bladerf_get_rfic_register
bladerf_set_rfic_register
bladerf_get_rfic_temperature
bladerf_get_rfic_rssi
bladerf_get_rfic_ctrl_out
bladerf_get_pll_lock_state
bladerf_get_pll_enable
bladerf_set_pll_enable
bladerf_get_pll_refclk_range
bladerf_get_pll_refclk
bladerf_set_pll_refclk
bladerf_get_pll_register
bladerf_set_pll_register
bladerf_get_power_source
bladerf_get_clock_select
bladerf_set_clock_select
bladerf_get_clock_output
bladerf_set_clock_output
bladerf_get_pmic_register
bladerf_get_rf_switch_config
2018-08-07 11:22:19 -05:00
Robert Ghilduta
7e015568a8 matlab: change not supported (-8) library errors to Matlab warnings
Most of the changes that make libbladeRF return -8 still allow scripts to run
without serious issues. This commit should be changed back after a few releases
once developers have had a chance to update their scripts.
2018-08-07 11:22:19 -05:00
Robert Ghilduta
106a66fddc matlab: build_thunk() now needs bladeRF1.h and bladeRF2.h
libbladeRF.h references bladeRF1.h and bladeRF2.h so they must now be copied
over to compile the matlab bindings.
2018-08-07 11:22:08 -05:00
Rey Tucker
78286d47f9 host: common: add log_get_verbosity function
log_get_verbosity returns the current logging level, which may be useful
for situations where a lot of processing is required for verbose
logging, etc.
2018-08-01 16:24:54 -04:00
Rey Tucker
ca6b717ff4 host: bladeRF-cli: fix error on 'peek' and 'poke' help
When we changed to 'rfic' and 'pll' to describe the RFIC and PLL chips,
the documentation didn't get updated.
2018-08-01 16:24:13 -04:00
Rey Tucker
4b8a02ad8d host: libbladeRF: readability on nios_ad9361_spi_* verbose logging
Fix up the verbose logging on nios_ad9361_spi_read/write so that the
numbers line up, and so that it expands out multi-reads and multi-writes
in a useful fashion.
2018-08-01 16:23:47 -04:00
Rey Tucker
dbe0f12c3f
host: libbladeRF: add additional debugging to sync streaming (#64)
In the event of a timeout, an error is emitted from the actual place where the timeout occurred.

Also, if ENABLE_LIBBLADERF_SYNC_LOG_VERBOSE is defined, it will now print out a condensed status of all the buffers on each run through the sync state machine.

* host: sync: add error message when wait_for_buffer times out

* host: libusb: add error message for timeout

* clean up wording on libusb.c err a bit

* host: sync_worker: add debug prints on init failures

* host: bladerf2: print wallclock time on enable_module

* host: sync: add more super-verbose debug print

* host: sync: simplify ifdef

* host: libbladeRF: clang-format modified functions
2018-07-24 16:21:51 -04:00
Rey Tucker
98d4452597 host: libbladeRF/bladerf2: quick clang-format fixes 2018-07-18 15:47:06 -04:00
Rey Tucker
52605a0ef4
host: libbladeRF/bladerf2: reset RX FIFO when enabling a second RX channel; refactor/cleanup (#63)
Corrects an issue where enabling multiple RX channels would create some confusing discontinuities in the sample stream.

The first RX channel configured would start samples buffering in the FIFO, but the second configuration would not be apparent until after those samples were read.

This PR also does a general refactoring of bladerf2_enable_module and associated helper functions to make the logic flow more clear.
2018-07-12 16:14:40 -04:00
Robert Ghilduta
63f8162e6e libbladeRF: update fx3 firmware compatibility 2018-06-20 05:42:03 -04:00
Robert Ghilduta
bc576497fc host: python: add trim DAC read/write accessors
These functions get and set trim DAC values
2018-06-20 00:50:31 -04:00
Robert Ghilduta
f4f719330a bladeRF-cli: fixup setting txvga2 on bladeRF1 2018-06-20 00:50:31 -04:00
Robert Ghilduta
70acf8a303 libbladeRF: load bladeRF2 size and calibration value from flash
This effectivelly makes the bladeRF2 behave similarly to the bladeRF1.
2018-06-20 00:50:31 -04:00
Robert Ghilduta
9d999ae2cf fx3_firmware: bump version to 2.2.0 firmware_v2.2.0
Version 2.2.0 includes reunification of the FX3 builds and OTP support for
Winbond chips.
2018-06-19 00:38:37 -04:00
Robert Ghilduta
bbebcd110c fx3_firmware: change when NuandFpgaConfigSwInit() is called
NuandFpgaConfigSwInit() is now delayed because it now requires the SPI
manufacturer to be known.
2018-06-19 00:38:37 -04:00
Robert Ghilduta
d6a9911fce fx3_firmware: add manufacturer specific calls
Add support for reading OTP security registers from Winbond chips.
2018-06-19 00:38:37 -04:00
Robert Ghilduta
9dd948609f fx3_firmware: add isOtp to SPI transfer function
Winbond flash chips have a specific SPI command for reading the security
registers.
2018-06-19 00:38:37 -04:00
Robert Ghilduta
1b974a3f9c fx3_firmware: unify bladeRF builds
Differentiate different bladeRF products based on the SPI chip manufacturer.
2018-06-19 00:38:37 -04:00
Robert Ghilduta
9d24fe7ebe fx3_firmware: use SPI Manufacturer to tell boards apart 2018-06-18 20:38:20 -04:00
Rey Tucker
a6a58e5ed6
host: Windows build fixes (#62) 2018.06-alpha2 2018-06-01 18:29:02 -04:00
Rey Tucker
f11d104a36 host: bladeRF-cli: fix strncat warning
Fixes:

host/utilities/bladeRF-cli/src/cmd/rx.c:137:13: error: ‘strncat’ output
may be truncated copying 31 bytes from a string of length 31
[-Werror=stringop-truncation]

by using fixed-sized buffers
2018-06-01 16:49:24 -04:00
Rey Tucker
87a90c7682 host: libbladeRF_test: fix missing main() return 2018-06-01 16:43:25 -04:00
Rey Tucker
bd03766f20 host: parse.c: fix strnlen warning
Fixes:

host/common/src/parse.c:378:14: error: 'strncpy' specified bound depends
on the length of the source argument [-Werror=stringop-overflow=]

Allocating 128 bytes all the time resolves this.
2018-06-01 16:41:19 -04:00
Rey Tucker
6e78b7b952
host: define SHORT_FILE_ during cmake builds (#61)
* host: cmake: add function to set SHORT_FILE_ def

The function, based heavily off of a Stack Overflow example :), goes
through all of the source files defined for a given target and sets the
SHORT_FILE_ definition for them.

This results in debug log messages relative to the top directory of the
project, i.e.:

[DEBUG @ host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c:930]
_set_tx_mute: muting TX1 (cached: 10000)

* host: libbladeRF: enable Shortfile for libbladerf_shared
2018-06-01 15:52:32 -04:00
Rey Tucker
769a9c98c2
host: libbladeRF: clean up magic numbers in bladerf2.c (#60) 2018-06-01 15:52:03 -04:00
Rey Tucker
152b7be95c
host: python: fix calls to get_*_range (#59)
The Python bindings didn't get updated for the `const struct bladerf_range **` changes in #48 and #53 , but now they are
2018-06-01 15:51:47 -04:00
Rey Tucker
7dc32cc56f
host: bladerf_get_channel_count now takes a bladerf_direction (#58)
This is more intuitive than 'bool tx'.
2018-06-01 15:49:04 -04:00
Rey Tucker
36291292db host: libbladeRF: fix formatting error on version.h.in 2018-05-30 15:33:41 -04:00
Rey Tucker
fff07e422c
host: bladeRF_cli: add support for MIMO RX and TX (#57)
Adds support for multi-channel RX and TX via the bladeRF-cli utility
2018-05-30 15:27:54 -04:00
Rey Tucker
2c950ad246 host: libbladeRF: clang-format doc examples (#56) 2018-05-30 15:27:07 -04:00
Rey Tucker
2d62faa36f
host: libbladeRF: clang-format the *.h files (#55) 2018-05-30 15:26:28 -04:00
Rey Tucker
ae129c5ccd
host: libbladeRF: improve consistency of 'const' modifier location (#54)
I have a tendency to put 'const' in the middle of the type, e.g. struct bladerf_range const **range

I can argue that it is superior to do it that way, but I don't want to, as it makes no difference and just looks weird :)

* libbladeRF.h: put const at start of type

* board.h: move const to the start of types
2018-05-29 13:11:05 -04:00
Rey Tucker
5ef5199d88
host: bladerf_get_*_range now expect struct bladerf_range** (#53)
* libbladeRF: brf_get_*_range expect bladerf_range**

Previously, the bladerf_get_*_range family of functions expected a
struct bladerf_range *

The gain-related functions turned out to require a double ptr to work
properly. For consistency, this commit changes libbladeRF to use a
double ptr on all the range functions, instead of just the gain ones.

* bladeRF-cli: update get-range function calls
2018-05-29 13:10:49 -04:00
Rey Tucker
a0d498e723
host: typedef common parameter types (#51)
* libbladeRF: add typedefs for common parameter types

This adds typedefs for, and changes libbladeRF.h to use said typedefs
for, the following:

bladerf_gain -> int
bladerf_sample_rate -> unsigned int
bladerf_bandwidth -> unsigned int
bladerf_frequency -> uint64_t
bladerf_timestamp -> uint64_t
bladerf_correction_value -> int16_t
2018-05-25 11:45:38 -04:00
Rey Tucker
1dc6317b93
host: make low-level API calls generic by removing part numbers (#49)
Instead of using specific part numbers for low-level API calls on the bladeRF micro, use generic functionality-based names.
2018-05-25 10:55:04 -04:00
Rey Tucker
c74c6282ad
host: improve platform-independence of bladerf_{set,get}_gain (#48)
The bladerf_{set,get}_gain functions are now reasonably hardware-independent.

On TX channels, setting a gain of 60 dB should result in a CW TX power of roughly 0 dBm.

On RX channels, 60 dB is the maximum gain level.

The ranges returned by bladerf_get_gain_range are adjusted to reflect this.
2018-05-25 10:53:58 -04:00
Brian Glod
cf50e88480 host: bladeRF2: remove set/clr of BLADERF_GPIO_TIMESTAMP_DIV2 (#52)
The Nios config GPIO bit used for BLADERF_GPIO_TIMESTAMP_DIV2 was
repurposed in bladeRF2 to be used as the UFL output clock enable
bit. Commit fixes unintentional clearing of this bit when timestamps are
not used.
2018-05-25 10:53:21 -04:00
Rey Tucker
7f32bf40c0
host/libbladeRF: move config file handling to its own file (#50) 2018-05-24 13:53:52 -04:00