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

mesh internal watchdog timer enabling issue

Hi,

    Right now i am working on mesh sdk 3.0.0 on segger embedded studio and board i am using nrf52832. In my application i am trying to implement the watchdog timer but it's not working means the functions that i initialized and allocating are returning  NRF_SUCESS but the watchdog timer is not working , even if i am not feeding it, the device is not restarting.

#include "nrf_drv_wdt.h"

nrf_drv_wdt_channel_id m_channel_id;

/*Watchdog timer initialization*/
nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG;

err_code = nrf_drv_wdt_init(&config, wdt_event_handler);
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "err_code1:%d\n",err_code);
err_code = nrf_drv_wdt_channel_alloc(&m_channel_id);
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "err_code2:%d\n",err_code);

the handler is

void wdt_event_handler(void)
{
hal_led_mask_set(LEDS_MASK, LED_MASK_STATE_OFF);
//NOTE: The max amount of time we can spend in WDT interrupt is two cycles of 32768[Hz] clock - after that, reset occurs
}

The above code which is used in my application and in sdf_config.h file i enabled there instances

// <e> NRFX_WDT_ENABLED - nrfx_wdt - WDT peripheral driver
//==========================================================
#ifndef NRFX_WDT_ENABLED
#define NRFX_WDT_ENABLED 1
#endif
// <o> NRFX_WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode

// <1=> Run in SLEEP, Pause in HALT
// <8=> Pause in SLEEP, Run in HALT
// <9=> Run in SLEEP and HALT
// <0=> Pause in SLEEP and HALT

#ifndef NRFX_WDT_CONFIG_BEHAVIOUR
#define NRFX_WDT_CONFIG_BEHAVIOUR 9
#endif

// <o> NRFX_WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295>


#ifndef NRFX_WDT_CONFIG_RELOAD_VALUE
#define NRFX_WDT_CONFIG_RELOAD_VALUE 5000
#endif

// <o> NRFX_WDT_CONFIG_IRQ_PRIORITY - Interrupt priority

// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7

#ifndef NRFX_WDT_CONFIG_IRQ_PRIORITY
#define NRFX_WDT_CONFIG_IRQ_PRIORITY 6
#endif

// <e> WDT_ENABLED - nrf_drv_wdt - WDT peripheral driver - legacy layer
//==========================================================
#ifndef WDT_ENABLED
#define WDT_ENABLED 1
#endif
// <o> WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode

// <1=> Run in SLEEP, Pause in HALT
// <8=> Pause in SLEEP, Run in HALT
// <9=> Run in SLEEP and HALT
// <0=> Pause in SLEEP and HALT

#ifndef WDT_CONFIG_BEHAVIOUR
#define WDT_CONFIG_BEHAVIOUR 9
#endif

// <o> WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295>


#ifndef WDT_CONFIG_RELOAD_VALUE
#define WDT_CONFIG_RELOAD_VALUE 5000
#endif

// <o> WDT_CONFIG_IRQ_PRIORITY - Interrupt priority


// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7

#ifndef WDT_CONFIG_IRQ_PRIORITY
#define WDT_CONFIG_IRQ_PRIORITY 6
#endif

 the same application and the watchdog enabling i done in my sdk 15.0 without mesh in keil and there its is working properly.

please help me out how to use internal watchdog in mesh

Thanks in advance

Parents Reply Children
Related