cancel
Showing results for 
Search instead for 
Did you mean: 

uart DMA lose data under baudrate 921600, but it works under baudrate 115200

wwwsinsh
Associate II

my board is nucleo64 f401re. I used DMA and Idle interrupt to receive data of uncertain length. it works when baudrate is 115200. but it receives up to 16 bytes under baudrate 921600, other bytes has been losed. I want to higher speed, how to fixed this problem

7 REPLIES 7

If you don't use circular DMA, do use it.

JW

You'd likely need to use circular, perhaps with a larger buffer.

The call-back routines must be fast and efficient as they are called under interrupt context.

If one transfer completes the next must be started quickly.

Do you get any error status reporting from the DMA or UART? Like over/under run conditions?

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

Break interrupt and dma interrupt are not synchronised, when the baudrate goes up, the lag between the two may be critical.

Pavel A.
Evangelist III

Break interrupt? what is this?

the buffer is large enough to receive datas and there is no error

S.Ma
Principal

Break is not a data code byte that you can put in a buffer by dma. Using a pause in transmission generates an exception to manage and synchronize with data flow, raising the complexity.

Console and terminal use markers like return 0x0D and/ or line feed 0x0A to slice de continuous data stream in packets to process since PC DOS.... very high tech, very unproven ?

Tilen MAJERLE
ST Employee

You can find the explanation how to implement DMA circular mode on the link: https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx