Skip to main content
123456
Associate
September 13, 2016
Question

stm32f4 UART HAL losing bytes

  • September 13, 2016
  • 3 replies
  • 1010 views
Posted on September 13, 2016 at 11:20

Hi All,

I'm working on stm32f411 borad with hal library.

I'm using the UART without knowing the exact size I suppose to get so I'm using HAL_UART_Receive_IT to get the first byte of the data and afterwards I use HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout) for reading the rest of the data with timeout.

The problem is that every now and then I lose couple of bytes on the way although I see them on the scope.

Every idea will be much appreciated,

Gilad
    This topic has been closed for replies.

    3 replies

    adam23
    Associate II
    September 13, 2016
    Posted on September 13, 2016 at 13:35

    Incorrect baud rate/clock on UART?

    123456
    123456Author
    Associate
    September 13, 2016
    Posted on September 13, 2016 at 13:45

    The baud rate is correct, I send known data of 155 bytes and I get all of it instead of couple of bytes in the middle.

    troy1818
    Associate III
    September 14, 2016
    Posted on September 14, 2016 at 10:57

    What baudrate are you using? Clock settings for mcu ?

    Some buffer overflows ?