QUERY · ISSUE
DMA interrupts
enhancementport-rp2
For the RP2040/pico, please add support for DMA interrupts.
Great work on Micropython for RP2040! It has made projects around the house fun to tackle, and easy too!
CANDIDATE · ISSUE
rp2: crash on soft reboot with DMA IRQ enabled and DMA active
bugport-rp2
Port, board and/or hardware
rp2 / rp2040
MicroPython version
MicroPython v1.27.0 on 2025-12-09; Raspberry Pi Pico with RP2040
Reproduction
Run the following code:
from rp2 import DMA
def dma_in_handler(dma):
pass
buf_src = bytearray(20)
buf_in = bytearray(20)
dma_in = DMA()
dma_in_ctrl = dma_in.pack_ctrl(size=0, treq_sel=0)
dma_in.irq(dma_in_handler, False)
dma_in.config(
read=buf_src,
write=buf_in,
count=20,
ctrl=dma_in_ctrl,
trigger=True
)
#dma_in.active(False)
#dma_in.irq(None)
print("Hello")
Now attempt to soft-reboot the device (e.g. Ctrl-D on REPL). The device becomes unresponsive and requires a hard reboot.
- Calling
dma_in.active(False)before exit avoids the problem - Calling
dma_in.irq(None)before exit avoids the problem - Removing the
treq_selparameter avoids the problem (presumably because the DMA is then inactive at the time of reboot)
Expected behaviour
No response
Observed behaviour
Device becomes unresponsive over serial after program is run and then MP is soft-rebooted.
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree