From 1d0a70bb4b0717b206a17c1ee6d5e2261bef1492 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Mon, 23 Jun 2025 15:57:11 -0300 Subject: [PATCH] fix(uart): removes assert() to avoid reset --- cores/esp32/esp32-hal-uart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 2163e9b5f42..21fe88b57fb 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -305,7 +305,10 @@ static bool _uartTrySetIomuxPin(uart_port_t uart_num, int io_num, uint32_t idx) } // Assign the correct function to the GPIO. - assert(upin->iomux_func != -1); + if (upin->iomux_func == -1) { + log_e("IO#%d has bad IOMUX internal information. Switching to GPIO Matrix UART function.", io_num); + return false; + } if (uart_num < SOC_UART_HP_NUM) { gpio_iomux_out(io_num, upin->iomux_func, false); // If the pin is input, we also have to redirect the signal, in order to bypass the GPIO matrix.