Commit Graph

615 Commits

Author SHA1 Message Date
Virendra Kakade
ca8d6c9fab examples: Add new rfnoc_nullsource_ce_tx example
- This example will let you tx data from the host to the NullSRcSink
  block on the FPGa design. This is complementary to the
  rfnoc_nullsource_ce_rx example.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2026-10-09 14:51:32 +02:00
Max Becker
3ed25c39c7 host: Complete X4xx GPIO SPI support
Update the X4xx SPI core, radio-control integration, examples, and
tests for transactions up to 64 bits and the revised register map.
2026-09-29 13:12:32 +02:00
Grant Meyerhoff
4eeee62aad examples: optionally wait for Tx EOB on benchmark_rate 2026-09-22 15:13:03 +02:00
Lars Amsel
9e8b5b9553 examples: Fix l-band capture setup
Because X440 images now can also contain DDC/DUC we cannot direct
connect the radio with the replay block anymore. Instead we have
to rely on the uhd.rfnoc util connect_through_blocks function
which will find a route through the statically connected DDC/DUC
if they are present or connect the SEPs directly if they are not.
2026-09-07 17:06:06 +01:00
Virendra Kakade
94fd6241b8 examples: Fix replay capture at coerced sample rates
rfnoc_rx_replay_samples_to_file.py could hang and then abort with
"Timeout while loading replay buffer!" whenever the requested sample
rate was not an integer divisor of the master clock rate. For example,
requesting 200 Msps at an MCR of 368.64 MHz would leave the record
buffer stuck at exactly 50% fullness.

Two problems combined to cause this:

First, the rate was read back from the DDC before the graph was
committed. At that point the DDC's input sample rate property is not
yet valid, so set_output_rate() falls back to setting the output edge
property and returns the uncoerced, requested rate. The example then
reported a rate that the DDC never actually applied.

Second, run_capture() derived the number of samples to request from the
radio with int(radio_rate / rate), truncating instead of rounding. With
a radio rate of 368.64 Msps and a nominal rate of 200 Msps this yielded
a ratio of 1 rather than the decimation the DDC had actually settled on,
so the radio was told to produce only half the samples needed to fill
the record buffer.

The rate is now read back with get_output_rate() after graph.commit(),
when property propagation has completed, and the user is warned when
the requested rate had to be coerced. The rate ratio is computed with
rounding, so the radio is asked for the full number of samples the
record buffer needs.

While here, fix two related issues in the readback path. The DDC port
is now taken from the destination port of the discovered edge rather
than assuming it matches the radio channel index, and the rate is read
per channel (from the DDC where one is present, otherwise from the
radio) so that chains without a DDC are not ignored. Rates are compared
against a tolerance rather than for exact float equality.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2026-09-07 17:03:01 +01:00
Grant Meyerhoff
881f19db7c examples: handle sigint in rx_ascii_art_dft 2026-08-28 16:11:32 +01:00
Max Köhler
4e3912efd8 fpga: fix typo in yml files 2026-08-28 16:09:35 +01:00
Max Becker
f0b4bf59f7 examples: rfnoc-gain: Update OOT example
- Fix target link libraries (UHD::uhd instead of uhd)
- Updated README
  - Better describe the different ways to build the FPGA bitfiles
  - Mention pybind11 requirement
- Add x410 image core to CMakeList to enable using make for this image
2026-08-25 17:40:59 +02:00
Martin Anderseck
44791931c8 host: examples: Add Python SPI example for X4xx
Since with the availability of discoverable features in Python it is
possible to use the front panel SPI of the X4xx series from there, this
example shows how to do this. It is pretty much on par with the C++
version.
2026-08-24 23:12:45 +02:00
Grant Meyerhoff
e0f685a4aa usrp: Add support for USRP B310
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Javier Valenzuela <javier.j.valenzuela@emerson.com>
Co-authored-by: Aki Tomita <aki.tomita@emerson.com>
Co-authored-by: Tony Liecthy <tony.liechty@ni.com>
Co-authored-by: Wade Fife <wade.fife@ettus.com>
2026-08-04 12:00:48 +02:00
Martin Anderseck
1af4625e84 cmake: Enable Ubuntu 26.04
These changes are required to build on Ubuntu 26.04 cleanly while still
maintaining backwards compatibility until Ubuntu 22.04.

- Set CMP0167 to NEW in UHD CMake paths that resolve Boost
- Scope policy changes with guard checks so older CMake versions remain
  compatible
- Ensure dependency resolution order applies policy before Boost
  discovery in package config
- Reduce CMake 3.30+ FindBoost policy warnings without breaking Ubuntu
  22.04-era toolchains
