diff --git a/subsys/shell/shell_uart.c b/subsys/shell/shell_uart.c index 74116850fb5..02d3b88c56d 100644 --- a/subsys/shell/shell_uart.c +++ b/subsys/shell/shell_uart.c @@ -78,10 +78,13 @@ static void uart_rx_handle(struct device *dev, rd_len = uart_fifo_read(dev, &dummy, 1); #ifdef CONFIG_MCUMGR_SMP_SHELL - /* Divert this byte from shell handling if it - * is part of an mcumgr frame. + /* If successful in getting byte from the fifo, try + * feeding it to SMP as a part of mcumgr frame. */ - smp_shell_rx_byte(&sh_uart->ctrl_blk->smp, dummy); + if (rd_len != 0 && + smp_shell_rx_byte(&sh_uart->ctrl_blk->smp, dummy)) { + new_data = true; + } #endif /* CONFIG_MCUMGR_SMP_SHELL */ } } while (rd_len && (rd_len == len));