From 73feaaf931682288b9da4b241575e28a508cbcf8 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 26 Sep 2024 10:32:04 +1000 Subject: [PATCH] rp2/machine_uart: Fix dropped UART REPL bytes on soft reset. Necessary to fix "mpremote run" over hardware UART. Bisect shows bug was introduced by d420b4e4, but looks like made more complex by 01c046d2. Specifically: resetting and re-initialising the REPL UART during soft reset clears the FIFO before it's done printing the "MPY: soft reboot" line. Fixed by adding a UART TX flush in the deinit path. Signed-off-by: Angus Gratton --- ports/rp2/machine_uart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/rp2/machine_uart.c b/ports/rp2/machine_uart.c index 689906003e7dc..955e4a8479913 100644 --- a/ports/rp2/machine_uart.c +++ b/ports/rp2/machine_uart.c @@ -458,6 +458,7 @@ static mp_obj_t mp_machine_uart_make_new(const mp_obj_type_t *type, size_t n_arg } static void mp_machine_uart_deinit(machine_uart_obj_t *self) { + uart_tx_wait_blocking(self->uart); // Flush TX FIFO if necessary uart_deinit(self->uart); if (self->uart_id == 0) { irq_set_enabled(UART0_IRQ, false); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy