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.
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".
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>
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>
- 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.
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.
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.
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.
- 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.
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.
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
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.
- 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
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.
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")
```
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.
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.
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.
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.