cancel
Showing results for 
Search instead for 
Did you mean: 

Flush USART RDR after receiving

aragonlockheart
Associate
Posted on September 27, 2016 at 17:11

Dear all,

I am using STM32F4 Discovery board and have some problems with using DMA on USART.

The cause may be the unwanted left behind data inside USART RDR.

Would you please kindly give me instruction how can I flush data out of RDR after finish receiving data?

I am writing my own HAL driver for USART.

#stm32
2 REPLIES 2
Posted on September 27, 2016 at 17:24

It has no real depth, read it until RXNE clears, it may keep returning the last value, but this is of no consequence and can be ignored.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
slimen
Senior
Posted on September 27, 2016 at 17:30

Hello,

You may review USART example using DMA under this path: 

 STM32Cube_FW_F4_V1.13.0\Projects\STM32F4-Discovery\Examples\UART\UART_TwoBoards_ComDMA

For more details refer to the

http://www.st.com/content/ccc/resource/technical/document/reference_manual/3d/6d/5a/66/b4/99/40/d4/DM00031020.pdf/files/DM00031020.pdf/jcr:content/translations/en.DM00031020.pdf

in ''30 Universal synchronous asynchronous receivertransmitter (USART) '' section.

Regards