I would like some help with a uart problem please. I have an esp32 that needs to talk with two other esp32's with low latency. I have chosen to use UART_NUM_1 & UART_NUM_2 for this purpose. I am running them at 16 Mbaud, which they seem to cope with OK. I am using uart_write_bytes() with a tx ringbuffer of 1024*2 bytes. However I am only transferring up to 16 bytes of data per write. My problem is that uart_write_bytes() takes much longer than expected to execute ~ 12ms.
The uart_write_bytes() is used within a high priority task (configMAX_PRIORITIES-1). I have timestamped various points in the Espressif driver. The uart_write_bytes(), including its internal function uart_tx_all(), only takes around 121us to execute, but the final return, containing the bytes written, takes 99% of the time, over 11ms.
To get the timestamps I am using esp_timer_get_time(), and writing the data to a queue. The queue is handled by a low priority task and outputs the result to the console.
I am using a rtos Tick rate of 1000Hz and the CPU frequency is 240MHz.
I am using release/V4.2 commit 48c9f47247
Any advice or insights would be appreciated.
Thanks
slow UART write
Re: slow UART write
Apologies folks - ignore the above, I made a very basic mistake.
Who is online
Users browsing this forum: No registered users and 110 guests