I am working with an ESP32-C6 and need to handle UART RX interrupts byte-by-byte without creating a FreeRTOS task. I found that uart_isr_register() is deprecated in ESP-IDF 5.0+, so what is alternate approach or any example code
Requirements
Use interrupt-based UART RX handling (without polling or tasks).
Handle incoming bytes individually inside the ISR.
Manually clear interrupt flags to avoid re-triggering
UART ISR handaling in ESP IDF 5.0 +
-
MicroController
- Posts: 2663
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: UART ISR handaling in ESP IDF 5.0 +
Any specific reason for this?without creating a FreeRTOS task.
-
teja.godavarthi
- Posts: 2
- Joined: Fri Nov 04, 2022 10:24 am
Re: UART ISR handaling in ESP IDF 5.0 +
Yes, when around 100 bytes of data are received from an external source, the task waits until all bytes are received. This delay is causing a timeout in my application. If I had an ISR (Interrupt Service Routine) that triggers on each byte received, it would help handle the data more efficiently and avoid the timeout.
-
MicroController
- Posts: 2663
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: UART ISR handaling in ESP IDF 5.0 +
You can change this behavior by
1) setting a low "RX full threshold", e.g. via uart_set_rx_full_threshold(), and either
2a) using the "event-based" programming model of the UART driver (where the driver sends you "events" via a FreeRTOS queue), or
2b) reading any data via uart_read_bytes() as it becomes available, see viewtopic.php?p=147877#p147896
1) setting a low "RX full threshold", e.g. via uart_set_rx_full_threshold(), and either
2a) using the "event-based" programming model of the UART driver (where the driver sends you "events" via a FreeRTOS queue), or
2b) reading any data via uart_read_bytes() as it becomes available, see viewtopic.php?p=147877#p147896
Who is online
Users browsing this forum: meta-externalagent and 3 guests