rkompass / RPi2040_mPy

7 stars 0 forks source link

abort() hangs #1

Open bapowell opened 6 months ago

bapowell commented 6 months ago

For me this always hangs: https://github.com/rkompass/RPi2040_mPy/blob/1d109ce6a1840576036183090f06e06a6cd225c8/rp2_dma/rp2_dma.py#L403

To fix, I replaced while p[0]: with while self.busy():

This seems to agree with the comment at https://github.com/raspberrypi/pico-sdk/issues/923:

...After aborting a channel, poll the CTRL.BUSY bit to wait for completion (not the ABORT bit), ...

rkompass commented 6 months ago

Hello @bapowell,

thank you for this finding and report.

Interesting to get feedback - now that there are DMA routines in the MP RP2 firmware.

I'll have to change my DMA class accordingly.

If you don't mind: In which setting did you use the DMA class?

Raul Kompaß

bapowell commented 6 months ago

I'm using DMA to transfer accumulated counts from PIO to memory.