Commit Graph

4843 Commits

Author SHA1 Message Date
Abhishek Verma
1da439c020 host/mpm: change MPM_RPC_PORT to avoid UHD<4.10 discovery crash
UHD hosts <4.10 speak mprpc and unconditionally connect to the RPC port
(49601) of any device they discover. When they reach a gRPC-based MPM
device, the protocol mismatch crashes uhd_find_device.

UHd host 4.10, prevents this by using rpc_version key from discovery
response and skips RPC attempt if mprpc device found during
uhd_find_devices.

This change moves the RPC port to 49602. Now, old UHD <4.10 hosts can
still discover both mprpc and grpc devices. But their mprpc connection
attempt on 49601 during uhd_find_devices is refused by grpc device
(running on new rpc port 49602) and is marked as not reachable instead
of crashing.
2026-08-25 12:11:37 +02:00
Martin Anderseck
538a2e3fb3 python: Make discoverable features available
This makes all discoverable features available and creates a pattern for
any future discoverable features.
2026-08-24 23:12:45 +02:00
Abhishek Verma
05443d301d host/mpm: make gRPC robust to idle teardowns
The main RPC channel can sit idle for a long time (e.g. an interactive
Python session) while only the claim-loop channel sees traffic. Without
keepalive, gRPC self-closes the idle transport (~30 min) and the next
RPC fails re-establishing within its per-call deadline.

With this change the client now pings every 30 s to keep the channel
warm, and the server is configured to accept that cadence instead of
replying GOAWAY "too_many_pings".
2026-08-23 02:23:02 +02:00
Grant Meyerhoff
e98e866709 b300: fix external ref assignment 2026-08-23 00:22:03 +02:00
Grant Meyerhoff
bc64ff0ad6 b300: disallow changing clock source mid-session 2026-08-23 00:22:03 +02:00
Grant Meyerhoff
9291d7e18b adrv9032: store nco as per channel 2026-08-23 00:18:25 +02:00
Grant Meyerhoff
e8079eca45 adrv9032: fix nco source check 2026-08-23 00:18:25 +02:00
Grant Meyerhoff
b8d34e36be adrv9032: correct channel assignment for agc 2026-08-23 00:18:25 +02:00
Virendra Kakade
3716dd0884 b300: depend on installed nib310rio.h for Linux PCIe support
Remove the vendored copy of nib310rio.h from the inchworm tree and
replace it with a build-time dependency on the header installed by
the nib310rio-dev package:

    /usr/include/nib310rio/nib310rio.h

CMake now searches for this header before registering the B300
component. On Linux, if the header is absent, B300 support is
silently skipped with a status message pointing to the missing
package. If the user explicitly passes -DENABLE_B300=ON without
the header present, CMake fails with a clear error.

Update the two Linux-only include sites to use the system path:

    #include <nib310rio/nib310rio.h>

This makes the build-time dependency on the kernel driver explicit
and removes the risk of the vendored copy drifting out of sync with
the installed driver.

Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2026-08-23 00:17:02 +02:00
Grant Meyerhoff
9015e01d3c b300: bump expected minor compat number for FPGA 2026-08-20 02:00:29 +02:00
Grant Meyerhoff
b035928f19 b300: reset Thunderbolt PD after image load 2026-08-20 01:59:34 +02:00
Grant Meyerhoff
45ea2365b1 cores: restrict spi_core_adrv build for b300 2026-08-11 01:16:12 +02:00
Grant Meyerhoff
00826ca054 adrv9032: fix licensing notices 2026-08-10 22:56:24 +02:00
Abhishek Verma
3ec3ea3ef6 host: add missing rpc cmds in proto file
- add missing x4xx rpc cmds in proto file
- add missing n3xx rpc cmds in proto file
2026-08-10 22:52:19 +02:00
Jörg Hofrichter
2618b51cb8 host: mpmd based uhd_image_loader: fallback to .bin file
If the expected FPGA image with .bit file ending is not available,
try with .bin file ending.

Co-authored-by: Lars Amsel <lars.amsel@emerson.com>
2026-08-10 16:40:53 +02:00
Grant Meyerhoff
7a0a5f8085 b300: search for FPGA images if not provided 2026-08-10 14:11:49 +02:00
Niels Garibaldi
e466f427fd host: dsp: add wideband ddc and duc rfnoc blocks
Updated the host related files to support wideband DxC block
variants.
The singlesample and multisample variants both have the same API,
but internally they are using different register address spaces to
interact with the FPGA implementation.
The host implementation checks which implementation a RFNoC DxC
block is using by checking the block version number and will then
automatically choose the correct register address scheme.
This is all transparent to the user, the Block API stays the same.

Co-authored-by: Niels Garibaldi <niels.steffen.garibaldi@emerson.com>
Co-authored-by: André Zoch <andre.zoch@emerson.com>
Co-authored-by: Meghana Halladamath <meghana.halladamath@emerson.com>
Co-authored-by: Wade Fife <wade.fife@ettus.com>
Co-authored-by: Max Köhler <max.koehler@emerson.com>
2026-08-05 08:43:42 +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
Aki Tomita
e98bf35840 platform: Move get_page_size so it's shareable 2026-08-04 09:45:33 +02:00
Grant Meyerhoff
83553e2dd5 common: Add ADRV903x code from API version 2.12.1.4
- Includes all needed files from the ADI-provided software drop, intentionally only including the files needed for the ADRV9032.
- Adds a LICENSE.pdf file that points to ADIs Software License Agreement
- Includes CMakeLists.txt files for building and a .clang-format file to ignore changing format that were not provided by ADI.
2026-08-04 09:45:33 +02:00
Martin Braun
2a2ce50abe lib: Fix compiler warning in db_dbsrx.cpp
On modern compilers, this file could cause a warning such as:

warning: ‘void operator delete(void*, std::size_t)’ called on pointer
‘<unknown>’ with nonzero offset [8, 9223372036854775800]
[-Wfree-nonheap-object]

A minor refactoring avoids the warning, even though it was unlikely
a real issue in the first place.
2026-07-29 14:39:22 +02:00
Wade Fife
34ecf65642 rfnoc: python API: Expose sleep control op 2026-07-28 14:24:19 +02:00
Wade Fife
19d7d1a6a5 rfnoc: Increase Ctrl SeqNum to 8 bits
Increase the control SeqNum field width from 6 bits to 8 bits. See the
updates to rfnoc_fpga.md for details.
2026-07-28 14:24:19 +02:00
Martin Anderseck
0ef82247ab host: Fix SPI pin offset for Port B
While in all GPIO code, 12 is the offset from Port A to Port B, the
SPI engine for X4xx used to have 16 since the last rework of this
code, directly reflecting addresses from the FPGA. This commit fixes
this.
2026-07-24 13:48:00 +02:00
Abhishek Verma
69bdf4d34f host: fix intermittent "Socket closed" / "Invalid token" RPC failures
UHD creates two gRPC clients per MPM session (main rpc + claimer)
against the same address with identical ChannelArguments. Under
gRPC's default global subchannel pool they share one HTTP/2 transport,
so destroying any one client (an old claimer from reset_claim_loop(),
a discovery probe, or a freed prior session) can tear down the
connection under the active claimer. Its next Reclaim then fails
with error "Socket closed", the claim loop exits, MPM expires the
claim, and the main client's next RPC fails with "Invalid token"
-- causing tests like PhaseCoherence to fail.

Fix: set GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL=1 in the rpc_client_impl
constructor so each channel owns its own subchannel/transport.
Destroying any client now tears down only its own connection; the
active claimer's transport and claim are untouched. This eliminates
both the Socket closed and the follow-up Invalid token.

Also add MPM_CLIENT client-id/thread-id diagnostic debug/trace logs.
2026-07-24 10:13:27 +02:00
Grant Meyerhoff
2c255b28c8 i2c: fix class name duplication 2026-07-21 10:04:50 +02:00
Grant Meyerhoff
1bce477ace i2c: allow for multi-byte eeprom offset 2026-07-21 10:04:50 +02:00
Grant Meyerhoff
3153b09ce3 i2c: allow for setting custom i2c_datarate 2026-07-21 10:04:50 +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
a06f6531f5 gps_ctrl: accept other constellation messages
- Previously only 'GP' messages were accepted and parsed for.

Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
2026-07-16 16:06:22 +02:00
Grant Meyerhoff
6b3bde0e85 gps: update regex to not require comma
- Some chips don't include a comma in the messages
2026-07-16 16:06:22 +02:00
Grant Meyerhoff
49d87e2d97 gps: increase timeout for non-JL chips 2026-07-16 16:06:22 +02:00
Grant Meyerhoff
97024728c9 gps: add member for flushing buffer
- Some devices don't automatically cycle through the UART buffer in the background, so may have stale data when the user wants to read GPS sensors. This signals that a flush needs to happen so that stale data isn't used for determining GPS lock, time, etc.
2026-07-16 16:06:22 +02:00
Grant Meyerhoff
206a7b183b lmk05318: add sleep before busy check 2026-07-16 13:00:41 +02:00
Grant Meyerhoff
760058e236 lmk05318: add note about code duplication 2026-07-16 13:00:41 +02:00
Grant Meyerhoff
a9c812453a common: add c++ support for lmk05318 2026-07-16 13:00:41 +02:00
Grant Meyerhoff
966e91e0eb lmk04832: add note about code duplication 2026-07-16 12:57:44 +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
8c0f99f915 mpmd: Temporarily drop default init_threads to 1
This is a safety precaution, until parallel initialization has been
vetted for all MPM devices, we print a warning for parallel init and
make it an opt-in features (the `init_threads` argument needs to be
passed as a device argument to use parallel initialization).

