Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hw/bsp/nordic_pca10095_net/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ syscfg.defs:
description: 'Set to indicate that BSP has NRF5340 NET'
value: 1

BSP_NRF5340_WDT_STOP:
description: 'Enable WDT STOP/STOPEN mode on nRF5340'
value: 0

COREDUMP_SKIP_UNUSED_HEAP:
description: >
Store whole RAM in crash dump.
Expand Down
8 changes: 8 additions & 0 deletions hw/mcu/nordic/nrf5340_net/src/hal_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ nrf5340_net_wdt_irq_handler(void)
os_trace_isr_enter();
if (NRF_WDT_NS->INTENSET & WDT_INTENSET_TIMEOUT_Msk) {
NRF_WDT_NS->EVENTS_TIMEOUT = 0;
#if MYNEWT_VAL(BSP_NRF5340_WDT_STOP)
NRF_WDT_NS->TASKS_STOP = 1;
#endif
nrf5340_net_hal_wdt_default_handler();
}
os_trace_isr_exit();
Expand All @@ -46,7 +49,12 @@ hal_watchdog_init(uint32_t expire_msecs)
{
uint64_t expiration;

#if MYNEWT_VAL(BSP_NRF5340_WDT_STOP)
NRF_WDT_NS->CONFIG = WDT_CONFIG_SLEEP_Msk | WDT_CONFIG_STOPEN_Msk;
NRF_WDT_NS->TSEN = WDT_TSEN_TSEN_Enable;
#else
NRF_WDT_NS->CONFIG = WDT_CONFIG_SLEEP_Msk;
#endif

/* Convert msec timeout to counts of a 32768 crystal */
expiration = ((uint64_t)expire_msecs * 32768) / 1000;
Expand Down
Loading