uart_ERROR callback triggered but errorCode is zero
I am programming a STM32 nucleo-f746ZG development board where I am using USART2 with RX interrupt.
I have setup USART using CubeMx (async, baud:250Khz, data: 8, stopBit: 2, noParity). I am reading a single byte from a DMX stream by calling HAL_UART_Receive_IT(&huart2, rx_buff, 1);
Furthermore, I have declared the two callbacks: HAL_UART_RxCpltCallback() and HAL_UART_ErrorCallback().
I am using the error_callback to detect whenever there is a BREAK in the DMX-stream (afterwards 512 bytes will be recieved) which will trigger an FRAME_ERROR.
The problem is that when the HAL_UART_Error_callback is called, the errorCode from the uart (error = huart->ErrorCode) is returning 0. I am assuming that if the error_callback is being triggered, there must be a value in ErrorCode != 0.
I will check if the error is a frameError and not an overrun error for instance.
I hope someone has an answer to this :)