UART DMA Capture Restart.
Hi, I need a little help with this situation.
I have to receive a packet from a serial port, this packet has a variable size and is also quite long. So I use two areas of RAM as a buffer and alternatively send the data to an external flash. I tried using the UART's IDLE line interrupt, but I haven't been able to use it in combination with the DMA double buffer. This would be the best solution and if someone could help me make it work it would be great.
For now I have done it this way, I have added a timer, and if no data is received for a certain time, the package is considered finished.
Everything works, I just have a doubt, in the timer callback, when the package is finished, I have to delete the residual data in the UART and restart the capture, for now I have done this:
HAL_UART_DMAStop(&huart1);
HAL_UART_Receive_DMA(&huart1, usartRxBuffer, DATA_PACKET_SIZE);Just wanted to ask if it's the right way to "restart" the UART?
And if anyone has suggestions for DILE line interrupt with the double DMA buffer it is always welcome:grinning_face: .
Thanks in advance.
