Skip to content

Commit d21442a

Browse files
committed
zephyr/Kconfig: added option for enabling WDT feed
Added option for enabling feeding the watchdog while doing the swap operation. Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent ab03b91 commit d21442a

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

boot/zephyr/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,16 @@ config MCUBOOT_HW_DOWNGRADE_PREVENTION
495495

496496
endchoice
497497

498+
config BOOT_WATCHDOG_FEED
499+
bool "Feed the watchdog while doing swap"
500+
default y if SOC_FAMILY_NRF
501+
imply NRFX_WDT
502+
imply NRFX_WDT0
503+
imply NRFX_WDT1
504+
help
505+
Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
506+
used to feed watchdog while doing time consuming operations.
507+
498508
endmenu
499509

500510
config MCUBOOT_DEVICE_SETTINGS

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154

155155
#endif /* !__BOOTSIM__ */
156156

157+
#if CONFIG_BOOT_WATCHDOG_FEED
157158
#if CONFIG_NRFX_WDT
158159
#include <nrfx_wdt.h>
159160

@@ -180,12 +181,18 @@
180181
#endif /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
181182

182183
#else /* CONFIG_NRFX_WDT */
183-
184+
#warning "MCUBOOT_WATCHDOG_FEED() is no-op"
185+
/* No vendor implementation, no-op for historical reasons */
184186
#define MCUBOOT_WATCHDOG_FEED() \
185187
do { \
186-
/* TODO: to be implemented */ \
187188
} while (0)
188-
189189
#endif /* CONFIG_NRFX_WDT */
190+
#else /* CONFIG_BOOT_WATCHDOG_FEED */
191+
/* Not enabled, no feed activity */
192+
#define MCUBOOT_WATCHDOG_FEED() \
193+
do { \
194+
} while (0)
195+
196+
#endif /* CONFIG_BOOT_WATCHDOG_FEED */
190197

191198
#endif /* __MCUBOOT_CONFIG_H__ */

0 commit comments

Comments
 (0)