Commit graph

547 commits

Author SHA1 Message Date
Martin Braun
d5a7285bf6 utils: Remove usrp_e3x0_network_mode
This was removed from CMake ages ago, and hasn't been built in years. It
also no longer compiles. And since we do MPM on E310, it is also
completely pointless.
2022-06-03 05:07:57 -07:00
mattprost
abd4ca42e7 utils: uhd_images_downloader: Increase default image download size limit
Prompt users for download confirmation of files larger than 1 GiB
instead of 100 MiB. Improve messaging to make this process less
concerning for users. The defined limit is only for the user's
convenience. A 1 GiB limit should allow users to download most uhd
images and related files without being prompted.

Signed-off-by: mattprost <matt.prost@ni.com>
2022-05-06 06:48:27 -07:00
Wade Fife
45021a51c1 utils: uhd_images_downloader: Print name of file that exceeds limit
When a file exceeds the download limit, print the name of the file in
the message that asks if we want to continue downloading.
2022-04-29 06:07:50 -07:00
Martin Braun
8ffa21074c utils: uhd_usrp_probe: Add DB rev to output
When running uhd_usrp_probe, this adds the daughterboard revision if
available:

```
|     _____________________________________________________
|    /
|   |       RX Dboard: 0/Radio#0
|   |   ID: TwinRX Rev C (0x0095)
|   |   Serial: ABC1234
|   |   Revision: 4
```
2022-04-27 09:45:40 -07:00
Martin Braun
7d055cbfbc utils: x300_reset: Make py3k-ready 2022-04-26 12:27:54 -07:00
Lars Amsel
99ad89609b tools: Add general purpose tool for USRP configuration
Over the years the UHD code base got a whole bunch of tools to
control and configure devices. This is an attempt to unify these
tools into one.

Co-authored-by: Alexander Weber <alexander.weber@ni.com>
2022-03-23 16:27:04 -05:00
Wade Fife
30a9cc14bb utils: Fix comment in noc_shell Mako template 2022-03-04 09:42:39 -06:00
Rick Farina (Zero_Chaos)
b170ec5d75 cmake: ncurses: fix building with split tinfo
This fixes an issue where tinfo and ncurses are split into separate
libraries.
2022-02-24 13:33:39 -06:00
Wade Fife
597e1a538c utils: Add space to rfnoc_image_builder help 2022-02-07 13:08:11 -07:00
Aaron Rossetto
c69c7626c2 python: Use setup from setuptools
This commit replaces the use of setup() from distutils.core with setup()
from setuptools.
2022-01-14 14:36:39 -06:00
Martin Braun
e46a6fdd21 uhd: Fix RFNoC-capable detection in uhd_usrp_probe
For RFNoC devices, it now displays "RFNoC capable: Yes", like it did in
UHD 3.
2021-12-16 09:20:01 -06:00
Wade Fife
270a7e13c3 rfnoc: Fix noc_shell direction comments
Some comments describing data flow direction were wrong. This commit
updates the Mako files and updates the noc_shell modules with newly
generated versions.
2021-12-08 08:36:46 -06:00
A. Maitland Bottoms
f665c585ee responder: Fix printw function arguments
This is necessary when compiling with -Werror=format-security as Debian
package builds do.

Thanks to mait for the fix!
2021-10-22 06:35:44 -07:00
A. Maitland Bottoms
81ac62f791 uhd: Fix spelling errors
Thanks to Mait for pointing these out!
2021-10-22 06:35:44 -07:00
Wade Fife
3d7d5668fb rfnoc: Add vivado-path to rfnoc_image_builder
Adds a --vivado-path option to rfnoc_image_builder that, if present,
gets passed to setupenv.sh for the target device. This can be used to
specify the location of Vivado if it is not installed in one of the
default search locations.
2021-09-10 15:07:05 -05:00
Aaron Rossetto
cd0adcd43a cal: Use safe version of set_thread_priority()
The calibration utilities attempt to bump the transmit thread priority to
realtime to prevent underruns. However, on platforms that use pthread,
`pthread_setschedparam()` typically requires elevated privileges. When
called without those privileges, the code path throws an exception that
is left unhandled, thus terminating the process with an unhelpful error
message.

This commit changes the thread priority function call to use a safe
version which catches any exceptions thrown by `pthread_setschedparam()`
and prints a much more instructive error message without terminating the
process. This gives the user a fighting chance to correct the issue and
successfully use the calibration utilities.
2021-08-04 06:56:39 -05:00
mattprost
4e2d3a0aba utils: Get signal above noise floor when finding optimal gain
Ensure that the signal is at least visible above the noise floor before
attempting to identify gain compression. Another option that was
considered involved starting from the top of the gain range and working
down to avoid this issue, however, that option could expose the device
to unsafe amounts of incoming signal power.

