cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 uart rx dma broke, is there any idea?

ctc.ctc
Associate II
Posted on July 10, 2016 at 11:21

I use stm32f427 to do a work,

recently, I hope to use dma to get uart rx data,

but I found there a strange situation that sometimes the dma will broke and I cannot find why

any other functions keep working, but only the uart rx dma just do nothing,

I use ''DMA_GetCmdStatus()'' and it's in ENABLE status,

the buffer will not get new uart rx data and the counter keep the same value.

The most strange, it will not broke when I setting the address and counter value, just like I set the dma size 20,  every situation dma broke, it will recieve 1data, and then broke, the counter value keep 19, and never change again

I not sure why, and don't have any idea, can anyone give me some hint, thank you a lot

#stm32 #dma #uart
2 REPLIES 2
Posted on July 10, 2016 at 14:56

Does the USART get a framing, parity or overrun error that needs clearing? Is the DMA configured in a circular mode, or do you reconfigure it frequently?

Provide a complete and concise example illustrating the issue.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
ctc.ctc
Associate II
Posted on July 11, 2016 at 12:33

Thank you for giving me some hint. That I found it's the ''OverRun'' problem, I check this from getting flag information.

 

I use normal dma mode. I would like to use like circular buffer, so I set dma address and count when the DMA ISR occur. In overrun situation, I think I may lose some data. But if the dma cannot keep working, it's really a trouble, how can I do and make dma keep going, even some data will lose

thank you