1

I'm receiving data in UART Rx with DMA and I need to make it inmunne to disconnections. Now, sometimes I can recover the communication after a disconnection, but I need to recover it always.

Using the debugger I realized that huart1.ErrorCode change its value from 0 to 2,4 or 6. I guess they are noise, frame and noise+frame(?) errors, and after this error the UART stops.

How can I handle this error with my HAL_UART_ErrorCallback and resume UART communication?

Thank you!

PD: STM32F407VET6

steevglez
  • 11
  • 2
  • 1
    Does this answer your question? [STM32 UART in DMA mode stops receiving after receiving from a host with wrong baud rate](https://stackoverflow.com/questions/71287996/stm32-uart-in-dma-mode-stops-receiving-after-receiving-from-a-host-with-wrong-ba) – Tom V Jun 23 '22 at 21:40
  • @TomV I think it may answer my question, but how can I restart UART and DMA correctly? I tried this but it didnt't work or I missed something – steevglez Jun 24 '22 at 18:46
  • Clear the enable bit in the DMA, clear all the flags in the DMA and the UART and then restart it the same as you did the first time. – Tom V Jun 24 '22 at 20:40

0 Answers0