RFSoC4x2 custom image – PYNQ boots successfully, but Overlay() fails (“undefined symbol: xclOpen” / “0 devices found”)

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?

Hi @Gergo_Kovacs

From what PYNQ and RFSoC-PYNQ branches and commit hashes did you build your image from? This will be the most helpful information.

Additionally, on your image, what is the output of sudo xbutil examine?

Thanks,

Josh

Hello @joshgoldsmith, thank you for the intervention.
The branches and commit hashes that we worked with are the following:

PYNQ:
branch: Master, Commit hash: d18bb880a47087bb8e49b17780c8265978cecaa5

RFSoC-PYNQ:
branch: Master, Commit hash: For building the image, we used the PYNQ repo and copied in boards/RFSoC4x2 the content from RFSoC-PYNQ/boards/RFSoC4x2; additionally we deleted the folder petalinux_bsp and we used our own .bsp file which was created from the PetaLinux project created by us with SCTP protocol enabled in the kernel.

The output of the sudo xbutil examine is:

(pynq-venv) xilinx@pynq:~/workspace$ xbutil examine
System Configuration
  OS Name              : Linux
  Release              : 6.6.40-xilinx-g8e068c470fbe
  Version              : #1 SMP Tue Oct 29 11:52:30 UTC 2024
  Machine              : aarch64
  CPU Cores            : 4
  Memory               : 3928 MB
  Distribution         : PynqLinux, based on Ubuntu 22.04
  GLIBC                : 2.35
  Model                : unknown
  BIOS vendor          : unknown
  BIOS version         : unknown

XRT
  Version              : 2.17.0
  Branch               : temp
  Hash                 : a75e9843c875bac0f52d34a1763e39e16fb3c9a7
  Hash Date            : 2025-05-04 00:38:01
  ZOCL                 : 2.17.0, a75e9843c875bac0f52d34a1763e39e16fb3c9a7

Devices present
  0 devices found
(pynq-venv) xilinx@pynq:~/workspace$

Thanks,
Gergő

Hi @Gergo_Kovacs

Could you try and build an image using the latest commit from both repositories on the master branches?

What I think this error could be is that you are using the old XRT bindings (v2.13) with a newer version of XRT (2.17). The API has changed between these versions and we now use the pyxrt bindings. This could explain the undefined symbol error.