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

ASSERTION FAIL [m_cb[p_instance->drv_inst_idx].state == NRFX_DRV_STATE_POWERED_0

Hello, I attempted to enable the zephyr task watchdog model but whenever I configure it to enable the hardware watchdog module I get the error above. Any idea why I am getting this? My code is very similar to the sample project and I have the following config statements:

CONFIG_WATCHDOG=y
CONFIG_WDT_LOG_LEVEL_DBG=y
CONFIG_WDT_DISABLE_AT_BOOT=n
CONFIG_TASK_WDT=y
CONFIG_TASK_WDT_MIN_TIMEOUT=100

Thanks!

  • I'm not able to find the assert you're referring to, could you point me to the file and line of the assert?

    Best regards,

    Simon

  • Hello Simon,

    Here is the full error message and attached is a screenshot of the output.

    ASSERTION FAIL [m_cb[p_instance->drv_inst_idx].state == NRFX_DRV_STATE_POWERED_ON] @ WEST_TOPDIR/modules/hal/nordic/nrfx/drivers

    For some reason, it didn't specify the actual file but when I look in that directory, I think the most relevant file is the nrfx_wdt.c included within the src directory. Within that file, I see the above assertion statement on line 155 within the nrfx_wdt_channel_feed function.

    This function is called by wdt_nrf_feed function within the wdt_nrfx.c. I am assuming this function is eventually called by task_wdt.c but I could find the exact link. task_wdt.c uses wdt_feed function which I don't know where is that one is defined.

    Hope this provides some data and look forward to your input. Thanks!

  • Did you call the enable function before calling feed function? As you can see in the file nrfx_wdt.c, it will set p_cb->state to NRFX_DRV_STATE_POWERED_ON in nrfx_wdt_enable(). If this is set, the assert won't trigger.

    Call wdt_setup() before doing anything else, it will trigger wdt_nrf_setup(), which will trigger nrfx_wdt_enable()

    Best regards,

    Simon

  • Simon, as mentioned I am using the zephyr task wdt module which internally configures the hardware wdt. I call the task_wdt_init function first, then task_wdt_add, and finally task_wdt_feed on a periodic event. Here is the link for the module code link. In the code, you can see that wdt_setup function is called within task_wdt_add.

    Please note that within task_wdt_add,  task_wdt_feed is called before wdt_setup which in turn call wdt_feed function. Not sure if this problematic. 

    Any ideas on how to proceed? Has the task_wdt module ever worked on a nordic SoC? Thx!

  • Simon, as mentioned I am using the zephyr task wdt module which internally configures the hardware wdt. I call the task_wdt_init function first, then task_wdt_add, and finally task_wdt_feed on a periodic event. Here is the link for the module code link. In the code, you can see that wdt_setup function is called within task_wdt_add.

    Please note that within task_wdt_add,  task_wdt_feed is called before wdt_setup which in turn call wdt_feed function. Not sure if this problematic. 

    Any ideas on how to proceed? Has the task_wdt module ever worked on a nordic SoC? Thx!

Related