Signed-off-by: mattprost <matt.prost@ni.com>
2021-07-20 07:20:30 -05:00
Martin Braun
8708164ac8 cal: Add tune-settling time
This is a device-specific parameter to allow for the tune to settle
before proceeding with the calibration. On X410, we set this time to 500
ms. On other devices, we leave it at 0.
2021-06-24 12:05:49 -05:00
Lars Amsel
9281d34fd1 cal: Add X410 internal antenna names to invalid antenna list
Added CAL_LOOPBACK and TERMINATION to invalid antenna list
2021-06-23 13:57:15 -05:00
Lars Amsel
9958558c2f cal: make 'calibrate all channels' default for --channels argument 2021-06-23 13:57:15 -05:00
Lars Amsel
2a575bf9b5 uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
2021-06-10 12:01:53 -05:00
Martin Braun
a04e0c2d30 cal: Fix minor issues in the calibration utilities
- Whitespace issues
- Unclear help messages
- Unnecessary derive-from-object
2021-06-10 08:12:45 -05:00
Wade Fife
4ac80a4312 rfnoc: Add image_core_name option to rfnoc_image_builder
This change adds the ability to specify in the YAML description for
your RFNoC image what the rfnoc_image_core should be named. This allows
you to have multiple RFNoC image cores generated for the same target.
2021-06-02 22:00:40 -07:00
Lane Kolbly
b31a3c2471 host: utils: Print block ID for RFNoC dboards
Previously, uhd_usrp_probe would simply print "RX Dboard: dboard"
as the header for RFNoC dboards. This was not very informative,
so this change prints out the block ID to get a little bit more
information.

Non-RFNoC dboards retain their old functionality.
2021-05-03 09:06:06 -05:00
michael-west
1488781b09 utils: Improve cal TX threads
Increase thread priority on TX thread and remove memory copy to reduce
underruns.

Signed-off-by: michael-west <michael.west@ettus.com>
2021-04-29 15:12:05 -05:00
michael-west
65617b2f67 N320: Fix calibrations
Added "n320" to supported devices and set TX and RX sample rates to
12.288 Msps.

Signed-off-by: michael-west <michael.west@ettus.com>
2021-04-22 15:11:24 -05:00
Steven Koo
9aafc0ace2 uhd: enable vcpkg support on windows
vcpkg can be used for the Windows C++ dependencies for uhd with this commit.

To use vcpkg on Windows:
1) Copy the custom triplets in host/cmake/vcpkg/ to the vcpkg/triplets/ folder.
2) Install boost and libusb for the custom triplet

"vcpkg install libusb:uhd-x64-windows-static-md boost:uhd-x64-windows-static-md"

3) Call CMake with vcpkg toolchain file flags:
-DVCPKG_TARGET_TRIPLET=uhd-x64-windows-static-md
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALL_DIR%/scripts/buildsystems/vcpkg.cmake
-G "Visual Studio 16 2019" -A x64

Replace the -G with the installed version of Visual Studio and matching
architecture. Then build normally by running vcvarsall.bat and msbuild.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2021-03-19 15:40:09 -05:00
Martin Braun
47623aabb4 lib: Use const-ref in for loops instead of const-copy
This is potentially a performance issue, even though it doesn't have
a big impact in this context. Clang will warn about it, and this fixes
the compiler warning.
2021-03-04 08:24:09 -06:00
Martin Braun
69665ba47e utils: Remove unused constant from b2xx_fx3_utils
This reduces compiler warnings.
2021-03-04 08:18:41 -06:00
Martin Braun
107a49c0c2 host: Update code base using clang-tidy
The checks from the new clang-tidy file are applied to the source tree
using:

$ find . -name "*.cpp" | sort -u | xargs \
    --max-procs 8 --max-args 1 clang-tidy --format-style=file \
    --fix -p /path/to/compile_commands.json
2021-03-04 08:07:26 -06:00
Markus Unger
cb68d724e6 utils: Fix GUI argument in rfnoc_image_builder 2020-11-16 14:52:13 -06:00
Lane Kolbly
0167ad7608 uhd_images_downloader: Add environment variable for http auth
This allows the image downloader to download files from restricted sources
using HTTP basic auth, specifying the credentials in the UHD_IMAGES_USER and
UHD_IMAGES_PASSWORD environment variables:
```
UHD_IMAGES_USER=lane UHD_IMAGES_PASSWORD=MyS3cretPassword uhd_images_downloader.py
```
2020-10-15 16:00:54 -05:00
Lane Kolbly
c484b79a76 uhd_images_downloader: Remove unused default_no parameter
This parameter isn't used by any callers of the function. Additionally,
it doesn't actually change the default answer.
2020-10-15 16:00:54 -05:00
michael-west
82e392442c utils: Improve NMEA string output
Separated output of GPGGA and GPRMC strings into separate try/catch so
each one would display independently.  Resolves issue of GPGGA string
not displaying on devices that don't support the GPRMC string.

