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

Cannot get watchdog to run on nrf9160

Dear All,

I am fairly new to the nrf9160 and the Zephyr Os.

I am trying to write a simple example code for watchdog. All I want to do is to reset my board if I don't feed it for 2 seconds. I am using trying to use the ncs\zephyr\tests\drivers\watchdog test code as the base for my own code. What I have written so far is this:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <zephyr.h>
#include <misc/printk.h>
#include <uart.h>
#include <gpio.h>
#include <watchdog.h>
static struct device *led1;
static struct device *wdt;
static struct wdt_timeout_cfg m_cfg_wdt0;
static void wdt_int_cb(struct device *wdt_dev, int channel_id)
{
printk("Here\n");
}
void main(void)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Furthermore my prj.conf looks like this:

Fullscreen
1
2
3
4
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
CONFIG_GPIO=y
CONFIG_WATCHDOG=y
CONFIG_BOOT_BANNER=n
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But this code won't run