From 3b232d5e079afc7f41cb3280796b696f16a9c53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Mon, 22 Apr 2024 10:45:22 +0200 Subject: [PATCH] drivers: serial: uart_nrfx_uarte2: Disable RX when error is reported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the API specification when RX error occurs receiver shall be disabled. Adding missing disabling to the error handler. Signed-off-by: Krzysztof Chruściński --- drivers/serial/uart_nrfx_uarte2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/serial/uart_nrfx_uarte2.c b/drivers/serial/uart_nrfx_uarte2.c index e00fe7a6d0a..86a81e92bdb 100644 --- a/drivers/serial/uart_nrfx_uarte2.c +++ b/drivers/serial/uart_nrfx_uarte2.c @@ -359,6 +359,9 @@ static void evt_handler(nrfx_uarte_event_t const *event, void *context) break; case NRFX_UARTE_EVT_ERROR: data->async->err = event->data.error.error_mask; + if (IS_ASYNC_API(dev)) { + (void)uart_rx_disable(dev); + } break; case NRFX_UARTE_EVT_RX_BUF_REQUEST: on_rx_buf_req(dev);