Hi everyone,
We are working with an RFSoC 4x2 board and need to run an application on the Processing System using a PYNQ-based operating system.
Our application requires SCTP kernel support, which is not included in the official PYNQ image for the RFSoC4x2.
To address this, we built a custom PYNQ image following the tutorial from the official PYNQ repository: PYNQ/sdbuild at master · Xilinx/PYNQ · GitHub
What we did so far:
1. PetaLinux Base Configuration
We created a PetaLinux project based on the ZynqMP template and enabled (beside resources enabled in template by default):
-
SCTP protocol support
-
SPI interface (for onboard clock configuration)
-
Userspace I/O (
UIO_PDRV_GENIRQ) -
/sys/class/gpio -
Root filesystem packages:
zocl,libgpiod,libmetal
2. Hardware Platform
Our hardware platform includes:
-
RF Data Converter (RFDC)
-
AXI DMA for streaming RF samples into the PS
3. Device Tree Configuration (system-user.dtsi)
/include/ "system-conf.dtsi"
/* Place zocl at the root to avoid relying on amba_pl label */
&{/} {
zocl {
compatible = "xlnx,zocl";
status = "okay";
};
};
/* SPI0: Clock configuration (LMK + LMX chips) */
&spi0 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
num-cs = <3>;
spidev@0 {
compatible = "rohm,dh2228fv"; /* CS0 → GPIO 335 → LMK */
reg = <0>;
spi-max-frequency = <1000000>;
linux,modalias = "spidev";
status = "okay";
};
spidev@1 {
compatible = "rohm,dh2228fv"; /* CS1 → GPIO 336 → LMX1 */
reg = <1>;
spi-max-frequency = <1000000>;
linux,modalias = "spidev";
status = "okay";
};
spidev@2 {
compatible = "rohm,dh2228fv"; /* CS2 → GPIO 337 → LMX2 */
reg = <2>;
spi-max-frequency = <1000000>;
linux,modalias = "spidev";
status = "okay";
};
};
/* SPI1: OLED display */
&spi1 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
num-cs = <1>;
spidev@0 {
compatible = "rohm,dh2228fv"; /* OLED */
reg = <0>;
spi-max-frequency = <1000000>;
linux,modalias = "spidev";
status = "okay";
};
};
/* SD interface */
&sdhci0 {
status = "okay";
no-1-8-v;
disable-wp;
};
4. PYNQ Integration
After running petalinux-build, we exported the project as a .bsp file and used it as input for PYNQ sdbuild.
We created the following RFSoC4x2.spec file:
ARCH_RFSoC4x2 := aarch64
BSP_RFSoC4x2 := RFSoC4x2.bsp
BITSTREAM_RFSoC4x2 :=
FPGA_MANAGER_RFSoC4x2 := 1
STAGE4_PACKAGES_RFSoC4x2 := pynq xrt usbgadget ethernet smbus2
STAGE4_PACKAGES_RFSoC4x2 += sensorconf boot_rfsoc4x2
STAGE4_PACKAGES_RFSoC4x2 += xrfclk xrfdc xsdfec rfsystem
STAGE4_PACKAGES_RFSoC4x2 += tics rfsoc4x2_oled rfsoc_sam
This configuration successfully integrates:
- The customized PetaLinux BSP with SCTP and SPI support
- PYNQ and related RFSoC software packages
- Additional board utilities (e.g., clock control, OLED display)
5. Problem
When running:
> python3 -c "from pynq import Overlay; ol = Overlay('5G.bit'); ol.download(); print('Bitstream loaded:', ol.is_loaded())"
We get the following traceback:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlay.py", line 315, in __init__
super().__init__(bitfile_name, dtbo, partial=False, device=device)
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/bitstream.py", line 88, in __init__
device = Device.active_device
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/device.py", line 70, in active_device
if len(cls.devices) == 0:
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/device.py", line 54, in devices
cls.devices.extend(DeviceMeta._subclasses[key]._probe())
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 545, in probe
return [EmbeddedDevice()]
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 568, in __init__
super().__init__(0, "embedded_xrt{}")
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/xrt_device.py", line 318, in __init__
self._get_handle()
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/xrt_device.py", line 329, in _get_handle
self.handle = xrt.xclOpen(self._index, None, 0)
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/_3rdparty/xrt.py", line 203, in xclOpen
libc.xclOpen.restype = ctypes.POINTER(xclDeviceHandle)
AttributeError: /usr/lib/libxrt_core.so: undefined symbol: xclOpen
6. What we’ve tried
We found this discussion, where a similar “0 devices found” issue was fixed by adding a zocl node to system-user.dtsi.
We already have this node:
&{/} {
zocl {
compatible = "xlnx,zocl";
status = "okay";
};
};
However, the problem persists — xbutil still reports 0 devices found, and the PYNQ Overlay() call fails with:
AttributeError: /usr/lib/libxrt_core.so: undefined symbol: xclOpen
Question
Has anyone encountered this issue when integrating custom PetaLinux BSPs into PYNQ builds?