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.
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
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.
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.
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.
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.
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.
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
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.
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
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.
* 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
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
* 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
* 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
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.
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.
* devinfo: fix strncpy error
Fix two build errors on Arch:
/root/bladeRF/host/libraries/libbladeRF/src/devinfo.c:308:5:
error: ‘strncpy’ destination unchanged after copying no bytes
[-Werror=stringop-truncation]
/root/bladeRF/host/libraries/libbladeRF/src/devinfo.c:308:5:
error: ‘strncpy’ output truncated before terminating nul copying as many
bytes from a string as its length [-Werror=stringop-truncation]
* bladerf2/params: fix implicit conversion error
/root/bladeRF/host/libraries/libbladeRF/src/board/bladerf2/params.c:437:7:
error: implicit conversion from 'int' to 'int16_t' (aka 'short') changes
value from 32768 to -32768 [-Werror,-Wconstant-conversion]
32768, 0, 0, 0, 0, 0, 0, 0,
^~~~~
* Doxyfile: fix CLANG_ASSISTED_PARSING warning
fixes:
warning: Tag `CLANG_ASSISTED_PARSING' at line 1033 of file
`/root/bladeRF/build/host/libraries/libbladeRF/doc/doxygen/Doxyfile'
belongs to an option that was not enabled at compile time.
To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u", or recompile
doxygen with this feature enabled.
warning: Tag `CLANG_OPTIONS' at line 1041 of file
`/root/bladeRF/build/host/libraries/libbladeRF/doc/doxygen/Doxyfile'
belongs to an option that was not enabled at compile time.
To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u", or recompile
doxygen with this feature enabled.
* libbladeRF: fix doxygen build error
fixes:
/home/rtucker/dev/privatebladeRF/host/libraries/libbladeRF/include/libbladeRF.h:2284:
warning: unable to resolve link to `sync_tx_meta.html' for \link command
* bladeRF-fsk: fix clangscan warning
/root/bladeRF/host/utilities/bladeRF-fsk/c/src/correlator.c:261:59:
warning: The left operand of '/' is a garbage value
corr->ins1->real = corr->ins2->real = samples[i].i/2048.0f;
~~~~~~~~~~~~^
1 warning generated.
* fpga_common/lms.c: fix clangscan warning
/root/bladeRF/fpga_common/src/lms.c:2329:14: warning: 3rd function call
argument is an uninitialized value
status = write_vcocap(dev, base, f->vcocap, vcocap_reg_state);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* test_repeated_stream: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF_test/test_repeated_stream/src/main.c:284:9:
warning: 1st function call argument is an uninitialized value
pthread_join(rx_thread, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* test_interleaver: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF_test/test_interleaver/src/main.c:119:17:
warning: 4th function call argument is an uninitialized value
snprintf((rowstr + rowidx), rowsize - rowidx, "%02x",
*u8buf++);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* test_tx_gmsk_bursts: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF_test/test_timestamps/src/test_tx_gmsk_bursts.c:69:5:
warning: 2nd function call argument is an uninitialized value
printf(" Frequency: %u\n", s->frequency);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* ad9361_api.c: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF/src/driver/thirdparty/adi/ad9361_api.c:445:3: warning: Value stored to 'ret' is never read
ret = -ENODEV;
^ ~~~~~~~
1 warning generated.
* correlator: another attempt to fix clangscan warning
* Revert "fpga_common/lms.c: fix clangscan warning"
This reverts commit 8cbb5f03f0d0927befa5053e9564df06d13ede72.
* test_interleaver: fixup clang-scan warning
some sloppy init, some messy iteration, the usual :)
/root/bladeRF/host/libraries/libbladeRF_test/test_interleaver/src/main.c:124:17:
warning: 4th function call argument is an uninitialized value
* Revert "ad9361_api.c: fix clangscan warning"
This reverts commit 14a7f8f53f84aeff721a752259ca9596a13e3a2a.
* bladeRF-fsk: fixup clang-scan warning fix
* host: docker: clean up the base build process a bit
* host: docker: reduce build context size
We don't need the entire tree (since the _base image has that), so we
can just build from the same dir as the Dockerfile and not transfer
everything to the daemon over and over again.
* host: docker: WIP: script for automated Dockerized testing
* host: docker: use git clean when building base image
* host: docker: add script to automatically freshen base images
* host: docker: auto-detect build dir when testing
* host: docker: build arg for make -j parameter
* host: docker: refactor build script
* host: docker: add parallel run script
* host: docker: adjust make -j settings for builds
* host: docker: test: WIP commit
* host: docker: add usb product check, rfic loopback only for micros
* host: docker: copy the FPGA images from the base
The functions which return ranges, available modes, gain stages, etc, do
not directly access the hardware and should therefore not need locks
around them.