Update MPM GPIO handling for the updated X4xx GPIO SPI register
interface.
Require the FPGA compatibility number bump introduced with the new
SPI support so MPM does not operate against an incompatible FPGA image.
Bump MPM compat number.
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
Upon reset, MPM Server tries to destroy the current instance of
Periperal Manager and re-create a new one.
Due to external references to bound methods, Peripheral Manager
and its member DioControl could not get destroyed which resulted
in reference leaks and file desciptor leaks.
This PR clears all external references to bound methods such that
PeripheralManager and its members are cleanly destroyed before
re-creation.
This fixes the "Too Many Open Files" when running 'uhd_image_loader'
repeatedly.
setproctitle is not available by default on our embedded systems. We therefore use it only if the module is installed and leave the title as is otherwise.
To get the process title one has to install setproctitle via pip and then restart MPM.
During debug, it is often helpful to distinguish the processes by
name. By default, Python processes inherit the name of the parent,
which is the name of the script executed. This change sets explicit
names for all our MPM processes.
When registering a signal, the current registered signal is removed.
This is often an unwanted behavior. Instead, one typically wants to
add code to the existing handler. This helper remembers the current
handler and calls it after the newly registered handler is executed.
Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
In commit bc8713e7af the SPI functionality was made available
conditionally depending on the FPGA version number. For this,
all SPI entries were removed from the X4XX_GPIO_SRC_RADIO variable
and put into an own variable. But therefore SPI was not available
anymore as valid source for GPIO. This change reintroduces SPI and
thus enables the SPI functionality again.
Co-authored-by: Javier Valenzuela <javier.valenzuela@ni.com>
Add support for reading the number of supported SPI slaves from
the device. This has become necessary because we may have bitfiles
with different capabilities and we want to report this back correctly.
set_gpio_src takes a list of twelve sources to apply to the pins. For
the DIO mapping, this is fine, because the twelve pins are zero through
eleven. However, for the HDMI mapping, the pin indices range from one
to nineteen. This commit adds a function to convert from the set_gpio_src
list indices into the pin number.
Older DIO boards don't support all the features of newer ones, but from
the log messages, it's not clear what revision the board has. We add
a log statement to clarify.
No functional changes whatsoever, only:
- Move DioControl to its own module (x4xx_dio_control.py)
- Where PyLint was complaining about whitespace issues, fix those
- Fix import list in x4xx_periphs.py after removing DioControl
- Fix import list in x4xx.py to import DioControl from the correct
location