cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use usart2 DMA for RX and TX at the same time ?

michaelmccartyeng
Associate II
Posted on March 17, 2014 at 23:01

Previously I was using usart2 dma TX and had an int and isr that would handle the RX data.

Can I have the dma enabled for both tx and rx for usart 2 ? It seems weird them both pointing at the same DR ?

I've figured out the streams to use and about to start test/modifying, just wanted to check that what I'm doing is possible.

Thanks
2 REPLIES 2
Posted on March 17, 2014 at 23:28

The USART->DR points at different internal registers, peripherals generally don't behave like memory cells.

Some other TX/RX examples

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/DMA%20Memory%20To%20UART5&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2618

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
michaelmccartyeng
Associate II
Posted on March 18, 2014 at 03:50

Thanks Clive, great examples. I've replaced my interrupt based circular buffer with a dma circular buffer. I still use the interrupt but just to calculate the size, I have a wrapper that has helper functions and such to deal with the dmabuffer, perform crc and find other buffers within that buffer.