Commit Graph

108 Commits

Author SHA1 Message Date
Martin Braun
30aab2a4c7 lib: Add missing include
Adds missing <string> to ltc5594.hpp.
2026-10-13 12:41:50 +02:00
Martin Anderseck
eab0f7fe89 hbx: Fix LTC freq lookup logic
Previously the logic for the LTC5594 configuration was wrong. We
sometimes fell back into the default case which then didn't choose the
default but the first row in our lookup table. The default value was now
moved into an own constant and the lookup logic is now inverted to be
correct.
2026-10-13 12:41:50 +02:00
Max Köhler
f9ab8f3aae host: x4xx: update default wait time for NCO reset 2026-10-08 09:31:17 +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
Grant Meyerhoff
433f82bf5c common: add implementation for ina231 monitor 2026-07-17 14:24:04 +02:00
Grant Meyerhoff
c01eda1eb5 common: add support for UBLOX communication 2026-07-17 13:46:44 +02:00
Grant Meyerhoff
a9c812453a common: add c++ support for lmk05318 2026-07-16 13:00:41 +02:00
Grant Meyerhoff
494b40b491 common: add c++ support for lmk04832 2026-07-16 12:57:44 +02:00
Abhishek Verma
e1284c724b host: fix missing db_idx to sample/pcr rate rpc calls
GetDboardSampleRate and GetDboardSampleRate rpc methods are not
dispatching per dboard because of missing db_idx field in the proto
definition. This means rpc is setting these rates for only single
dboard.

This change fixes dboard based dispatching for these rpc methods
from host client.
2026-07-15 13:22:24 +02:00
Abhishek Verma
e24b1cb8bb host/mpm: replace mpRPC with gRPC transport
host:
Replace the msgpack-RPC (rpclib) client with a gRPC-based
implementation. Add auto-generated C++ client and Python bindings
from protobuf definitions. Remove rpclib dependency and integrate
FindgRPC into CMake.

mpm:
Replace the msgpack-RPC server with a gRPC server generated from
protobuf definitions. Add pb_utils.py for type conversion between
Python and protobuf. Update rpc_server.py to dispatch calls via
gRPC stubs. Update mpm_shell to use gRPC. Replace pyudev with sysfs
scan in uio device discovery.

Bump MPM compatibility number to 7.0 and RPC version to 2.

