interrupt routine for uart receiver (ESP32)

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Ankit1234
Posts: 2
Joined: Sat Sep 11, 2021 3:07 pm

interrupt routine for uart receiver (ESP32)

Post by Ankit1234 » Sat Sep 11, 2021 3:17 pm

I am writing UART receive interrupt routine for ESP32.But I am getting below error
"AttributeError: 'UART' object has no attribute 'irq' "
I have used the below syntax for UART receive interrupt

UART.irq(trigger, priority=trigger=UART.RX_ANY, handler=UART_interrupt_Routine, handler=None, wake=machine.IDLE)
Is this the correct function/method for UART interrupt for ESP 32 board?
If not then what is the syntax and in built function/method for this?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: interrupt routine for uart receiver (ESP32)

Post by Roberthh » Sat Sep 11, 2021 3:33 pm

There is no irq method for the UART class for the ESP32. UART.irq() is only available for the CC3200 port (WiPy). The ESP32 UART implementation uses IRQ internally and buffers the received data. The buffer size can be set with the rxbuf option.

Ankit1234
Posts: 2
Joined: Sat Sep 11, 2021 3:07 pm

Re: interrupt routine for uart receiver (ESP32)

Post by Ankit1234 » Sat Sep 25, 2021 3:52 pm

Could you tell me, how to set RX buffer and initialize Rx interrupt register in python?

Post Reply