Dropping bytes with 3 mb/s UART
Posted: Fri Jun 28, 2019 4:30 pm
Hello!
I'm working on a project with a stm32f0-discovery board talking to a BNO080 IMU over UART.
The IMU has it's own framing/serialization scheme and appears to be hard coded to talk at a 3000000 baud rate. After looking at the chatter with a logic analyzer, it's clear that it is properly responding to the requests that are sent from UART1. However, when I do a sdReadTimeout it is equally clear that I am losing bytes.
For instance, the response from the IMU is suppose to have 2 bytes for framing, 4 bytes for the header and then a message beginning with 0xF8. And this is what I see with my logic analyzer. However, the data returned from sdReadTimeout shears off the byte before the message start 0xF8 every single time. Looking at it further seems to indicate that it is losing random bytes from the data as well.
If I may ask, is 3 mb/s just too high to be expected for UART reads with this chip? Is there something I should be doing that I haven't been to try to avoid data loss?
Uart config:
static const SerialConfig uart2_config =
{
3000000, //"3 Mb/s" baud rate
0,
USART_CR2_STOP1_BITS,
0
};
I'm working on a project with a stm32f0-discovery board talking to a BNO080 IMU over UART.
The IMU has it's own framing/serialization scheme and appears to be hard coded to talk at a 3000000 baud rate. After looking at the chatter with a logic analyzer, it's clear that it is properly responding to the requests that are sent from UART1. However, when I do a sdReadTimeout it is equally clear that I am losing bytes.
For instance, the response from the IMU is suppose to have 2 bytes for framing, 4 bytes for the header and then a message beginning with 0xF8. And this is what I see with my logic analyzer. However, the data returned from sdReadTimeout shears off the byte before the message start 0xF8 every single time. Looking at it further seems to indicate that it is losing random bytes from the data as well.
If I may ask, is 3 mb/s just too high to be expected for UART reads with this chip? Is there something I should be doing that I haven't been to try to avoid data loss?
Uart config:
static const SerialConfig uart2_config =
{
3000000, //"3 Mb/s" baud rate
0,
USART_CR2_STOP1_BITS,
0
};