Commit graph

1,821 commits

Author SHA1 Message Date
Rey Tucker
d73d4648df
libbladeRF: polished release notes for v2.0 (#583)
Updates the release notes for v2.0 to include more useful information, less useless information, and fewer typos. More consistent and readable, hopefully.

Also fixes one error in the documentation in libbladeRF.h.

* host: libbladeRF/doxygen: improve 2.0.0 relnotes

Some wording/formatting cleanup here and there.

Add \remarks for most sections to suggest some "do not" and "do" items.

Add some quick documentation on the bias tees, PLL, power status, etc.

* host: libbladeRF: fix doc for bladerf_get_timestamp

* host: libbladeRF/doxygen: more relnotes work

Adding a "What is a channel?" section to describe channels

* libbladeRF: 2.0.0 relnotes: soften wording, misc cleanup

* libbladeRF: relnotes: new section on gain ranges, fixup sectioning for Further Info

* libbladeRF: relnotes: more fixes, cleanup

* libbladeRF: relnotes: more tweaks, getting close

* libbladeRF: relnotes: final changes, honest

* libbladeRF: docs: relnotes 2.0.0 -> relnotes 2.0

This is actually more sensible given the versioning.

* libbladeRF: relnotes: fix typos/spelling

* libbladeRF: relnotes: hand-merge ac6b182c

Update wording
2018-08-24 12:04:39 -04:00
Rey Tucker
75b47007b0 Revert "Cleanup some minor things in relnotes 2.0.0"
This reverts commit ac6b182c95.

This is a temporary revert to allow PR #583 to land.
2018-08-24 12:03:25 -04:00
Robert Ghilduta
ac6b182c95 Cleanup some minor things in relnotes 2.0.0 2018-08-24 06:18:13 -05:00
Brian Glod
84ea9784ec host: libbladeRF: Rename clock select option
The bladeRF-micro has an option to use either its onboard VCTCXO or an
external 38.4 MHz clock as the clock source for components on the
board. This change addresses some ambiguity in the naming of the onboard
option by renaming it from 'vctcxo' to 'onboard'.

The valid options are now:

1. onboard
2. external
2018-08-23 23:29:56 -04:00
Rey Tucker
df07dd941a
host: libbladeRF/bladerf2: cache factory trimdac value, preserve trimdac disable state (#582)
Fixes a lockup/crashy bug where bladerf2_get_vctcxo_trim would cause active RX/TX streams to fail. Also ensures that "set trimdac" won't inadvertently re-enable the trim DAC if it is disabled (e.g. because the PLL is enabled).

* host: libbladeRF/bladerf2: cache factory trimdac value

bladerf2_get_vctcxo_trim called spi_flash_rad_vctcxo_trim, which causes
an USB mode change which is incompatible with active sample streaming.
This would cause active RX/TX to fail if someone used "set trimdac" or
even "print".

We now cache the value during initialization, and return the cached
value if it is requested later on.

* host: libbladeRF/bladerf2: preserve trimdac disable state

If bladerf2_trim_dac_write is called with a new value, while the trim
DAC is disabled, make sure we do not inadvertently re-enable the trim
DAC.  Save the new value in the board_data struct for later use by
bladerf2_set_trim_dac_enable.
2018-08-23 17:06:58 -04:00
Rey Tucker
98e10676e3
host: libbladeRF: check for null xb_data in xb200 fns (#575) (#579)
Verify that dev->xb_data is not NULL before using it.  Also
ensure that it is NULL after freeing.

Fixes #575
2018-08-23 13:35:13 -04:00
Robert Ghilduta
674dba4062 libbladeRF: correct small typo in gain calculation 2018-08-23 01:08:57 -05:00
Robert Ghilduta
de6c695ec0 libbladeRF: only check AGC DC LUT setting when enabling AGC 2018-08-23 01:08:52 -05:00
Robert Ghilduta
81ec286d1f libbladeRF: bladeRF1 gain mode error code should not stop initialization 2018-08-23 01:08:47 -05:00
Rey Tucker
e5fb3e9c20
host: libbladeRF: detect possible bladeRF2 during bladeRF1 init (#572) (#578)
If a pre-2.2.0 firmware is flashed to a bladeRF2 device, there is no way
to fix the problem without jumpering into bootloader because the
initialization aborts with a BLADERF_ERR_UNEXPECTED.

Here, we're looking for the bladeRF2 FPGA signatures, and if we find
them, we return from bladerf1_open() early after printing some useful
tips. This allows firmware flashing to occur, but not much else because
the FPGA is not loaded.

Fixes #572
2018-08-21 15:40:02 -04:00
Josh Farwell
0e40d92d3a "set loopback" help dialog aware of board type (#566)
* "set loopback" command aware of board type

The help dialog was giving incorrect information when a bladeRF2 is connected.
According to the library code, only "firmware", "none" and "rfic_bist"
are valid options for that board.

https://github.com/Nuand/bladeRF/blob/master/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c#L3837

Now we only display the other options when a bladeRF1 is connected.

Signed-off-by: Josh Farwell <josh.farwell@gmail.com>

* bladeRF-cli: check for bladeRF2 in "set loopback" help

rfic_bist is only a valid mode on bladeRF2, do a check
so we don't display it incorrectly for bladeRF1 users.

Signed-off-by: Josh Farwell <josh.farwell@gmail.com>
2018-08-21 15:36:34 -04:00
Rey Tucker
85fd6da22a
host: fix builds on 32-bit platforms (#573)
Builds were failing in various ways on 32-bit platforms, due to various assumptions (and the fact that pretty much everything is 64-bit nowadays). This PR should fix all of them so that it builds clean.

* host: libbladeRF/thirdparty/adi: fix build error on 32-bit systems

sizeof(void*) is not necessarily equal to sizeof(uint64_t)

* host: libbladeRF/doc: fix 32-bit build failure on doc example

sizeof(size_t) does not always equal sizeof(uint64_t)

* host: docker: remove centos-7-i386 build

it doesn't work, and this is an edgy-enough case that i think we'll be
okay with the ubuntu i386 builds

* host: libbladeRF/bladerf2: explicitly note constant types

On non-64-bit platforms, these integer constants can be ambiguous, which
throws compiler warnings.

* host: libbladeRF_test: explicitly note constant types

On non-64-bit platforms, these integer constants can be ambiguous, which
throws compiler warnings.
2018-08-16 18:57:52 -04:00
Nick "darkfiberiru" Wolff
6c7f4c680a Fixes so we can build on freebsd again (#561) 2018-08-16 18:56:32 -04:00
Rey Tucker
f918ea49e1
host: docker: fixes for non-linux systems (e.g. macos) (#574)
Gracefully handle situations where there's no nproc command or /proc/loadavg file when doing parallel builds.
2018-08-16 18:49:32 -04:00
Rey Tucker
e958cf154a host: docker: add i386 tests 2018-08-16 02:30:42 -04:00
Rey Tucker
074f737307 host: matlab: v1.0.0
Update version tag to v1.0.0.
2018-08-13 20:27:13 -04:00
Rey Tucker
fafeeafb05 host: bladeRF-cli v1.6.0
Update version number for release
2018-08-13 20:18:55 -04:00
Rey Tucker
c58600e420 host: libbladeRF v2.0.0
Update changelog and version tags for v2.0.0
2018-08-13 20:08:09 -04:00
Rey Tucker
21059b2a68 host: libbladeRF_test: fix printf of int64_t value
Fixes build failure on macOS
2018-08-07 18:23:19 -04:00
Rey Tucker
7a0aeaba38 host: libbladeRF: add FPGA 0.7.3 compat 2018-08-07 17:46:09 -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
Rey Tucker
a6a58e5ed6
host: Windows build fixes (#62) 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