2026-08-03 12:55:00 +02:00
Martin Anderseck
c1b344b732 extension: Fix set_*x_antenna() and update C++
This fixes the segfault when calling into set_*x_antenna() within the
example extension and updates the C++ version to UHD default (20 at the
moment) to be able to build again.
The segfault was caused by the extension example never initializing the
pointers to _*x_antenna. It still doesn't do that but refers to the
radio's setter and getter methods now.
2026-08-03 09:55:38 +02:00
Zsolt Gaál
ddc67b681e examples: Fix cleanup waterfall memory leak in rx_samples_c
This PR fixes a bug in the goto cleanup waterfall within rx_samples_c.

Previously, the free_rx_streamer label was positioned above the
free_rx_metadata label. Because C executes sequentially, if an error
occurred after the metadata was successfully created (for example,
during uhd_usrp_set_rx_rate or uhd_usrp_get_rx_stream), the code would
jump to free_rx_metadata, fall through to free_usrp, and exit. It
completely skipped free_rx_streamer, silently leaking the streamer
memory and leaving the hardware handles dangling.

Changes:

- Reordered the cleanup labels to strictly follow the reverse-chronological
  order of resource creation (Metadata -> Streamer -> USRP).
- Updated the corresponding EXECUTE_OR_GOTO jump targets for the stream
  setup functions to match the new waterfall order.
2026-07-28 09:23:21 +02:00
Martin Braun
26ad48ba65 examples: rfnoc-gain: Remove IN_TREE_IP option
This removes the option to use IP in-tree, because the IP in use is not
useful for UHD overall, and it doesn't have much utility for the example
either. By removing it from the example, we allow for the IP to be
deleted.
2026-07-20 09:15:44 +02:00
Jörg Hofrichter
8750331ba2 host: examples: correct port configuration in one example
Correct replay block port configuration in the example
rfnoc_rx_replay_samples_to_file.py.
2026-07-01 09:58:11 +02:00
Lars Amsel
b9e4dd5959 host: fix line endings
rfnoc_rx_replay_samples_to_file.py had Windows (CRLF) line endings.
Therefore shebang did not work. Fixed line endings with dos2unix.
2026-07-01 09:56:26 +02:00
Martin Braun
28c4690cae examples: Deboostify twinrx_freq_hopping
This replaces all usage of Boost.Thread, Boost.Posix_Time, and
Boost.Format with standard C++ constructs.
2026-06-10 10:05:25 +02:00
Martin Braun
675baa5387 uhd: Remove more superfluous includes
- Mostly boost includes
- In some cases, trivial boost::format() calls were removed to enable
  removing the corresponding header
2026-06-10 08:34:02 +02:00
Martin Anderseck
40d6cf61aa doc: Fix documentation for Doxygen
This fixes many documentation issues where in the Doxygen output
sentences were incomplete and information was missing that is there in
the source files actually.
2026-05-07 14:58:01 +02:00
Martin Braun
6517c0e0d3 examples: Remove boost::thread_group usage
This helps with removing boost::thread usage from UHD overall. The
functionality of the examples is not affected.
2026-04-24 10:42:40 +02:00
Martin Braun
484e8dd269 rfnoc newmod: Apply Windows and Python fixes
These changes enable usage of OOT modules on Windows, and also fixes
issues with Python usage of OOT modules on all platforms. Note that
existing OOT modules will need to apply these patches manually.

These changes are backported from rfnoc-oot-blocks. The following fixes
are included:

- We require UHD 4.9 so that we can use the UHD::uhd target for linking
  instead of using the older-style ${UHD_LIBRARIES}. This fixes some
  linker issues.
- The symbol export macro name is fixed (missing "DLL")
- The Python module is explicitly linked against the OOT DLL
- The Python module forces a loading of the UHD Python module, which
  helps resolve RTTI and allows blocks to be declared descendents of
  noc_block_base.
- RFNoC OOTs with a module name that contains a hyphen (like
  "oot-blocks") are now correctly generated (macro names, e.g., should
  include the string OOT_BLOCKS in this case)
- We can provide a Pybind11 path, which is helpful on Windows, because
  unlike UHD, OOTs don't carry their vendored version of that library.

