2021-07-16 10:57 AM
Hello,
I am learning MDMA, and have been able to make it work in different scenarios, but I am now stuck.
I want to use MDMA to chain DMA transactions without CPU intervention.
What I want to do with mdma linked list is :
° configure timer in output
° use dma to send pulses
° reconfigure time in input
° use dma to get input capture values
what I do is :
mdma list 1: software triggered, all_blocks :
copie stored dma configuration(to write to timer) to dma
mdma list 2: software triggered, all_blocks: copie stored timer configuration(pwm mode) to timer
mdma list 3: dma tc triggered, all_blocks :
copie stored dma configuration(to read from timer) to dma
mdma list 4: software triggered, all_blocks: copie stored timer configuration(input capture mode)
to timer
The problem I meet is with triggering :
I start mdma with all the linked bloc configured, and it copied dma configuration, dma is active, but wait for timer to be active to chain transaction. Timer configuration should be done by the next linked block, but how to automatically trigger it ?
It get stuck there, and if I manually software trigger the mdma, it works and all 4 transactions are chained well.
What I would need is a unconditional “go to next block�? without any triggering since writing to the timer configuration register do not trig any dma trigger condition.
Using a whole block trigger mode for the first block is neither a solution because it will chain all blocks but will never wait for the completion of the DMA transaction.
I could use MDMA to trigger DMA m2m transaction to fill the timer configuration, then trigger on DMA TC, but that seems over complex to me, is it the only solution ?
Thanks for any help
Alexandre
2021-08-23 06:45 AM
For the record, I have yet not found a really good solution, but have found another work around. First workaround I used was to use software request mode, and trigger the request in an ISR driven by repeat buffer IRQ. that method add jitter to the timing.
So another work around is to enable JPEG decoder (I can do that since I do not need JPEG in my application) and to trigger to MDMA_TRIGGER_JPEG_INPUT_FIFO_NOT_FULL. Since I do not use JPEG, this condition is always true and trigger linked list reload unconditionally.
I am still looking for the right way to do it, something which does not look hackish ...