Commit graph

80 commits

Author SHA1 Message Date
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
Rey Tucker
a6a58e5ed6
host: Windows build fixes (#62) 2018-06-01 18:29:02 -04:00
Rey Tucker
87a90c7682 host: libbladeRF_test: fix missing main() return 2018-06-01 16:43:25 -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
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
5023f0cb03
host: fix build errors and clang-scan warnings (#47)
* 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
2018-05-23 12:14:26 -04:00
Rey Tucker
ee55f859b9
host: clean up build warnings across multiple platforms (#21)
With this commit, we build without warnings on Arch Linux; CentOS 7; Debian 8 and 9; latest Fedora; Ubuntu 14.04, 16.04, 17.10, and 18.04; Visual Studio 2017; and macOS 10.13.3 w/ Homebrew.

* host: libbladeRF: compile AD9361 srcs with -std=gnu11

Fixes compile errors involving ‘for’ loop initial declarations only
allowed in C99 or C11 mode, on older GCCs.

* host: libbladeRF/adi: remove stdbool workaround

This is not necessary now that we're building to -std=gnu11, and in
fact, it seems to create a conflict.

* host: libbladeRF: pre-declare loop variables

Some compilers are not happy with declaring the loop variable in the for
statement.  Begrudgingly placate them.

* host: libbladeRF_test: pre-declare loop variables

Some compilers are not happy with declaring the loop variable in the for
statement.  Begrudgingly placate them.

* host: bladeRF-cli: pre-declare loop variables

Some compilers are not happy with declaring the loop variable in the for
statement.  Begrudgingly placate them.

* host: libbladeRF: remove refs to strings.h

Windows doesn't have strings.h, but string.h seems to do just fine.

* host: libbladeRF: fix windows compile errors (WIP)

* host: libbladeRF/ad9361: fix windows compile error

"IGNORE" is #define'd in the Windows environment, creating a conflict.
Renaming this to solve the conflict.

* host: common: add setenv implementation for Windows

* host: libbladeRF: build setenv.c stub on Windows

* host: bladeRF-cli: use setenv stub on Windows

* host: common: fixup spacing consistency in setenv

* host: libbladeRF: cast channel macros to bladerf_channel

Visual Studio is picky about this, and throws warnings.

* host: libbladeRF: bladerf2.c: undo workaround for bladerf_channel

* host: libbladeRF: bladerf_get_gain_stages count type is now size_t

This fixes a Windows compile error, and is also generally more sensible.

* host: bladeRF-cli: fix windows compile errors

* host: ad9361: fix variadic macro syntax

Fixes Windows build errors

* host: ad9361: rename _DEBUG to AD9361_DEBUG

Visual Studio automagically sets _DEBUG if the /MDd option is set. Turns
out that a lot of the debugging sections don't build in Visual Studio,
so this accounts for a large number of the build errors...

* host: libbladeRF: fixes for Visual Studio builds

* host: common: fixes for Visual Studio builds

* host: libbladeRF/ad9361: fixes for Visual Studio builds

* host: libbladeRF_test: fixes for Visual Studio builds

* host: bladeRF-cli: fixes for Visual Studio builds

* host: bladeRF-cli: fix static analysis warnings

Fixes potential memory leak in main

Fixes unused values in set_adf_refclk, set_samplerate

* host: common: fix static analysis warnings

fixes:
unread variable in perform_rx_cal
memory leaks in add_arg, add_opt

* host: libbladeRF: fix static analysis warnings

fixes unused variables in bladerf2_set_gain and xb100_enable
2018-04-03 18:20:51 -04:00
Rey Tucker
f670bedc86 host: test: fix compile errors on test_config_file (#551)
On older compilers, 'for' loop initial declarations are not allowed by
default. So, use the old style for maximum compatibility.

h/t Christophe Devine
2018-03-30 14:05:08 -04:00
Rey Tucker
dc7094abb9 host: libbladeRF_test: win32 fixes for test_config_file (#546)
* host: common: add mkdtemp implementation for Win32

Windows does not have mkdtemp, which is something used by at least one
test case. This is a simple-enough implementation thereof.

* host: common/host_config: add more defs on Win32

chdir, getcwd, rmdir, unlink, and mkdir are all somewhat special on
Win32, so they need special handling.

* host: test_config_file: fix builds on Win32
2018-03-30 14:04:40 -04:00
Rey Tucker
9761a90ec2 host: libbladeRF: Add documentation and test program for config file handling (#539)
* host: libbladeRF: fix typo of "bandwidth" cfg file key

* host: libbladeRF: add documentation for config files

* host: libbladeRF: config.c: minor typo fix

* host: libbladeRF_test: add test case for config file parsing

Creates a surrogate config file with a few different scope restrictions,
then makes sure the configuration is applied appropriately in the end.
2018-03-30 14:01:32 -04:00
Brian Glod
f06679bf78 host: libbladeRF_test: Fix GCC undefined operation
"state->idx = (++state->idx)" is undefined behavior for the compiler
2018-01-15 13:31:24 -05:00
Rey Tucker
1b066d7ca9 host: libbladeRF_test: test_digital_loopback fixes
Make test_digital_loopback work with bladeRF micro

General cleanup/modernization
2018-01-12 18:07:19 -05:00
Rey Tucker
470480d32f host: libbladeRF_test: fix cmake error from merge 2017-12-21 12:55:09 -05:00
Rey Tucker
b3aa319240 interleave: add stub func in bladerf.c for consistency 2017-12-21 12:55:07 -05:00
Rey Tucker
eda91f13aa test_interleaver: formatting, optimization, cleanup 2017-12-21 12:55:07 -05:00
Rey Tucker
0558444a77 WIP: test_interleaver 2017-12-21 12:55:07 -05:00
Rey Tucker
b35c875eb3 test_interleaver: WIP 2017-12-21 12:55:07 -05:00
Rey Tucker
a66afa93ab WIP: add interleaver unit test, move to helpers 2017-12-21 12:55:07 -05:00
Rey Tucker
1b8d5a2917 libbladeRF_test: fix test case broken by consting sync_tx 2017-12-21 12:55:06 -05:00
Vanya A. Sergeev
0c09e664c2 libbladeRF_test: add digital loopback test 2017-12-21 12:55:04 -05:00
Vanya A. Sergeev
bccd7e19f7 libbladeRF: migrate api to 64-bit frequency 2017-12-21 12:54:58 -05:00
Vanya A. Sergeev
562243c80d libbladeRF: refactor codebase for multi-board support
Includes fixups for clean rebase atop bladeRF commit 8b420eb
2017-12-15 18:15:06 -05:00
Robert Ghilduta
dccc4edc2f Filenames are starting to become ambiguous without full pathnames 2017-12-07 17:10:28 -08:00
Petr Vaněk
d847e2d857 libbladeRF_test: Include time.h for compatibility with musl libc 2017-07-05 08:58:17 -07:00
Jon Szymaniak
0f3396bc92 libbladeRF_test: Fixed missing stdbool.h for VS2012 builds 2016-05-01 14:29:18 -04:00
Jon Szymaniak
088f12ba93 libbladeRF: Added LIBBLADERF_API_VERSION
This macro provides API users with a compile-time means to check
the API version. It is intended to help with compile-time feature
detection.
2015-12-30 22:31:16 -05:00
Mathieu Rene
0d55229719 libbladeRF: Added helper function for setting the FPGA's rx_mux
This function provides simpler access to the FPGA's RX mux,
whose settings are controlled by FX3 <-> FPGA GPIOs.
2015-12-09 23:31:16 -05:00
Jon Szymaniak
19c7f7c3a3 libbladeRF_test: Added state output to test_open 2015-11-30 16:55:50 -05:00
Jon Szymaniak
4c749bd316 libbladeRF_test: added test_repeated_stream
This test is intended to exercise repeatedly starting, running,
and stopping RX and TX streams.
2015-11-29 21:53:41 -05:00
Jon Szymaniak
044722f3cb libbladeRF_test: Cleaned up items in test_sync
Replaced macros with those defined in libbladeRF.h

Removed device control lock; this is inherently provided in libbladeRF
API calls.
2015-11-28 13:56:16 -05:00
Jon Szymaniak
d5cecb011c libbladeRF_test: Added functionality to open/close test
Configurable repetitions, a millisecond-granularity delay before
closing, and adjustable log-level have been added to this test.

These changes are intended to verify correct operation after repeated
open/close operations over extended period of time.
2015-11-28 13:42:19 -05:00
Jon Szymaniak
d6da0f75a8 libbladeRF_test: Fixed capitalization typo in header file name 2015-09-08 13:15:55 -04:00
Jon Szymaniak
faa499a80f libbladeRF_test: Keep track of previous frequency for error reporting 2015-08-25 13:28:05 -04:00
Jon Szymaniak
0f5abb4647 libbladeRF_test: Added additional iterations to frequency tuning test 2015-08-25 13:28:05 -04:00
Jon Szymaniak
8157806256 libbladeRF_test: Fixed Windows build issue introduced in baee9616 2015-08-23 23:08:32 -04:00
Jon Szymaniak
1722451524 libbladeRF_test: Fixed unmatched parenthesis
This fixes #420 libbladeRF_test: Build broken for big endian hosts
2015-08-17 08:44:59 -04:00
Jon Szymaniak
baee9616d3 libbladeRF_test: Ensure sufficiently large buffer is used in "rx_gaps"
The buffer length used for calls to bladerf_sync_rx() is now determined
by the test case length, rather than the (unrelated) sync i/f buffer length.

This allows for the use of different sync i/f buffer lengths to be used
via -B.
2015-08-12 12:53:08 -04:00
Jon Szymaniak
42f2d2789f libbladeRF_test: Fixed NULL dereference when test name is unspecified 2015-08-12 11:59:33 -04:00
Jon Szymaniak
60fe9c65e3 libbladeRF: Prepend installation prefix to file search paths
When searching for FPGA bitstreams or other files, we should be
searching locations relative to the installation prefix.

In an effort to avoid breaking existing packaging scripts, the
previously used paths "/usr/share/Nuand/bladeRF" and
"/etc/Nuand/bladeRF" have been kept in the search list, but at a lower
priority than the items with the installation prefix.
2015-07-22 12:06:05 -04:00
Jon Szymaniak
bf9f8a62a4 host: Moved device config helpers to host/common
People may find these useful when developing their own tools or
contributions to the bladeRF codebase.
2015-06-21 23:07:40 -04:00
Jon Szymaniak
8d5f58dfa9 libbladeRF: Fixed MSVC build issues for test_scheduled_retune 2015-06-18 20:20:58 -04:00
Jon Szymaniak
0ea11dc05a libbladeRF_test: Added missing "goto out;" in error path 2015-06-18 18:34:29 -04:00
Jon Szymaniak
c1bd658f52 libbladeRF_test: Fixed retune bugs in scheduled retune test 2015-06-18 18:34:29 -04:00
Jon Szymaniak
81c186ea68 libbladeRF_test: Use wait_for_timestamp, increased iterations 2015-06-18 18:34:29 -04:00
Jon Szymaniak
0789ae9772 libbladeRF_test: Moved wait_for_timestamps() to test_common.c
This will be needed by the scheduled retune test.
2015-06-18 18:34:29 -04:00
Brian Padalino
32c8979ea5 hdl: Timestamp changes to make things work.
Make the time tamer interruption mechanism sensitive to the reset
status of the underlying timestamps.
2015-06-18 18:34:29 -04:00
Jon Szymaniak
e72d989e37 libbladeRF_test: Added both RX/TX to scheduled retune test 2015-06-18 18:34:29 -04:00
Jon Szymaniak
9897d2552e libbladeRF_test: Handle scheduled retune queue filling 2015-06-18 18:34:29 -04:00
Jon Szymaniak
f2e9aa1693 libbladeRF_test: Added scheduled retune test 2015-06-18 18:34:29 -04:00