Hi,
I am attempting to get PYNQ asyncio interrupts working on an unsupported board with kernel and rootfs created with a 2020.1 PetaLinux flow.
from pynq import Overlay, GPIO, Interrupt
import asyncio
/usr/lib/python3.7/site-packages/pynq/pmbus.py:230: UserWarning: Could not initialise libsensors librarywarnings.warn("Could not initialise libsensors library")
ol=Overlay('min_intr_test.bit')
intc = ol.stream_intc
reset = GPIO(GPIO.get_gpio_pin(0), 'out')
gpio_trigger = GPIO(GPIO.get_gpio_pin(1), 'out')
ol.interrupt_pins
{'system_ila_0/probe1': {'controller': 'stream_intc',
'index': 0,
'fullpath': 'system_ila_0/probe1'},
'stream_intc/intr': {'controller': 'stream_intc',
'index': 0,
'fullpath': 'stream_intc/intr'},
'gpio_interrupt/Dout': {'controller': 'stream_intc',
'index': 0,
'fullpath': 'gpio_interrupt/Dout'}}
async def handle(interrupt):
await interrupt.wait()
print('handling interrupt')
async def trigger():
await asyncio.sleep(2)
gpio_trigger.write(1)
gpio_trigger.write(0);
intr_inst = Interrupt('stream_intc/intr')
handler_task = asyncio.ensure_future(handle(intr_inst))
trigger_task = asyncio.ensure_future(trigger())
trigger_task
<Task finished coro=<trigger() done, defined at <ipython-input-3-eb33238f6660>:5> result=None>
intc.register_map.ISR
Register(INT=1)
The trigger task fires and the interrupt controller registers the interrupt and fires off an IRQ but the handler task does not see it.
handler_task
<Task pending coro=<handle() running at <ipython-input-3-b5b1222e13f7>:2> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0xaec88810>()]>>
I read somewhere on these forums that instantiating the Interrupt class should not be an issue, but also see
Is this the naming of the interrupt controller stream_intc the issue? or is there something else I am missing?