From 5dd13b578d35892b677e3933b1dc450f0cc349da Mon Sep 17 00:00:00 2001 From: Erik Englund Date: Mon, 28 Sep 2026 22:10:13 +0200 Subject: [PATCH] arch/risc-v/espressif: Fix dangling else in esp_setup() for RS-485. The RS-485 tx_idle_num block in esp_setup() ends in a bare "else" that binds to the next statement, which is now leave_critical_section(). On an RS-485 port esp_setup() therefore returns with interrupts disabled. uart_open() hides this behind its own critical section, but a tcsetattr() that changes the line settings calls esp_setup() through TCSETS and leaves the calling task running with interrupts off. On an ESP32-C3 the system tick stops advancing in that task. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Erik Englund --- arch/risc-v/src/common/espressif/esp_serial.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/risc-v/src/common/espressif/esp_serial.c b/arch/risc-v/src/common/espressif/esp_serial.c index 8c29b8d16a6..84003b92e6f 100644 --- a/arch/risc-v/src/common/espressif/esp_serial.c +++ b/arch/risc-v/src/common/espressif/esp_serial.c @@ -579,7 +579,6 @@ static int esp_setup(uart_dev_t *dev) { uart_hal_set_tx_idle_num(priv->hal, 1); } - else #endif leave_critical_section(flags);