@@ -1104,21 +1104,6 @@ config MCUBOOT_UUID_CID
11041104 Provide an image class identification scheme to prevent processing
11051105 images for a different CPU or device produced by the same vendor.
11061106
1107- config BOOT_WATCHDOG_FEED
1108- bool "Feed the watchdog while doing swap"
1109- default y if WATCHDOG
1110- default y if SOC_FAMILY_NORDIC_NRF
1111- imply BOOT_WATCHDOG_FEED_NRFX_WDT if SOC_FAMILY_NORDIC_NRF
1112- help
1113- Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
1114- used to feed watchdog while doing time consuming operations.
1115-
1116- config BOOT_WATCHDOG_FEED_NRFX_WDT
1117- bool "Feed the watchdog using NRFX WDT directly"
1118- depends on SOC_FAMILY_NORDIC_NRF
1119- # for nRF nrfx based implementation is available
1120- imply NRFX_WDT
1121-
11221107config BOOT_IMAGE_ACCESS_HOOKS
11231108 bool "Hooks for overriding MCUboot's native routines"
11241109 help
@@ -1263,6 +1248,60 @@ config MCUBOOT_STORAGE_MINIMAL_SCRAMBLE
12631248 Depending on type of device this may be done by erase of minimal
12641249 number of pages or overwrite of part of image.
12651250
1251+ menu "Watchdog configuration"
1252+
1253+ config BOOT_WATCHDOG_SETUP_AT_BOOT
1254+ bool "Setup watchdog on boot"
1255+ depends on WATCHDOG
1256+ default y
1257+ help
1258+ Will set the watchdog up at boot, if this option is enabled and
1259+ CONFIG_BOOT_WATCHDOG_INSTALL_TIMEOUT_AT_BOOT is disabled then this is non-compliant
1260+ with the Zephyr watchdog driver interface as no timeouts will be installed but is
1261+ left as an option as MCUboot has seemingly done this for 6 years prior and it might be
1262+ used in configurations where the watchdog is enabled by other images or directly in
1263+ hardware.
1264+
1265+ Note that the in-built watchdog functionality in MCUboot can be replaced with custom
1266+ logic by overriding the weak symbol functions `mcuboot_watchdog_setup` and
1267+ `mcuboot_watchdog_feed`.
1268+
1269+ config BOOT_WATCHDOG_INSTALL_TIMEOUT_AT_BOOT
1270+ bool "Install watchdog timeout on boot"
1271+ depends on BOOT_WATCHDOG_SETUP_AT_BOOT
1272+ default y
1273+ help
1274+ Will set the watchdog up at boot and install a timeout, note that this watchdog will
1275+ then need to be continuously fed from the application once it is booted. The Zephyr
1276+ watchdog driver might need special configuration or re-init in the application to
1277+ allow the application to feed it.
1278+
1279+ config BOOT_WATCHDOG_TIMEOUT_MS
1280+ int "Watchdog timeout (ms)"
1281+ depends on BOOT_WATCHDOG_INSTALL_TIMEOUT_AT_BOOT
1282+ default 300000
1283+ help
1284+ Will setup a timeout for this duration when MCUboot starts. This defaults to a 5 minute
1285+ timeout, which is sufficient for most devices to be able to swap an image an boot the
1286+ new application which can initialise itself and feed the watchdog before it times out.
1287+
1288+ config BOOT_WATCHDOG_FEED
1289+ bool "Feed the watchdog while doing swap"
1290+ default y if WATCHDOG
1291+ default y if SOC_FAMILY_NORDIC_NRF
1292+ imply BOOT_WATCHDOG_FEED_NRFX_WDT if SOC_FAMILY_NORDIC_NRF
1293+ help
1294+ Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
1295+ used to feed watchdog while doing time consuming operations.
1296+
1297+ config BOOT_WATCHDOG_FEED_NRFX_WDT
1298+ bool "Feed the watchdog using NRFX WDT directly"
1299+ depends on SOC_FAMILY_NORDIC_NRF
1300+ # for nRF nrfx based implementation is available
1301+ imply NRFX_WDT
1302+
1303+ endmenu # "Watchdog configuration"
1304+
12661305menu "Defaults"
12671306 # Items in this menu should not be manually set. These options are for modules/sysbuild to
12681307 # set as defaults to allow MCUboot's default configuration to be set, but still allow it
0 commit comments