Uart RX losing data when recieving data at high baud rates
Posted: Fri Jan 31, 2020 2:21 pm
So set up a serial port to work at 115200bps. Once I have the rest of my code stable I want to go up to 460800 bps to reduce data transfer times.
The CPU frequency is set to 240Mhz
I process the data in the event handler set up for that RX.
I look for a terminating character eg \r of \n. when I find terminating character I copy it to a message que and fire it at task that deals with that uart.
Currently I am transferring a Server Certificate via serial to be stored in a file in spiffs.
What I am seeing is basically every 128 chars I lose 8 to 10.
Currently I am using 2 uarts eg one as a debugging console ( eg the default console uart used for programming and the output of
ESP_LOGI() the other is the uart interface to an embedded device.
So:
is this a conflict of buffers etc I have set up ring buffers of 256 I use to pass data between FreeRtos tasks but I see the uarts have
#define UART_FIFO_LEN (128) /*!< Length of the hardware FIFO buffers */
#define UART_FULL_THRESH_DEFAULT (120)
https://www.espressif.com/sites/default ... f#page=343
Or
Priorities and processing speed of the message ques and FreeRtos
I am going to start investigating but basically am I spending to long in the event handler looking for a terminating character, then bundling up the data to sent via a message que to hold the event handler so the RX isr handler misses characters.
Those who use the uarts to transfer data what is the fastest stable speed you have it working with when you transfer more than 120 consecutive bytes ?
Thanks in Advance for any contribution
Danny
The CPU frequency is set to 240Mhz
I process the data in the event handler set up for that RX.
I look for a terminating character eg \r of \n. when I find terminating character I copy it to a message que and fire it at task that deals with that uart.
Currently I am transferring a Server Certificate via serial to be stored in a file in spiffs.
What I am seeing is basically every 128 chars I lose 8 to 10.
Currently I am using 2 uarts eg one as a debugging console ( eg the default console uart used for programming and the output of
ESP_LOGI() the other is the uart interface to an embedded device.
So:
is this a conflict of buffers etc I have set up ring buffers of 256 I use to pass data between FreeRtos tasks but I see the uarts have
#define UART_FIFO_LEN (128) /*!< Length of the hardware FIFO buffers */
#define UART_FULL_THRESH_DEFAULT (120)
https://www.espressif.com/sites/default ... f#page=343
Or
Priorities and processing speed of the message ques and FreeRtos
I am going to start investigating but basically am I spending to long in the event handler looking for a terminating character, then bundling up the data to sent via a message que to hold the event handler so the RX isr handler misses characters.
Those who use the uarts to transfer data what is the fastest stable speed you have it working with when you transfer more than 120 consecutive bytes ?
Thanks in Advance for any contribution
Danny