cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_UART_ErrorCallback always shows huart->ErrorCode value as Zero

Sagar9
Associate

Hi there, using the callback function HAL_UART_ErrorCallback, I am receiving UART errors. However, what is odd is that handle->ErrorCode has 0 value always. That is, there is a mistake but no error code. I believe the STM32L431 UART driver contains a logical mistake. 

3 REPLIES 3
TDK
Guru

Please include your chip part number in your post.

Set a breakpoint in HAL_UART_ErrorCallback and look at the call stack to see where and why the error callback is being called.

If you feel a post has answered your question, please click "Accept as Solution".

Hi TDK thank you for response. I have attached the images for your reference in word file.   

Yeah, you could be right. That's pretty complicated for me to trace the logic. But now that you know what happens, and that ErrorCode is cleared when you restart the transfer, you can use that info to find out what the error is and fix the issue.

If you feel a post has answered your question, please click "Accept as Solution".