Commit fd79db3a authored by Jamie McCrae's avatar Jamie McCrae Committed by Dominik Ermel
Browse files

zephyr: boot: serial_recovery: Add no application entrace method



Adds a bootloader serial recovery entrance mode that will allow
recovering a module if there is no application that can be booted.

Signed-off-by: default avatarJamie McCrae <jamie.mccrae@nordicsemi.no>
parent b3e3ce39
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -185,6 +185,12 @@ config BOOT_SERIAL_BOOT_MODE
	  retention system (i.e. an application must set the boot mode to stay
	  in serial recovery mode and reboot the module).

config BOOT_SERIAL_NO_APPLICATION
	bool "Stay in bootloader if no application"
	help
	  Allows for entering serial recovery mode if there is no bootable
	  application that the bootloader can jump to.

endmenu

config BOOT_SERIAL_IMG_GRP_HASH
+15 −1
Original line number Diff line number Diff line
@@ -128,7 +128,8 @@ BOOT_LOG_MODULE_REGISTER(mcuboot);
#ifdef CONFIG_MCUBOOT_SERIAL
#if !defined(CONFIG_BOOT_SERIAL_ENTRANCE_GPIO) && \
    !defined(CONFIG_BOOT_SERIAL_WAIT_FOR_DFU) && \
    !defined(CONFIG_BOOT_SERIAL_BOOT_MODE)
    !defined(CONFIG_BOOT_SERIAL_BOOT_MODE) && \
    !defined(CONFIG_BOOT_SERIAL_NO_APPLICATION)
#error "Serial recovery selected without an entrance mode set"
#endif
#endif
@@ -596,6 +597,19 @@ void main(void)

        mcuboot_status_change(MCUBOOT_STATUS_NO_BOOTABLE_IMAGE_FOUND);

#ifdef CONFIG_BOOT_SERIAL_NO_APPLICATION
        /* No bootable image and configuration set to remain in serial
         * recovery mode
         */
#ifdef CONFIG_MCUBOOT_INDICATION_LED
        gpio_pin_set_dt(&led0, 1);
#endif

        mcuboot_status_change(MCUBOOT_STATUS_SERIAL_DFU_ENTERED);
        rc = boot_console_init();
        boot_serial_start(&boot_funcs);
#endif

        FIH_PANIC;
    }