This change requires new depedencies. E.g. for Ubuntu 24.04 or 25.10:
libgrpc++-dev, libprotobuf-dev, protobuf-compiler-grpc, python3-grpcio
2026-07-09 12:12:04 +02:00
Martin Braun
5e7de7c5f1 mpmd: propagate mb_idx to dependent classes and update per-board logging
- Add mb_idx parameter to mpmd_mb_iface constructor and store _mb_index and _log_id
- Update all mpmd_mb_iface logging to use per-board log IDs (MPMD#N)
- Add mb_idx parameter to mpmd_mb_controller constructor and store _mb_index and _log_id
- Update all mpmd_mb_controller logging to use per-board log IDs (MPMD#N)
- Pass mb_idx when creating mpmd_mb_iface and mpmd_mb_controller instances
- Now all three levels of MPMD initialization use indexed logging for parallel visibility
2026-07-02 13:13:24 +02:00
Martin Braun
6cb25a298b lib: x400: Add fail-flag APIs to RFDC control
Two new APIs are added to x400_rfdc_control:
- get_nco_good(): Combines the reset and FAIL flags into a single "good"
  value
- get_nco_no_fail(): Provides information on the current status of the
  NCO reset FAIL flag
2026-06-22 13:42:30 +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
3eb6fe492a uhd: Remove usage of boost::optional
- boost::optional is replaced by std::optional
- In public APIs, boost::optional is still usable, but it is declared
  deprecated. That means this is no API break (but it is an ABI break).
- Within the library portion (host/lib/**) there is no more usage of
  boost::optional. Some backward-compatibility code (in actions.cpp and
  ctrlport_endpoint.cpp) was moved out to the header.

Note: The most difficult replacement was that for
parse_log_level_from_string(), where boost::optional is the return
value. To retain API compatibility, we had to create a helper function.
2026-05-05 14:41:39 +02:00
Martin Anderseck
3293d06bc4 host: hbx: Improve log IDs
This improves the logging IDs of files related to HBX. It adds the radio
as prefix to the logging ID to make it easier to recognize which
component wrote a log message as we typically have (at least) two in a
UHD session. Improved behavior for ADMV1320, ADMV1420, LTC5594
(demodulator) and for the TX and RX LOs.
2026-04-02 17:43:37 +02:00
Martin Anderseck
384bacb3eb host: hbx: Fix cornercases of IQ DC compensation
This fixes some of the cornercases that could occur in the IQ DC offset
compensation:
1. If the frequency was set via the property tree, the compensation
   would not work at all as it was previously triggered by the API
method.
2. Because of the same fact, there was no compensation if one measured
   directly in the default frequency of 1 GHz without tuning away and
tuning back.
3. If only a partial compensation was done before and coefficients were
   thus only available for some frequencies, no compensation was applied
for the lowest of these frequencies and below if the ADC self-cal was
run in the beginning of the session and it was never tuned close to a
frequency close to a higher compensation point.
4. There was a workaround in the code for this already but that led to
double calls to the FPGA for setting the coefficients during a retune.
5. The IQ cal script used to have the wrong unit in the progressbar and
   some enumerate() leftovers which were not necessary anymore.

All of these issues are resolved with this.
2026-03-23 09:59:32 +01:00
Martin Anderseck
df31d13cbc uhd: Add support for USRP X420 (20 GHz USRP)
This adds support for the new USRP X420. It is the latest addition to
our X4xx series and comes with two HBX daughterboards. The HBX is
a one-channel direct conversion transceiver that covers 5G NR FR3 and
X-/KU-Band needs for Research and Prototyping in a frequency range of 10
MHz up to 20 GHz. It supports analog bandwidths of up to 1 GHz.

This commit is the UHD/host portion of the X420 support.

Co-authored-by: Martin Anderseck <martin.anderseck@emerson.com>
Co-authored-by: Ahmed Salman <ahmed.salman@emerson.com>
Co-authored-by: Max Köhler <max.koehler@emerson.com>
Co-authored-by: Markus Schill <markus.schill@emerson.com>
2026-03-20 16:14:54 +01:00
Martin Anderseck
5165c21740 host: x4xx: Enable sub-channels
This is the host-side counterpart for the new sub-channels in MPM. It
introduces the mode argument for many RPC calls to distinguish between
Real, I and Q sub-channels within one channel. Furthermore it updates
the ADC self-cal to calibrate all sub-channels within one logical
channel.
2026-03-09 16:13:22 +01:00
Martin Anderseck
9b20a43a01 host: Move ZBX LO power out of LO driver
This removes the ZBX LO power from the LMX2572 driver to clean the LMX
driver from specifics that come from its users. The LO power setting now
takes place in the gluelayer between the ZBX driver and the LMX driver
(zbx_lo_ctrl).
2025-12-05 15:22:07 +01:00
Martin Braun
daaf1ef1e1 lib: Remove gratuitous Boost references
Several files in UHD include headers or reference namespaces from Boost
without using them. We clear those out for a better view of how much
Boost is left in UHD.
2025-10-01 13:44:59 +02:00
Friedrich Wenisch
ac836b35a3 host: x4xx: Fix NCO reset 2025-07-17 08:23:56 +02:00
Grant Meyerhoff
4a4eb8f816 python: add support for max287x for debug panels 2025-06-13 08:23:18 +02:00
Grant Meyerhoff
5ce0fe0bc7 common: add tmp468 sensor 2025-06-10 17:53:54 +02:00
Lars Amsel
d370974bc1 host: add semicolon to UHD_SAFE_CALL
UHD_SAFE_CALL macro had no semicolon after the code part. This
force the code using the macro to write something like

    UHD_SAFE_CALL(some_func(););

which looks bit awkward. Adding a semicolon to allow writing
on liners like

    UHD_SAFE_CALL(some_func());

Multi line code could still use a semicolon after the last
statement, as the compiler does not bother about double semicolon.
2025-03-14 12:57:58 +01:00
Martin Braun
3909512623 lib: Replace uhd::math::gcd,lcm with std::gcd,lcm
This became possible with the new dependency on C++17, which added std::
gcm() and std::lcm(). The standard library has some advantages over our
version (e.g., constexpr) but most importantly, it allows us to remove
the (version dependent!) Boost dependency in math.hpp.

This breaks the public API: `uhd::math::{gcd,lcm}` were defined in the
public header uhd/utils/math.hpp.
2025-02-07 11:00:36 +01:00
Grant Meyerhoff
c238898383 max287x: allow for output port selection during set frequency
Previously Max287x assumed RFOUT (RFOUTA) port for output, and automatically enabled output from this port when setting the frequency of the chip. This allows for output selection of AUX_OUT (RFOUTB) instead during set_frequency.

This also adds a function to set the output enable for RF_OUT mirroring the added function for AUX_OUT, so that output enable is not solely controlled by setting frequency.
2024-07-25 12:49:22 +02:00
Martin Braun
de4fc11ef1 include: Apply include-what-you-need on include files
This is a combination of running include-what-you-need for clang14 on
the files in host/include with a manual vetting process.

As these are exposed header files, this seems like the most valuable are
to fix missing includes.

The manual vetting process consists of:
- Making sure iwyu uses <> includes consistently with our codebase (it
  sometimes uses "" includes instead)
- For boost includes, do the "normal" inclusion (e.g., include
  boost/optional.hpp instead of just all the individual sub-includes
  that are required) for better cross-Boost-version compatibility
- Prefer cstddef over stddef.h
2024-07-11 12:47:43 +02:00
Grant Meyerhoff
7b47096d7a host: clang-format changes 2024-05-17 21:41:56 +02:00
Grant Meyerhoff
20a7e0157c max287x: add ability to set aux output power 2024-05-16 14:53:43 -05:00
Grant Meyerhoff
9f14035440 max287x: add set_reg function for max2871 and expose get/set 2024-05-16 14:53:43 -05:00
Martin Braun
39e0f6a760 lib: adf5356: Fix FRAC2 calculation
The code followed the FRAC2 for ADF5355, which only has 14 bits of
resolution. ADF5356 has 28 bits of resolution, and thus requires
a bigger word size.
2024-04-02 16:27:20 +02:00
Virendra Kakade
36f6c11ef3 mpmd: fix timekeeper misalignment
Change the syrnchronization order to be following:
- Run the MTS (multi-tile sync) procedure
- Run the timekeeper alignment to next_pps edge
- Run the post timekeeper alignment steps (none for now)

This ensures that any effects caused due to delay adjustments which are
part of the MTS procedure do not affect timekeeper alignment.
Without this change timekeepers on two X4xx devices would be mis-aligned
slightly in a multi-device scenario.

Note that setting all timekeepers to a common time_spec on the next_pps
as a part of post-initialization application code will still align them perfectly.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2023-10-09 11:01:28 -07:00
Grant Meyerhoff
78156eabfa mpm: move pop_host_tasks to PeriphManagerBase
Move pop_host_tasks function call from just x4xx to all MPM devices so it can be safely called from mpmd_mboard_impl
2023-09-06 10:09:36 -05:00
Martin Braun
ebd5dd03cf Apply clang-formatting to all C/C++ files
- Used clang-format version 14
- Ran ./tools/clang-formatter.sh apply
2023-08-07 15:35:56 -05:00
Martin Braun
79247929b1 lib: max287x: Remove unused class attributes
These throw warnings in recent clang compilers.
2023-07-12 09:43:23 -07:00
Martin Anderseck
b3b5e69b02 SelfCal: Trigger if clocking has changed
This change ensures that ADC selfcal is triggered during session start
if the clocking was reconfigured. So it saves time if several
consecutive sessions are opened with always the same settings.
It also makes the ADC self cal run if in an open session either
set_clock_source(), set_time_source() or set_sync_source() are called
and a clock reconfiguration was triggered by that.
2023-07-07 12:35:55 -07:00
Martin Anderseck
f5bb3e0275 lib: Add X440/FBX support
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
2023-06-12 10:27:29 -05:00
Martin Braun
371c4c139c mpm: Add support for X440/FBX
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Javier Valenzuela <javier.valenzuela@ni.com>
2023-06-12 10:27:29 -05:00
Martin Braun
87423d1d75 lib/mpm: Add MPM synchronization API
This adds a new synchronization step in the MPMD device initialization.

- Add API calls to PeriphManagerBase and rpc.py (synchronize() and
  aggregate_sync_data())
- Add sane default implementations to PeriphManagerBase

Note: This adds new APIs to MPM, but we won't change the compat number
in this commit, since the new API is not yet being used.
2023-03-24 16:08:30 -07:00
Martin Braun
d5505e44a8 mpm: x4xx: Move get_master_clock_rate() to DB-RPC
The X4x0 device is an outlier with respect to all other MPM devices when
it comes to this API. All other MPM-devices define this API on the
daughterboard, not the motherboard.

For all the reasons laid out in dboard_manager/base.py, we move this API
call for X4x0 also into the daughterboard RPC space.

Both get_master_clock_rate() and set_master_clock_rate() are explicitly
declared @no_rpc in MPM.

This is an API breakage in the UHD/MPM communication API.
2023-03-24 16:08:30 -07:00
michael-west
7b684b80cd UBX: Add VCO band calibration and map access
The LO for the UBX can fail to lock in some cases where timed commands
are used to tune.  The LOs on the UBX use a map to select the VCO
band.  These changes give access to the maps for each LO and add a
calibration for the maps.  This allows users to develop a calibration
that suits their use case.

Signed-off-by: michael-west <michael.west@ettus.com>
2023-03-03 15:23:20 -05:00
Lars Amsel
2b50249f4c host: ADC cal: Add ability to set calibration mode explicitly
We currently do not set the calibration mode during ADC self
calbration. The default mode is selected in Vivado configuration.
Nevertheless we have seen issues where not setting the mode
lead to poor results in ADC self calibration.

This commit enable the RPC to call the set_calibration_mode
which was already implemented in our RFDC lib.
2022-12-18 18:28:12 -06:00
David Raeman
2c23f4914e cal: add method to get the current power cal tracking mode 2022-06-29 12:08:31 -07:00
Lane Kolbly
1ba8c2517d host: x410: Cache GPIO source in mb_controller 2022-03-23 16:14:07 -05:00
Martin Anderseck
f249b73036 max287x: Fix key in table of freq ranges
The keys for the table of frequency ranges for each VCO value counts up
consecutively but key "1" was there twice while "2" was missing. This
is fixed here.
2021-12-03 11:33:26 -08:00
Lane Kolbly
568ee85778 host: Add gpio_voltage discoverable feature 2021-11-05 12:02:19 -07:00
Lane Kolbly
0bb02043a3 host: Add RPC calls for GPIO voltage 2021-11-05 12:02:19 -07:00
Lane Kolbly
3162b92bed host: Add GPIO functions to MPM RPC shim 2021-11-03 06:04:19 -07:00
Martin Braun
b6119e581e uhd: Replace Boost mutexes and locks with standard options
This is a very mechanical task that could almost have been done with
sed. Boost versions of mutexes and locks were removed, and replaced with
std:: versions. The replacement tables are as follows:

== Mutexes ==
- boost::mutex -> std::mutex
- boost::recursive_mutex -> std::recursive_mutex

Mutexes behave identically between Boost and std:: and have the same
API.

== Locks ==
C++11 has only two types of lock that we use/need in UHD:
- std::lock_guard: Identical to boost::lock_guard
- std::unique_lock: Identical to boost::unique_lock

Boost also has boost::mutex::scoped_lock, which is a typedef for
boost::unique_lock<>. However, we often have used scoped_lock where we
meant to use lock_guard<>. The name is a bit misleading, "scoped lock"
sounding a bit like an RAII mechanism. Therefore, some previous
boost::mutex::scoped_lock are now std::lock_guard<>.

std::unique_lock is required when doing more than RAII locking (i.e.,
unlocking, relocking, usage with condition variables, etc.).

== Condition Variables ==
Condition variables were out of the scope of this lock/mutex change, but
in UHD, we inconsistently use boost::condition vs.
boost::condition_variable. The former is a templated version of the
latter, and thus works fine with std::mutex'es. Therefore, some
boost::condition_variable where changed to boost::condition.

All locks and mutexes use `#include <mutex>`. The corresponding Boost
includes were removed. In some cases, this exposed issues with implicit
Boost includes elsewhere. The missing explicit includes were added.
2021-10-19 12:21:33 -07:00