Note this feature has been tested on X440 with positive results.
2026-07-03 13:54:35 +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
3c36caafbd mpmd: tag per-mboard logs with indexed logger IDs
Pass motherboard index through mpmd_mboard_impl factories.  Store
per-mboard log state in mpmd_mboard_impl and forward MPM logs using
names rewritten with the mboard index (e.g., MPM#0...). This makes
parallel bring-up logs distinguishable across devices.
2026-07-02 13:13:24 +02:00
Martin Braun
1fc0849c96 mpmd: Enable parallel initialization
This copies the serialize_init argument (and its effects) from X3xx into
MPMD, and allows for the parallel initialization of multiple devices in
a UHD session.

Before this change, MPM devices could only be initialized serially. With
this change, the default is to initialize them in parallel, but the
behaviour can be undone by passing the serialize_init argument:

```python
my_usrp = uhd.usrp.MultiUSRP( # Init two USRPs in parallel
    "addr0=192.168.178.10,addr0=192.168.178.11")
my_usrp = uhd.usrp.MultiUSRP( # Init two USRPs serially
    "addr0=192.168.178.10,addr0=192.168.178.11,serialize_init=1")
```
2026-07-02 13:13:24 +02:00
Martin Anderseck
154a87e7ca host: hbx: Use burst_poke for IQ coefficients
This commit makes the IQ/DC offset compensation use the new
burst_poke32() method to save us overhead and be more efficient when
writing the coefficients.
2026-06-30 10:55:53 +02:00
Wade Fife
a39128d4bc rfnoc: Display versions when there's a mismatch 2026-06-29 08:08:59 +02:00
Wade Fife
9bbfd23fb1 rfnoc: Support remaining control opcodes
This adds support for using block write, block read, and poll control
packets in RFNoC. Previously, block write/read operations were done by
issuing multiple individual single-word write/read control packets. Now
a single control packet can be used to read or write up to 15 words.

The poll operation is now also supported and no longer throws an
assertion when called.

A new burst write/read mode is also supported, in which the standard
OP_WRITE/OP_READ opcodes are used with multiple data words to perform
repeated reads or writes to the same address.

This change also removes the requirement for dummy data words to be
present in read request packets as well as write and sleep response
packets. This improves efficiency of the control interface, especially
for block and burst operations.
2026-06-29 08:08:59 +02:00
Lars Amsel
94f857518c Host: Move find logic into the find_t calls
In 8f6c7e5 we cleaned up uhd::find to have a consistent experience independend
from the underlying registered device type (usrp1/usrp2/b200/mpm/…).

Removing the filtering of found devices from the find_t broke existing
workflows. The image loader uses the find_t of, e.g. of mpm which now does
no filtering anymore, so

    uhd_image_loader --args addr=<ip>,tpye=x4xx,fpga=X4_200

would load the bitfile, because when finding for a specific ID UHD does no
broadcast so the result will be either no or a single result while

    uhd_image_loader --args serial=<id>,tpye=x4xx,fpga=X4_200

would do a broadcast an find a potentially more that one device. The
image loader will then fail, because we do not support multi device updates.

This commit fixes this by moving the filtering methods into some place
visible for all find_t methods. uhd::find does not filter anymore.
Instead the filtering is done in the find_t's itself. This ensures that the
filter is also applied if the find_t is invoked by anything else than
uhd::find (e.g. the image loader). At the same time it is ensured that we
keep the cleaned up find we introduces in the commit mentioned above.
2026-06-24 09:19:45 +02:00
Martin Braun
af31944702 fbx/hbx/zbx: Include fail flag in nco_locked sensor
Previously, the `nco_locked` sensor value only returned the reset status
(i.e., was the NCO out of reset). We now also include the status of the
fail flag, i.e., the NCO must be out of reset, and the fail flag must be
clear to signal a positive `nco_locked` value.

Note that the `nco_locked` sensor is named this way to mimic the
lo_locked sensors available on other daughterboards. Those other sensors
report on the physical lock status of analog PLLs, but this simply
returns the status of the NCO.
2026-06-22 13:42:30 +02:00