MBED EVB_Odin_W2 Missing Serial Messages over Baud Rate 57600

Hey Guys,

Reaching out because I am having trouble receiving complete data at Baud Rates over 57600 (115200/230400,ect).

For the use case that we have, we are using a separate microcontroller with embedded sensors to take readings at high frequency and then sending these readings to Odin board via serial to be collected, parsed, structured, and sent out via Wi-Fi .However, I have noticed that at higher baud rates (anywhere above 57600) I am losing continuity of the readings from the external microcontroller and the Odin board seems to be dropping out values. Is this something you have seen before? Also is there some way around this or some optimization that can be done to ensure the Odin board can read and process the values at a rate of 115200+?

Please see my examples below to better understand the tests I have done and Why I believe the data is dropping out :

Here I set baud rate to 115200 (on both microcontroller AND Odin) and I can see the reading identifier appended to the messages from the sensor readings are not continuous (skip numbers. You can see jumps from 4399 to 4401 to 4403, etc.):

If I look at the serial connection from the microcontroller directly (with a usb to serial adapter), I can see the sensor data coming from the microcontroller IS continuous (microcontroller is not the bottleneck for the data stream)

However, If I drop the baud rate on the microcontroller AND Odin to 57600, only then do I start seeing all data (continuous) on the Odin side:

Any and all insight and advice is appreciated. Please let me know if you need any more details!

Also, for clarity, I am delimiting messages with the Character ‘e’ and using a find on that character to split readings like this:

Hello,

what MbedOs version do you exactly use? It is not MbedOS 6+.
Try to use the printf with object `pc_uart.printf(); if something change.

BR, Jan

I believe i am using mbed_os 5. I was able to get around the issue i was having before by writing multiple readings to the same buffer and then splitting those readings with delimiters and parsing them in a separate thread. However, now I’m seeing that for some reason i am skipping every other packet now and I’m not sure why. Still, if i am able to run a baud rate greater than 115200 that would be great to know how.

With new buffer logic :

I worked through this and found out that having all of the print statements was slowing the data transfer and causing me to miss readings. If i extended my buffer to hold 5 readings and only printed once at the end of 100,000 readings i can see continuity in my data for a baud rate up to 921600. Would like to try a baud rate higher than that but to my knowledge 921600 is the highest baud rate supported by UART. Please someone correct me if i can go any higher than that.

https://os.mbed.com/forum/mbed/topic/893/?page=1#comment-4415