cancel
Showing results for 
Search instead for 
Did you mean: 

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

NoeMurr
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

> 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

View solution in original post

3 REPLIES 3

> 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
Associate II

Thank you very much.

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

When in doubt, try it out..​

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