Page 1 of 1

Uart driver Install fail - ESP_ERR_NOT_FOUND

Posted: Mon Apr 29, 2024 8:28 pm
by taruroy
Chip: ESP32S3
IDF: 4.4

When calling

Code: Select all

uart_driver_install(UART_NUM_1, rx_buf, tx_buf, q_size, &queue, 0);
The call fails with ESP_ERR_NOT_FOUND about 5% of the times. Hence the problem is not easily reproducible.
I replaced the call with 3 different calls

Code: Select all

esp_err_t err = uart_driver_install(UART_NUM_1, rx_buf, tx_buf, q_size, &queue, ESP_INTR_FLAG_LOWMED); // same as using 0
if (err == ESP_ERR_NOT_FOUND)
esp_err_t err = uart_driver_install(UART_NUM_1, rx_buf, tx_buf, q_size, &queue, ESP_INTR_FLAG_HIGH);
if (err == ESP_ERR_NOT_FOUND)
esp_err_t err = uart_driver_install(UART_NUM_1, rx_buf, tx_buf, q_size, &queue, ESP_INTR_FLAG_SHARED);
Now when the error happens, it fails install with both LOWMED and HIGH interrupt flags but succeeds with SHARED flag. However, with SHARED flag the uart communication doesn't work.

Re: Uart driver Install fail - ESP_ERR_NOT_FOUND

Posted: Mon Apr 29, 2024 8:54 pm
by MicroController
You may be running out of interrupts on one CPU core. Try initializing/allocating one or more drivers/interrupts from a task pinned to one core. If this fails, try with the other core.