Hi,
I'm just building something that needs to do repeating DMA transfers... if you imagine I had an 8K block, and I want to transfer multiple 1K pages into it (from PIO), and then loop back to the beginning and overwrite ad-infinitum. Interrupting after each 1K so I can do something with the data before it gets overwritten.
With the RP2040 I can setup DMA with a ring of 8K in size, make sure by buffer is 8K aligned, use a 1K length (256 xfers) and I don't then need to worry about setting or resetting any of the addresses (data comes from PIO) as it will all be taken care of. So technically I just want to keep re-running this channel, and ideally without doing it manually in the ISR (has the potential to miss data.)
That's all great, however the RP2040 doesn't allow a channel to chain-to itself, so I need a second channel to re-trigger the first one, and this is where my question is...
It seems to me I have two options...
1. The seemingly recommended approach where the second channel just transfers a single word into one of the trigger registers of the first channel (trans_count being the obvious one in this case) and then doesn't need to chain-to anywhere since the trigger will have already happened.
or...
2. Where the second channel doesn't actually do anything, just chain-to the first one ... but is that possible?
So my question is .... is it possible to have a DMA channel that effectively does nothing other than chain-to, this would save an unnecessary data transfer, but also feels cleaner to me.
Many thanks,
Lee.
I'm just building something that needs to do repeating DMA transfers... if you imagine I had an 8K block, and I want to transfer multiple 1K pages into it (from PIO), and then loop back to the beginning and overwrite ad-infinitum. Interrupting after each 1K so I can do something with the data before it gets overwritten.
With the RP2040 I can setup DMA with a ring of 8K in size, make sure by buffer is 8K aligned, use a 1K length (256 xfers) and I don't then need to worry about setting or resetting any of the addresses (data comes from PIO) as it will all be taken care of. So technically I just want to keep re-running this channel, and ideally without doing it manually in the ISR (has the potential to miss data.)
That's all great, however the RP2040 doesn't allow a channel to chain-to itself, so I need a second channel to re-trigger the first one, and this is where my question is...
It seems to me I have two options...
1. The seemingly recommended approach where the second channel just transfers a single word into one of the trigger registers of the first channel (trans_count being the obvious one in this case) and then doesn't need to chain-to anywhere since the trigger will have already happened.
or...
2. Where the second channel doesn't actually do anything, just chain-to the first one ... but is that possible?
So my question is .... is it possible to have a DMA channel that effectively does nothing other than chain-to, this would save an unnecessary data transfer, but also feels cleaner to me.
Many thanks,
Lee.
Statistics: Posted by essele — Thu Mar 21, 2024 5:37 pm