Hello Nordic Team,
I'm currently integrating a watchdog on the nRF5340 CPUNET core to detect and recover from potential hangs. We’ve observed that in rare cases, the device:
-
Reports as "connected" from the app core perspective,
-
But no advertising is visible,
-
And communication is completely stuck (no BLE responses).
We suspect that the network core might be stuck or deadlocked, so our plan is to use the watchdog to reset the net core in such cases.
What I’ve done
-
Based on the
hci_ipc
sample in NCS v3.5.99-ncs1 -
Added a watchdog with 5s timeout (
WDT_FLAG_RESET_SOC
) -
Simulated a stuck net core (infinite loop after 30 seconds)
-
But no reset happens
DeviceTree (cpunet.dts)
&wdt {
status = "okay";
};
aliases {
watchdog = &wdt;
};
Also defined wdt0: watchdog@4100b000
in SoC .dtsi
as follows:
wdt: wdt0: watchdog@4100b000 {
compatible = "nordic,nrf-wdt";
reg = <0x4100b000 0x1000>;
interrupts = <11 NRF_DEFAULT_IRQ_PRIORITY>;
status = "okay";
};
Watchdog Code (in childi_image/hci_ipc/src/main.c
)
wdt_dev = DEVICE_DT_GET(DT_ALIAS(watchdog));
...
struct wdt_timeout_cfg wdt_config = {
.window.min = 0,
.window.max = 5000,
.callback = NULL, // Also tested with a handler
.flags = WDT_FLAG_RESET_SOC,
};
wdt_channel_id = wdt_install_timeout(wdt_dev, &wdt_config);
wdt_setup(wdt_dev, 0);
Main Loop (simulated hang after 30s)
if (k_uptime_get() > 30000) {
LOG_INF("Simulating hang");
while (1) {
k_sleep(K_SECONDS(1));
}
}
-
The system stops feeding the WDT
-
Expected: Reset after ~5s
-
Observed: Nothing happens — net core just keeps sleeping
Other Observations
-
WDT logs confirm it's installed and started (
id 0
) -
Feeding works when enabled manually
-
.callback
handler is never called either -
No debugger is connected during test
-
Behavior same with and without
WDT_OPT_PAUSE_HALTED_BY_DBG
What I’m looking for
-
Is
WDT_FLAG_RESET_SOC
supported and effective on CPUNET (network core)? -
Is any special mechanism needed to allow watchdog reset on this core?
-
Could the WDT IRQ or system reset logic be masked or non-functional?
-
How can I verify if WDT is ticking or actually reaching timeout?
-
Is there any easier / better-supported way to include watchdog functionality on the net core in this use case?
Context: I want to use the watchdog to recover from rare, hard-to-reproduce BLE communication hangs where the net core is no longer advertising/responding, but the app core still believes everything is fine.
Would really appreciate your input — especially if there’s a better or simpler way to enable this on CPUNET.
Thanks a lot in advance!