cancel
Showing results for 
Search instead for 
Did you mean: 

Can the STM32F4 controller allow for two DMA requests on the same peripheral? If not, how can the DMAMUX be utilized to allow such a case?

EGold.3
Associate II

0693W00000KackTQAR.pngUsing an STM32F429 board, I am attempting to enable DMA transfers for the UART8 TX and RX. However, while reading the data sheet, I found the following DMA channel/stream mapping:

0693W00000KacfxQAB.png 

You'll note that for the UART8 TX and RX DMA request, both requests live in the same channel, but different requests. When I attempt configure both the TX and RX request in Cube, I get the following error a second DMA request addition is not allowed for the peripheral. Can the STM32F4 MCU's not handle the same DMA request channel being mapped to one peripheral? And if so, can the DMAMUX be used to get around it?

8 REPLIES 8

Channel and Stream naming is confusing. The STREAM is the unique DMA sub-unit.

Each stream has multiple channel sources (input mux, trigger), CH5 STREAM 0 being mapped UART8_TX ie UART8->SR.TXNE

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

UART5 or UART8 ?? Screen shows one, you talk about the other.

UART5_RX can't coexist with UART8_TX. Unfortunately that's just going to be a limitation. Technically the resource could be managed and shared, but likely me trouble than it's worth.

The TX DMA is easier to chain with a scatter/gather method, so I'd probably prioritize that over RX.

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

You can only assign one channel to a given stream. So Steam 0 can either be UART5_RX or UART8_TX, but not both. No way to get around that hardware limitation. Choose a different UART.

There is no issue assigning the same channel to multiple streams, but it doesn't help you here.

If you feel a post has answered your question, please click "Accept as Solution".

I see. The UART communication is strictly half duplex, so I'm not worried about conflicts of reception during transmission or vice versa

Would it possible to configure both UART8 DMA RX and TX and just disable one while using the other?

Apologies, meant to write UART8 TX and RX. What do you mean by scatter/gathering in this case for the TX DMA?

There is no conflict between UART8_RX and UART8_TX. Why would disable one to run the other one?

The DMA has 8 streams. Each stream can only do one thing (channel) at once.

If you feel a post has answered your question, please click "Accept as Solution".

The conflict is on stream 0 which can either be set to UART5_RX or UART8_TX, but not both.

If you feel a post has answered your question, please click "Accept as Solution".

> Apologies, meant to write UART8 TX and RX. What do you mean by scatter/gathering in this case for the TX DMA?

I'm not sure what Clive meant by scatter/gather - the DMA in 'F4 does not support scatter/gather directly but maybe he meant some workaround emulating that.

Or maybe he was referring to the fact that Tx is not such a time-critical operation than Rx is, so you can perform timer-triggered DMA onto Tx, or just simply use Tx in interrupt or polled form.

JW