cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4: Using two DMA streams with single request

vladimir2399
Associate
Posted on March 21, 2013 at 08:25

Device: STM32F405.

Is it possible to use two DMA streams with single request?

For example, connect DMA2_Stream0 to channel 6 (TIM1_TRIG) and DMA2_Stream4 to channel 6 (TIM1_TRIG, too).

I want to start two diffirent DMA transactions from single request.

#stm32-dma
7 REPLIES 7
Posted on March 21, 2013 at 11:23

9.3.2 mentions that DMA controller acknowledges the requests to the peripherals, so I doubt what you want would be possible.

OTOH, you could probably chain another timer and use that as the trigger source for the second DMA.

JW

Posted on March 21, 2013 at 11:23

Double post due to crappy forum software.

vladimir2399
Associate
Posted on March 29, 2013 at 19:34

Answer to himself.

NO.

I make the experiment.

Run two DMA streams from SPI1_RX. First to transfer data from SPI1->DR to memory, second - transfer other data from memory to GPIO. After 5 requests fisrt NDTR decreased by 2, second - by 4.

Posted on March 29, 2013 at 20:59

Thanks for letting us know 😉

JW

sdim2
Associate II
Posted on March 31, 2013 at 11:44

Do you use only AHB or APB periferals with DMA2 , or you use AHB & APB on a concurrent way?

On the STM32F4 errata, it is documented that there may be data corruption in the second case.

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/errata_sheet/DM00037591.pdf

2.1.9

I think it is possible to use two DMA streams with single request.

On the STM32F4 reference manual (DM0031020.pdf) , 9.3.3, look on the Figure 27. Channel selection

''Each stream is associated with a DMA request that can be selected out of 8 possible channel requests''

According to the documentation, Table 33 (DMA1 request mapping) and Table 34 (DMA2 request mapping) are examples of DMA request mappings.

Try to assign the peripherals you want to use to different channel/stream than it is described in the examples tables.
Posted on March 31, 2013 at 13:45

According to the documentation, Table 33 (DMA1 request mapping) and Table 34 (DMA2 request mapping) are examples of DMA request mappings.

 

Try to assign the peripherals you want to use to different channel/stream than it is described in the examples tables.

Yeah, I don't see that working, that's how they are actually wired. A better idea would be to use different TIMx_CHx combinations on the same timer, like TIM2_CH4, or just using duplicate CCRx values on multiple channels of a singular timer.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
sdim2
Associate II
Posted on March 31, 2013 at 15:03

Initially I also thought that that's how they are actually wired, but the key is the word ''examples''. An example is by definition ''an instance serving for illustration''.

If the reference manual is correct, you do not have to use the DMA request mapping of the example tables. You can map DMA channels & streams as you need for your project.

Otherwise, we should suggest to ST to remove the word ''examples''.