diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 4863b6340b1..1f439a7a9a1 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -762,8 +762,8 @@ static void endrx_isr(struct device *dev) .type = UART_RX_DISABLED, }; user_callback(dev, &evt); + return; } - return; } data->async->is_in_irq = true; @@ -813,6 +813,11 @@ static void endrx_isr(struct device *dev) user_callback(dev, &evt); } + if (!data->async->rx_enabled) { + data->async->is_in_irq = false; + return; + } + struct uart_event evt = { .type = UART_RX_BUF_RELEASED, .data.rx_buf.buf = data->async->rx_buf, @@ -1263,6 +1268,7 @@ static int uarte_instance_init(struct device *dev, NRF_UARTE_Type *uarte = get_uarte_instance(dev); struct uarte_nrfx_data *data = get_dev_data(dev); + nrf_gpio_pin_write(config->pseltxd, 1); nrf_gpio_cfg_output(config->pseltxd);