cancel
Showing results for 
Search instead for 
Did you mean: 

Lossless data processing

Ahajr.1
Associate II

Hello,

I'm working with STM32F410RB , My question is not related to code but it's architectural. I'm using DMA uart to communicate with another device, i noticed that dma buffer change its content before my code processing the data. So i'm loosing some data. I wanted to know what are your methods to process all the data from UART without losing some of them.

Best regards,

2 REPLIES 2
TDK
Guru

Make the buffer bigger, process the first half of the buffer on the half-complete DMA interrupt and the second half of the buffer on the complete interrupt.

Or poll NDTR and process bytes as they come on.

If your processing takes so long that data comes in faster than it can be processed, then nothing can save you.

If you feel a post has answered your question, please click "Accept as Solution".
Piranha
Chief II

Use double buffering either by two memory addresses on DMA or by half/full transfer complete interrupts on a single buffer. For general USART principles look here:

https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx