This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

watchdog with multiple channels fails on nrf52 using zephyr (ncs v1.2.0)

Hi,

I'm using Zephyr with nrf52 and want to setup watchdog support with multiple channels (different timer settings for separate different threads).

I can add 1 channel, but adding two, get's me a fail, error.

This should not happen on the 52, it has support for at least 8 channels I see in the wdt spec for the chip.

I get error when creating the 2nd channel.

Code looks like this:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define PERIPH_WATCHDOG_TIMEOUT_MS (30 * 1000U)
#define NETWORK_QUEUE_WATCHDOG_TIMEOUT_MS (10 * 1000U)
int watchdog_init()
{
int error_code = 0;
LOG_INF("Watchdog starting");
wdt = device_get_binding(WDT_DEV_NAME);
if (!wdt)
{
LOG_ERR("Cannot get WDT device\n");
return -ENXIO;
}
return error_code;
}
int watchdog_add_channel_timeout(u32_t timeout_ms)
{
/* Reset SoC when watchdog timer expires. */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX