Over-run error on STM32L010RB USART2 using HAL
Hi, under what circumstances does HAL_UART_ErrorCallback get called with the USART_ISR_ORE flag set in the ISR register?
We have a simple FreeRTOS project that is experiencing this error. It happens randomly, possibly after running for several minutes, or possibly several hours.
The project currently does nothing more than configure USART2 on two identical targets to echo a 64-byte block of data to each other repeatedly, initially using HAL_UART_Transmit_IT(&huart2, buf1, buf1size); on one of the targets, and then HAL_UART_Receive_IT(&huart2, buf2, buf2size); and HAL_UART_Transmit_IT(&huart2, buf2, buf2size); on both targets to echo back the received data. buf1size and buf2size are both 64. The USART2's are configured for quite slow communication - 9600 baud, 8 data bits, 1 stop bit, no parity, and no hardware flow control.
Interestingly, we can cause the over-run to occur, simply by running one of the targets in the STM32CubeIDE debugger, and toggling a breakpoint at a random line of code. The breakpoint does not actually get triggered, but the action of toggling it causes the over-run error, with huart2.RxXferCount somewhere in the middle of the 64-byte transfer.
Why does the overrun happen? Why especially with such a slow baud rate? Any help to understand this would be much appreciated. Thank you!