Co-authored-by: Wade Fife <wade.fife@emerson.com>
2026-04-19 14:20:45 +02:00
Niels Garibaldi
bfed161608 example: gain: Fixed rx actual rate printout
Added missing Msps conversion for actual rx sampling rate print in
the rfnoc oot gain block example.
Also applied ni-python-styleguide changes for import order.
2026-04-03 01:06:15 +02:00
Martin Anderseck
7ae91bdf27 host: examples: Fix duration arg in tx_waveforms
This commit aligns the documented and the actual default value for the
waveform duration and corrects the value to pass for infinite playback
to be 0. With duration = -1 it would stop with an error immediately.
2026-03-26 21:08:18 +01:00
Marian Koop
7ba8fbf584 python: Remove obsolete license classifiers and update license field
Removed deprecated 'license classifiers' and updated license field with
valid SPDX license expression to to comply with Python packaging standards
(PEP 639).
2026-03-24 11:37:20 +01:00
Martin Braun
b3cc2becb6 uhd: Remove usage of boost::lexical_cast
This can be completely replaced with uhd::cast::to_str() and from_str().
In some cases, the UHD typecast functions are better, because they
support more UHD-specific types (e.g., device_addr_t, subdev_spec_t, and
so on).
2026-03-23 09:58:28 +01:00
Martin Braun
5c4034c60c rfnoc: oot: Remove make_args_t destructors
noc_block_base::make_args_t used to be partially declared, requiring OOT
tests to implement a destructor for make_args_t so that its unique_ptr
type would not fail to compile.

However, make_args_t was declared deprecated and made entirely opaque.
UHD has a dummy make_args_t to allow existing OOTs to compile, but we
update the OOT structure (both the template for new OOTs, and
rfnoc-gain) to reflect the new changes.
2026-02-13 15:46:18 +01:00
Jörg Hofrichter
9ac8e13e3e examples: rfnoc-gain: add connections for front-panel GPIO 2026-01-13 12:38:50 +01:00
Martin Braun
fd5687b7ba rfnoc-gain: Preload librfnoc-gain.so for unit tests
This makes use of the MODULE_PATH argument in UHD_ADD_TEST() to preload
the correct DLL for testing out-of-tree modules.
2025-12-19 13:09:26 +01:00
Jörg Hofrichter
edfd80627d examples: gpio: fix nr. of loopback bits
The recommended loopback cabling requires wiring the lower half
of the GPIO pins to the upper half of the GPIO pins. This means
that the number of loopback bits needs to be half of the total
number of GPIO pins.

Example for 12 bits:

GPIO 0 --> 6
GPIO 1 --> 7
GPIO 2 --> 8
GPIO 3 --> 9
GPIO 4 --> 10
GPIO 5 --> 11
2025-12-17 13:45:14 +01:00
Jörg Hofrichter
4179e1e74f examples: gpio: Add argument --offset
With the argument --offset, the first bit which is used
for testing can be configured.
2025-12-17 13:45:14 +01:00
Andre Zoch
d711409233 examples: Reworked example and updated documentation
- Behavioral changes:
  - Fixed check for LO Lock detect
  - Added option --type to configure output file data type
  - Added option --pps to allow to synchronize multiple USRPs to
    an external time reference
  - Replaced --tx-args and --rx-args by --args such that there
    is just one multi_usrp instance to simplify multi USRP time
    alignment (use the multi_usrp time alignment mechanism with no extra code)
  - Reworked timing: all timed actions relate to start of TX streamer
  - Extended capabilities to schedule TX/RX complex gains to also support
    multiple gain adjustmens per channel at different delays
- Documentation:
  - added program documentation
  - added more examples on program usage
  - updated documentation for program options
2025-12-15 16:27:57 +01:00
Andre Zoch
396edd91bf examples: Added continuous streaming to tx_samples_from_file.cpp
Changes in behavior when called with --repeat and --delay 0:

- Open file once and reuse file buffer for each repeated transmission,
  avoiding repeated open/close operations.
- For continuous operation (--repeat with --delay 0), do not set the
  end_of_burst flag in the metadata after each buffer transmission,
  enabling uninterrupted RF output.
2025-12-10 13:04:02 +01:00
Max Köhler
dc6f81c669 examples: fix channels default value 2025-12-08 17:45:30 +01:00
Andre Zoch
51879c15f6 example: Fixed check for LO lock on configured channels
Before this change, the check was always done on channel 0.
2025-12-04 11:59:10 +01:00
azoch
e90a2aaff6 example: cpp: Enhanced documentation for selected examples
- Added program documentation string including program
  usage examples.
- Made individual option descriptions more descriptive.
- Examples touched:
    - benchmark_rate.cpp
    - latency_test.cpp
    - test_messages.cpp
    - test_timed_commands.cpp
    - tx_bursts.cpp
2025-12-04 09:06:22 +01:00
Meghana Halladamath
73022fb6d7 examples: Complex gain example using multi_usrp
host: lib: Extend multi_usrp API to fetch TX & RX block channel
2025-12-03 16:41:01 +01:00
Martin Braun
8e9790d51d uhd: Replace boost::filesystem with with std::filesystem
- In most cases, the replacements are straightforward:
  boost::filesystem::* can be often simply replaced by
  std::filesystem::*, and the include path is changed from
  <boost/filesystem.hpp> to <filesystem>
