Unable to use UART0 on ESP32 DevKitC v4

yurkoyurko
Posts: 1
Joined: Wed Sep 06, 2023 8:18 am

Unable to use UART0 on ESP32 DevKitC v4

Postby yurkoyurko » Wed Sep 06, 2023 8:22 am

I have a problem with using UART0 on development board ESP32 DevKitC v4 with micropython. I am trying to open UART0 with this line: [Codebox]uart_trace = machine.UART(0, baudrate=1000000, tx=1, rx=3)[/Codebox] and listen data with this line:[Codebox] if uart_trace.any()[/Codebox] but this IF nevers happens. I tried to use UART1 and UART2 with same procedure ([Codebox]machine.UART(1, baudrate=1000000, tx=1, rx=3)[/Codebox], [Codebox]machine.UART(2, baudrate=1000000, tx=1, rx=3)[/Codebox]) and it works as expected. I am assuming that my problem is related to the fact that UART0 is used for REPL and this blocks it from using it for my purpose. Does anybody knows how to fix this? I also tried to detach REPL from UART0 as stated in micopython documentation with this line: [Codebox]os.dupterm(None, 1)[/Codebox], but also no success.

Who is online

Users browsing this forum: No registered users and 110 guests