2021-09-06 01:23 AM
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,
2021-09-06 09:12 AM
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.
2021-09-06 03:13 PM
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: