← index #10696Issue #18765
Related · high · value 0.307
QUERY · ISSUE

DMA interrupts

openby sciencedude1990opened 2023-02-08updated 2024-09-02
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

closedby pdw-mbopened 2026-02-01updated 2026-03-18
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_sel parameter 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

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied