Skip to main content
Visitor II
January 17, 2024
Question

HAL_UART_ErrorCallback always shows huart->ErrorCode value as Zero

  • January 17, 2024
  • 1 reply
  • 1268 views

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. 

    This topic has been closed for replies.

    1 reply

    Super User
    January 17, 2024

    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.

    Sagar9Author
    Visitor II
    January 18, 2024

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

    Super User
    January 18, 2024

    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.