cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F2 STM32F4 DMA Streams and Channels

gordon239955_st
Associate II
Posted on February 14, 2012 at 18:10

Hi Guys,

I'm hoping someone can clarify the relationship and use of Streams and Channels on the STM32F2 DMA Controller.

I'm unclear whether a Stream can concurrently handle multiple channels, or whether it hadles only one at a time.

What I'm at present trying to do is allocate to each USART Tx its own channel on DMA2/Stream2, thinking that they would all be useable at the same time. But I note that DMA_Cmd() has only a Stream argument, not a Channel argument, so I think I may have misunderstood.

Thanks.

           Gordon

#stm32f2-dma-stream-channel
4 REPLIES 4
Posted on February 14, 2012 at 20:10

Each DMA unit supports 8 concurrent streams, triggered by one of 8 channels

There is a matrix in the reference manual (RM0090), pick an input channel for each of the stream columns. Pg 165, Doc ID 018909 Rev 1

USART6_RX  Stream 1, Channel 5

USART6_TX Stream 6, Channel 5

USART1_RX Stream 2, Channel 4

USART1_TX Stream 7, Channel 4

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gordon239955_st
Associate II
Posted on February 23, 2012 at 11:07

Thanks Clive,

That's as I'd suspected. 16 concurrent streams, only one channel at a time per stream.

I'd originally formed the impression that I could use the whole matrix of streams+channels and was in the process of setting up generic drivers for all six USARTs/UARTs, but clearly it'll not work quite as easily as that.

Obviously with ''only'' 16 streams, I have to be less cavalier with my DMA thinking. :>

gordon239955_st
Associate II
Posted on February 24, 2012 at 18:10

I notice that you say to pick from the matrix, but the manual says the matrices are ''examples of DMA request mappings.''

Any idea whether they are really examples, or really fixed?

G.

Posted on February 24, 2012 at 20:57

I guess you'd need to direct that to your local ST FAE, or if any turn up here, I only have access to the same documentation as everyone else.

Based on what I've seen with the STM32F1, and the diagrams for the F2 and F4, the matrix represents your entire choice space, you get to pick one source from each column for concurrent DMA operations.

If you can serialize your device access, you could perhaps switch sources, but that clearly imparts a higher level of complexity.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..