Skip to content

Commit

Permalink
boot: zephyr: moonlight watchdogs
Browse files Browse the repository at this point in the history
adding WATCHDOG_FEED support for WDT30 and WDT31

Signed-off-by: Mateusz Michalek <[email protected]>
  • Loading branch information
michalek-no committed Jan 9, 2024
1 parent 6902abb commit 2f1710a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ config BOOT_WATCHDOG_FEED
imply NRFX_WDT if SOC_FAMILY_NRF
imply NRFX_WDT0 if SOC_FAMILY_NRF
imply NRFX_WDT1 if SOC_FAMILY_NRF
imply NRFX_WDT30 if SOC_FAMILY_NRF
imply NRFX_WDT31 if SOC_FAMILY_NRF
help
Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
used to feed watchdog while doing time consuming operations.
Expand Down
16 changes: 14 additions & 2 deletions boot/zephyr/include/mcuboot_config/mcuboot_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,21 @@
#elif defined(CONFIG_NRFX_WDT0)
#define MCUBOOT_WATCHDOG_FEED() \
FEED_WDT_INST(0);
#else /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
#elif defined(CONFIG_NRFX_WDT30) && defined(CONFIG_NRFX_WDT31)
#define MCUBOOT_WATCHDOG_FEED() \
do { \
FEED_WDT_INST(30); \
FEED_WDT_INST(31); \
} while (0)
#elif defined(CONFIG_NRFX_WDT30)
#define MCUBOOT_WATCHDOG_FEED() \
FEED_WDT_INST(30);
#elif defined(CONFIG_NRFX_WDT31)
#define MCUBOOT_WATCHDOG_FEED() \
FEED_WDT_INST(31);
#else
#error "No NRFX WDT instances enabled"
#endif /* defined(CONFIG_NRFX_WDT0) && defined(CONFIG_NRFX_WDT1) */
#endif

#elif CONFIG_IWDG_STM32 /* CONFIG_NRFX_WDT */
#include <zephyr/device.h>
Expand Down

0 comments on commit 2f1710a

Please sign in to comment.