Commit 3942e9bf authored by Piotr Dymacz's avatar Piotr Dymacz Committed by Andrzej Puzdrowski
Browse files

boot_serial: fix serial recovery mode with timeout



If 'BOOT_SERIAL_WAIT_FOR_DFU' is selected, the CPU shouldn't enter idle
state, waiting for interrupt from the console because we expect booting
if no mcumgr command is received within a configured timeout (with the
'CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT').

Without this fix, when using 'BOOT_SERIAL_WAIT_FOR_DFU' the boot process
hangs forever, waiting for input from console.

Fixes: e3822f81 ("boot_serial: zephyr: Add optional timeout to enter serial recovery")
Signed-off-by: default avatarPiotr Dymacz <pepe2k@gmail.com>
parent 5130d1dc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -849,7 +849,9 @@ boot_serial_read_console(const struct boot_uart_funcs *f,int timeout_in_ms)

    off = 0;
    while (timeout_in_ms > 0 || bs_entry) {
#ifndef MCUBOOT_SERIAL_WAIT_FOR_DFU
        MCUBOOT_CPU_IDLE();
#endif
        MCUBOOT_WATCHDOG_FEED();
#ifdef MCUBOOT_SERIAL_WAIT_FOR_DFU
        uint32_t start = k_uptime_get_32();