cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f4 UART HAL losing bytes

123456
Associate II
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
3 REPLIES 3
adam23
Associate II
Posted on September 13, 2016 at 13:35

Incorrect baud rate/clock on UART?

123456
Associate II
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
Senior
Posted on September 14, 2016 at 10:57

What baudrate are you using? Clock settings for mcu ?

Some buffer overflows ?