Closed techping closed 6 years ago
I use your code to implement a subscriber, but it always causes the error: Lost sync with device, restarting.
.
Finally, I found out that the problem is that the receive buffer rbuflen
overflowed.
So, I call HAL_UART_Receive_DMA(huart, rbuf, rbuflen);
in HAL_UART_RxCpltCallback(), and then the problem is solved.
@techping I fixed the issue with your kindly advice. Thanks a lot!
@yoneken You are welcome. :-) BTW, I have modified your code to run on my stm32f407 discovery board. And it can work now.:grinning:
Pull requests are always welcome! :smiley_cat:
Hello, I saw all your examples are publishers, and both call flush() in HAL_UART_TxCpltCallback(). If I want to implement a subscriber, whether I need to do something in HAL_UART_RxCpltCallback()?