Uart driver Install fail - ESP_ERR_NOT_FOUND

taruroy
Posts: 4
Joined: Thu Feb 07, 2019 1:14 am

Uart driver Install fail - ESP_ERR_NOT_FOUND

Postby taruroy » Mon Apr 29, 2024 8:28 pm

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.

MicroController
Posts: 1706
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Uart driver Install fail - ESP_ERR_NOT_FOUND

Postby MicroController » Mon Apr 29, 2024 8:54 pm

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.

Who is online

Users browsing this forum: No registered users and 66 guests