Also removed unnecessary uses of boost::format.

Signed-off-by: michael-west <michael.west@ettus.com>
2020-10-12 16:19:15 -05:00
Wade Fife
b5fad9cf0b utils: Set rfnoc_create_verilog.py as executable 2020-10-09 12:29:42 -05:00
michael-west
49f230a8a3 utils: b2xx_fx3_utils: Add unload-bootloader
Added unload-bootloader option to cleanly unload a previously loaded
bootloader image.  It properly moves the VID, PID, and EEPROM data.

Signed-off-by: michael-west <michael.west@ettus.com>
2020-08-25 07:28:22 -05:00
Martin Braun
0d273bfe0c tests: fbs test: Fix issues around missing git
- update_fbs.py would use git directly, instead of the requested git
  executable
- There are other corner cases for the git executable detection, which
  are now all captured under a more general exception type

Credit to Christopher Friedt for pointing out the original issue.
2020-08-25 07:10:53 -05:00
michael-west
2a8ba91c1b NI-2974: Add cal support
Signed-off-by: michael-west <michael.west@ettus.com>
2020-08-19 17:50:21 -05:00
Martin Braun
86ab211b84 python: power cal: Minor fixes to power cal code
- Fix some typos
- Fix incorrect arg name for RFSGPowerGenerator.enable()
- Fix case where incorrect args would cause an uncaught TypeError. Now,
  if USRP is chose as signal generator, but fails to find one, a proper
  error is shown.
2020-08-17 16:23:46 -05:00
Wade Fife
de8b6fcd71 python: Change default name for rfnoc_image_core
This changes the default name of the image core file to
<DEVICE>_rfnoc_image_core.v instead of naming it after the YAML file.
This ensures that when you use a custom YAML file, the resulting
FPGA build will use the generated rfnoc_image_core and static_router
files, rather than just the generated static_router file.
2020-08-10 15:18:46 -05:00
Derek Kozel
7e27726aa7 utils: Make uhd_config_info print help by default 2020-07-09 09:54:32 -07:00
Lars Amsel
2c8e79c92f test: Use git hashes to verify flatbuffers schema
Each version of flatbuffers (might) generate different header files
for the same schema file. Therefore we cannot compare the content
of the generated headers to detect changes in the schema that are
not accompanied by a change in the generated header.

To have at least a minimal check that the schema matches the
generated header we compare the git hashes of both. We will not
allow to change the schema without changing the header and vice
versa. This condition is checked by a unit test.
2020-06-23 12:36:57 -05:00
Martin Braun
72c9bb367d utils: update_fbs.py: Minor refactor, fix path bug
- The UHD auto-detection was broken. Now it can find UHD in the same
  directory.
- The main() function was split into main() and run(), which would allow
  loading this module and calling run() as it's own function.
2020-06-22 14:38:12 -05:00
Steve Czabaniuk
aad2ccfa7c utils: Make uhd_images_downloader raise warning for invalid paths
This makes the utility warn the user when they pass a path argument that
is invalid; the utility falls back to defaults if this occurs.
2020-06-22 14:37:24 -05:00
Lars Amsel
eeae393ad4 cal: Add automated port switch
Current implementation needed manual interaction to calibrate each
antenna. More sophisticated setups are able to switch between channels
and antennas programmatically.

This commit introduces a base class that handle the switch behaviour. The
previous implementation moved to a ManualSwitch class which is the
default switch. Without any options the previous flow remains unchanged.

A new class is able to handle NI switch models. The switch port can
be given via options parameter (comA is default). The channels are connected
in ascending order. The user has to ensure that the cable setup matches
the order given for channels and antennas.

Co-authored-by: Martin Braun <martin.braun@ettus.com>
2020-06-17 14:19:26 -05:00
Wade Fife
47fa25769d utils: Make fpga-dir arg optional for rfnoc_image_builder 2020-06-05 10:29:39 -05:00
Martin Braun
65fbf053c0 utils/python: Add uhd_power_cal script
This is a tool for running power calibration.
2020-05-28 15:05:19 -05:00
Martin Braun
0930913093 utils: Let uhd_images_downloader also use HTTPS proxies
This complements b721621. In that commit, we directly go to HTTPS, but
in either case (direct or indirect) the --http-proxy command line
argument did not use the proxy for https.
2020-05-27 09:44:40 -05:00
Martin Braun
e61ca590c9 utils: Fix FPGA search in rfnoc_image_builder from fpga-src to fpga
When the FPGA repository was merged back into the UHD repository, this
line was forgotten.
2020-05-20 12:41:25 -05:00
Martin Braun
b5232b8e3f utils: Fix usrp_burn_db_eeprom w.r.t. new property tree paths
usrp_burn_db_eeprom operates directly on property tree paths, and so the
utility required an update to work with RFNoC devices.
2020-05-15 15:15:23 -05:00