Follow-up question to DMA #18047
Unanswered
JackCode0011
asked this question in
RP2040 / Pico
Replies: 2 comments 2 replies
-
really wants some brackets: |
Beta Was this translation helpful? Give feedback.
2 replies
-
That doesn't make any sense. 0x4002_0000 is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone
After my last question about DMA I have a follow-up question.
The code is now running smoothly, except for one detail.
When SM and DMA are collecting data, I use "normal" Micropython to do stuff with the data. In this while-loop, I also check, if SM is still active
if sma.active():
, I check if DMA is activeif dma1.active() or dma2.active():
and a last check, if DMA is really collecting. I useDMA.count
with a timedelay and if the difference is 0, DMA is not collecting, otherwise it is. The timedelay gets calculated according to the SM freq, so that it should never happend, that DMA.count is read at the same point.Now and then I loose the input signals for a short or longer periode. If that happens, the checks I do start a second loop, where it's checking a few more times with a delay between each check, if maybe the signal is back. If not, SM and DMA are closed, reset and started again.
Now my problem: When simulating this, by switching of the device, that delivers the signal, everything is ok and the checks are done, but when I switch it back on, the code is still not able to detect the signal. If a do a hard-reset, everything works again.
Now, after some debugging I'm again pretty sure, that DMA is the problem again.
What I did so far (tried in different orders):
dma.active(0)
dma.config(Trigger=False)
dma.close
reseting with CHAN_ABORT on offset 0x464
'0x1 reset on bit 2 of RESETS, 0x40020000'
After also trying different code it seems, that there is still something in the DMA-settings, that doesn't get cleared and stays on.
Also stopping the code with Thonny or PyCharm doesn't help. It has to be a hard-reset. So something stays in the RP2350 I think.
My question:
Is there another way to reset DMA, which I haven't tried yet?
Greetings
Beta Was this translation helpful? Give feedback.
All reactions