- boost::filesystem::system_complete() is replaced with
  std::filesystem::absolute().
- Note: For users including uhd/utils/paths.hpp, this is an API change
  because the return value of get_module_paths() is now a vector of
  std::filesystem::path.
- In rx_samples_to_file and fx2_init_eeprom, we keep Boost.Filesystem
  for now because there is no direct equivalent to
  boost::filesystem::unique_path(), but the main goal is to remove
  libboost_filesystem as a link dependency from libuhd.
2025-12-03 15:21:59 +01:00
Andre Zoch
fbc5ad9eb0 example: cpp: Enhanced documentation for rfnoc_* examples
- Added program documentation string.
- Marked required options as required().
- Added short option strings for required options.
- Made individual option descriptions more descriptive.
- Harmonized naming of options where appropriate.
  Introduced alias options for renamed options to keep
  backward compatibility.
2025-11-18 13:26:26 +01:00
Andre Zoch
981d2d41e1 example: cpp: Enhanced doc for txrx_loopback_to_file.cpp example
- Added program documentation string.
- Marked required options as required().
- Made individual option descriptions more descriptive.
- Harmonized naming of options: renamed ampl into wave-ampl.
2025-11-18 13:26:16 +01:00
Andre Zoch
2304dd21d8 example: cpp: Enhanced documentation for rx_* examples
- Added program documentation string.
- Marked required options as required().
- Added short option strings for required options.
- Made individual option descriptions more descriptive.
- Harmonized naming of options where appropriate.
  Kept old option names as alias options not getting printed by --help.
2025-11-18 13:26:05 +01:00
azoch
ac0cd1d4df example: cpp: Enhanced documentation for tx_* examples
- Added program documentation string.
- Marked required options as required().
- Added short option strings for required options.
- Made individual option descriptions more descriptive.
- Harmonized naming of options where appropriate.
2025-11-03 17:01:29 +01:00
Lars Amsel
192b3b24f0 Host: Examples: Add error check for open failures
If open output file failed (e.g. missing permission) this was not
tracked and the C rx example crashed when try to write to the
empty file descriptor. This checks the result of fopen and prints
the str error of the failure for graceful exit.
2025-10-24 10:48:38 +02:00
azoch
585c502c53 example: Enhanced tx_waveform.cpp documentation
- Added program documentation string.
- Marked required options as required().
- Added short option strings for required options.
- Made individual option descriptions more descriptive.
2025-10-06 11:34:58 +02:00
Martin Braun
dd75d354e7 rfnoc_modtool: Fix package_data for rfnoc-newmod
This fixes an issue with the installation of OOT modules in venvs.
2025-09-26 10:37:09 +02:00
Martin Braun
5f73667284 host/firmware/tools: Update minimum CMake versions
Various sub-projects around the UHD repository specify their own minimum
CMake versions (independent of UHD). We modify the minimum CMake
versions in the following way:

- All CMake files under firmware/ are bumped from 2.6 to 3.5. This is to
  allow newer CMake versions to work with these files (CMake 4 and
  beyond do no longer work if the minimum version is below 3.5). However,
  note that these CMake files are so simple they will keep working with
  older CMake versions, but that will require manually demoting the
  minimum version. Because more people are using CMake versions newer
  than 3.5 (especially with recent checkouts of UHD), this seems the
  more compatible solution.
- The CMake files for extension_example and init_usrp are bumped to
  3.12. This matches the version that UHD uses, which increases
  compatibility.
2025-09-24 13:48:07 +02:00
Martin Braun
2536c29282 examples: init_usrp: Make use of UHD::uhd target 2025-09-24 11:35:24 +02:00
Martin Braun
db95a49e76 examples: Reduce Boost footprint in init_usrp
- Remove system and thread as a required component (UHD might need those,
  but init_usrp does not and CMake should take care of linker flags
  originating from UHD)
- Remove gratuitous usage of boost::format
2025-09-24 11:35:07 +02:00
Martin Braun
402f3d6f4e cmake: More specifically reference linking dependencies
- Instead of blindly linking against all ${Boost_LIBRARIES}, we
  selectively specify the various Boost::* targets.
- Replace include_directories() or link_directories() with target_*()
  CMake functions to avoid cluttering global scope.
- Specify PRIVATE vs. PUBLIC on all link targets.
2025-09-17 12:56:05 +02:00
Martin Braun
886c076933 examples: Fix shebang in tx_waveforms.py 2025-08-28 16:58:09 +02:00
mhallada-NI
4e861c4085 example: Fixed order of import in rfnoc_gain example 2025-08-22 15:32:23 +02:00