ESP-IDF UART Timeout interrupt

liamm36
Posts: 4
Joined: Mon Jan 24, 2022 12:48 pm

ESP-IDF UART Timeout interrupt

Postby liamm36 » Fri Apr 22, 2022 12:23 pm

Hey,

I am using UART to send commands and receive data from the ESP32. I followed the uart_events example project to setup a UART task with a pattern detection event. This worked fine when I was debugging and manually typing in commands. However when sending commands from an application the character is received but not detected unless I include a delay between the data and pattern detection byte/s.

I saw that there was an UART rx timeout interrupt which seems to be exactly what I am looking for. Receive an unknown amount of bytes and trigger whenever data stops being sent. I have been struggling to find any examples or documentation on how these interrupts actually work. Has anyone had any success?

I can call

Code: Select all

 uart_set_rx_timeout(uart_port_t uart_num, const uint8_t tout_thresh);
 uart_enable_rx_intr(EX_UART_NUM);
Which should enable the interrupt. From the reference manual I found that the interrupt is called UART_RXFIFO_TOUT_INT. Where is the callback for this interrupt, if it doesn't exist what arguments does it take? Is it a shared interrupt, for example if UART1 and UART2 both had rx_timeout interrupts enabled then would the same interrupt be called?

Thanks,
Liam

Who is online

Users browsing this forum: Google [Bot] and 215 guests