cancel
Showing results for 
Search instead for 
Did you mean: 

Can STM32 DMA chaining be used so that the end of a DMA transfer starts another on a different channel?

DSudo.2
Associate III

I think from what I've read this should be possible, but before diving into the details and trying to make it work I'm hoping someone can just give me a yes/no answer for this question. Basically, what I'm trying to do is use DMA to send a block of SPI data and when that block is done start another DMA transfer on another channel sending a very short block of data to a GPIO port BSRR register to toggle some I/O pins and when that block is done restart the first DMA transfer of SPI data. The idea is that the SPI data followed by the toggling of a few I/O pins (all on the same GPIO port, through a sequence) in an infinite high speed loop. Can MDMA be used to make this happen on an STM32 micro?

Thanks.

1 REPLY 1
waclawek.jan
Super User

There is no MDMA in the 'C0 family.

Something similar to what you've described might be possible using the event-generation on DMAMUX, but it depends on exact details. However, traditionally, framing signals are generated using timers, which then also start the SPI-DMA process.

Start with reading the DMA/DMAMUX chapters in RM, then implement plain DMA-SPI transfer, and then start experimenting with DMAMUX.

JW