Problems with interrupt.wait() method on python

System:

PYNQ-Z2
PYNQ v3.01 and v3v1

Description:

I am trying to use interrupts from different sources controlled by the axi_interrupt_controller. Initially, I applied the example provided in readthedocs.io and then expanded it to custom IPs. When running the program through the Jupyter kernel, no problems are observed — the .wait() method works correctly, as do the interrupts and their handlers.

However, when I try to run the same application (GPIO or custom IP) directly in Python, the script stops at the .wait() method. When the script is executed, an .xclbin file is generated indicating that the target device is an Ultrascale ( ) instead of the PYNQ-Z2. I believe the issue lies in the incorrect interpretation of the device, which consequently leads to incorrect programming of the PL.

In tests with the ILA, the interrupt does reach the IP, but it is neither recognized nor handled, which leads me to believe that the access to the IP is incorrect due to the target device mismatch.

I use the following steps to run the Python script:
cd custom_path/ → sudo bash → source /usr/local/share/pynq-venv/bin/activate → export XILINX_XRT=/usr → python test.py

The .bit and .hwh files are attached along with the code used for the initial debug with GPIO (a more controlled situation using only commercial IPs) and the .xclbin file.

It seems that, runing on legacy alows Jupyter to run, configure and access axi_interrupt_controller, but i coldn’t find a way to activate legacy in both images or change the target device on the system itself.

Hi @MatheusChina,

Welcome to the PYNQ community.

Please, see how to source pynq on the command line in the post below:

Mario

The xrt_setup.sh file has nothing more than the line export XILINX_XRT=/usr, which I’m already using. I tried following this step by step just to make sure, but there was no difference whatsoever. The xclbin file was generated an with the same zcu111 board as target device <platform vendor="xilinx" boardid="zcu111" name="name" featureRomTime="0">, <device name="fpga0" fpgaDevice="zynquplusRFSOC:xczu28dr:ffvg1517:-2:e" addrWidth="0">.

Hey @marioruiz,

Have you seen my answer by any chance? I configured the PYNQ environment using the provided command lines as well as the code inside the respective .sh files, but with no luck.

Thanks anyway,

Matheus

Hi @MatheusChina,

Can you try to run the script from the JupyterLab terminal? If this works, it means that something on the other environment is not setup correcly.

Mario

Hi @marioruiz,

It does work on Jupyter, but I have no idea what to debug or check regarding what might be wrong.

I wonder if it might have anything to do with the IP device targets or the Vivado project target device. In my mind this doesn’t make sense, because that’s the first thing we usually set up in a project (PYNQ-Z2 in my case).

Can you offer me some advice on what to look for?

Matheus

Hi @MatheusChina,

To be 100% certain, did you run the Python script in the terminal available in Jupyter Lab? Not a notebook.