Closed ijager closed 3 years ago
So first half done interrupt
means that first half of the bytes from tx_dma_buf_addr
are transferred and you can write new bytes to this half.
Next half done interrupt
means that second half of the bytes are transferred and now you can fill this in.
If new bytes are written with every half done interrupt
DMA is hot and should transfer without pausing.
Probably there are some fineprint details that must be done for this to actually happen.
I see, I guess you need to enable circular mode then
Yes circular mode must be enabled.
Just recently this came in where circular DMA transfers are used for ADC and actually also for UART: https://github.com/stm32-rs/stm32g0xx-hal/pull/58
This is still WIP right?
Not really, I think a circular-dma could be another example. The way this example works is exactly how I am using it now in a project, so I guess it is still a valid use case for periodic but not continuous transfers.
Thanks, then I am going to merge it.
The
uart-dma
example only did one transfer. I have adjusted it to do repeated transfers. However I am not sure if this is the right way to prime a new dma transfer.Am I supposed to disable and re-enable the dma channel to issue a new transfer?
So far this is the only way I managed to do a next dma transfer. Also setting the transfer length (number of bytes in this case) again seems to be a requirement, which makes sense I guess.
Is there another way besides
dma.ch1.disable()
? For example when you're using the transfer-half-done event, I think the idea is to do non-stop dma transfers right?