So I’m fresh here but I already used PYNQ for a period. It’s really amazing and provides us various possibilities.
Now the problem is when I instant the interrupt with ol=Overlay(‘system.bit’,download=False), it turns out like this:
from pynq import Overlay, GPIO, Interrupt,UioController
import asyncio
import time
ol=Overlay('system.bit',download=False)
intc_ip=ol.axi_intc_0
intr_inst = Interrupt('axi_intc_0/intr')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-1-5a03c77529e4> in <module>()
3 import time
4 ol=Overlay('system.bit',download=False)
----> 5 intc_ip=ol.axi_intc_0
6 intr_inst = Interrupt('axi_intc_0/intr')
/usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __getattr__(self, key)
335 """
336 # if self.is_loaded():
--> 337 return getattr(self._ip_map, key)
338 # else:
339 # raise RuntimeError("Overlay not currently loaded")
/usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __getattr__(self, key)
735 elif key in self._description['ip']:
736 ipdescription = self._description['ip'][key]
--> 737 driver = ipdescription['driver'](ipdescription)
738 setattr(self, key, driver)
739 return driver
/usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __init__(self, description)
600 self._gpio = {}
601 for interrupt, details in self._interrupts.items():
--> 602 setattr(self, interrupt, Interrupt(details['fullpath']))
603 for gpio, entry in self._gpio.items():
604 gpio_number = GPIO.get_gpio_pin(entry['index'])
/usr/local/lib/python3.6/dist-packages/pynq/interrupt.py in __init__(self, pinname)
91 """
92 if pinname not in PL.interrupt_pins:
---> 93 raise ValueError("No Pin of name {} found".format(pinname))
94
95 parentname = PL.interrupt_pins[pinname]['controller']
ValueError: No Pin of name axi_intc_0/intr found
Considering I run the ADI RF board(ADRV9009) on the ZCU102, my environment is built in petalinux2019 with meta-adi and PYNQ2.4. Then I drive the board with ADI kernel driver and program with PYNQ. That results that I only can boot the system with bitstream inside boot.bin while ADI’s kernel doesn’t support FPGA Mange and the RF board kernel driver would crash if I download the bitstream in PYNQ. The bitstream can be downloaded and control the FPGA well by the PYNQ but I’ll lose control of the RF board after that.
Thus, so far I always boot with the wanted bitstream and use Overlay the same bitstream with download=‘False’. IPs in FPGA, like GPIO, MMIO, and DMA, can be controlled well with this procedure till now. The interrupt instance shows errors like the above and I guess it results from I didn’t load bitstream into PL server.
Before I overlay anything, I’ve checked the interrupt can be found under “/proc/interrupt” and “/sys/class/uio/uio4/name”. I’ve tested it with the same bitstream downloaded with overlay, the interrupt can work well while RF board goes down as expected. In the hardware design, the interrupt signal generated from my IP, connects to the AXI Interrupt Controller. Then the AXI Interrupt Controller connects to ps interrupt pin, just like the example in Zynq PS7 Interrupts.
I’ve also tried the method in the thread Minimal simple Interrupt handling with UIO device in Pynq but I got
controller = UioController("/dev/uio4")
event = asyncio.Event()
async def interrupt_test():
while True:
event.clear()
controller.add_event(event, 0) # Number is a dummy variable
await event
print("Interrupt Triggered")
loop = asyncio.get_event_loop()
loop.run_until_complete(interrupt_test())
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-15-93a1fd13b234> in <module>()
9
10 loop = asyncio.get_event_loop()
---> 11 loop.run_until_complete(interrupt_test())
/usr/lib/python3.6/asyncio/base_events.py in run_until_complete(self, future)
466 raise RuntimeError('Event loop stopped before Future completed.')
467
--> 468 return future.result()
469
470 def stop(self):
<ipython-input-15-93a1fd13b234> in interrupt_test()
5 event.clear()
6 controller.add_event(event, 0) # Number is a dummy variable
----> 7 await controller
8 print("Interrupt Triggered")
9
TypeError: object UioController can't be used in 'await' expression
So, is there any suggestion to allow me instant the interrupt like usual or another way to let me apply the interrupt within PYNQ?