2012-02-14 09:10 AM
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-channel2012-02-14 11:10 AM
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 42012-02-23 02:07 AM
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. :>2012-02-24 09:10 AM
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.2012-02-24 11:57 AM
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.