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.
This adds a unit test for the spi_core_4000 which checks for the
validation of configurations and arguments and verifies the correct
registers are written during a SPI transaction.
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.
Previously it would round up the requested size to the nearest power of
two. Now it will attempt to match the size of the buffer to the
requested size, allowing more control over how many FPGA RAM resources
get consumed.
This change updates the RFNoC specification to increase the SeqNum
field from 6 bits to 8 bits. This helps reduce control packet response
sequence number aliasing in cases where packets may be dropped or
reordered. To make this change while keeping the implementation
efficient, the control packet fields have been rearranged to place the
most critical information first and to avoid splitting fields across
word boundaries.
Additionally, compared to the previous version of the specification (as
of UHD 4.10), a new ReqSize field has been added. This field represents
the read request size.
The DataLength field that briefly existed in the change history has
been removed. In the new version, NumData represents the number of data
words present in the control packet (the same meaning as in the
original RFNoC specification), while ReqSize indicates the number of
words requested to be read. This means that a large read request can be
issued without including dummy data in the request (e.g., ReqSize = 15
while NumData = 0).
See separate commits for the corresponding FPGA and host code changes.
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.
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.
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.
- 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.
When running `rfnoc_modtool make-yaml`, the generated YAML will contain
an incorrect make_var entry under fpga_includes. This fixes it to
contain the blockname rather than the module name.
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
- Add section on external clocking in X4xx manual
- Add links to the new section
- Fix some minor typos in clocking-related sections
- Clarified that full reinit occurs when a ref-lock-loss event is
registered
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.
Due to thread scheduling on the test OS, requests made in close
succession could be responded to out of order, which does not correctly
model the hardware. This change ensures that responses come in the same
order they were requested.
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.
For repoducible builds which use the variable SOURCE_DATE_EPOCH, ensure
reproducible C_FLAGS and CXX_FLAGS by replacing the actual build directory
by BUILD_DIR.
The change is based on the patch omit-build-path from pkg-uhd repository,
original author "A. Maitland Bottoms" <bottoms@debian.org>.