Skip to main content
NoeMurr
Associate
October 6, 2021
Solved

How to find out which DMA Stream and Channel to use for the USART on a Nucleo F446RE board?

  • October 6, 2021
  • 2 replies
  • 2773 views

Hi all,

I'm trying to implement a class that should allow me to use the USART with the DMA.

It's a learning project in which I'm trying to learn how to retrieve the correct information from the datasheet and the reference manual.

I'm reading the reference manual RM0390 and the datasheet STM32F446xC/E.

I don't understand how I can choose the correct stream and channel for the USART.

take as example the USART1.

At page 207 section 9.3.4 there is the table 28 and 29that is telling me what is connected to the streams and channels, but it's written that they are examples.

Does it means that there is no fixed configuration and that I have to choose or is it the only usable configuration?

If the answer is the first how can I choose?

This topic has been closed for replies.
Best answer by waclawek.jan

> but it's written that they are examples

That's a long outstanding minor (but confusing) deficiency of the RM. No they are not examples, that's a fixed table.

Fort USART1_RX, you can choose between DMA2's Stream 2 or Stream 5. You can't use both, choose any of them. Multiple options are provided to avoid collision with other peripherals, e.g. if you'd want to use TIM1_UP (i.e. Update from TIM1) as DMA trigger, you can't use Stream 5 for USART1 Rx, but still can use Stream 2. There's only one option for USART1_Tx.

After you've chosen, use the given Channel's number in given stream's DMA_SxCR.CHSEL.

JW

2 replies

waclawek.jan
waclawek.janBest answer
Super User
October 6, 2021

> but it's written that they are examples

That's a long outstanding minor (but confusing) deficiency of the RM. No they are not examples, that's a fixed table.

Fort USART1_RX, you can choose between DMA2's Stream 2 or Stream 5. You can't use both, choose any of them. Multiple options are provided to avoid collision with other peripherals, e.g. if you'd want to use TIM1_UP (i.e. Update from TIM1) as DMA trigger, you can't use Stream 5 for USART1 Rx, but still can use Stream 2. There's only one option for USART1_Tx.

After you've chosen, use the given Channel's number in given stream's DMA_SxCR.CHSEL.

JW

NoeMurr
NoeMurrAuthor
Associate
October 6, 2021

Thank you very much.

I imagined it was like that but I couldn't be sure!

Tesla DeLorean
Guru
October 6, 2021

When in doubt, try it out..​

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