Task watchdog change from NCS 2.6.2 to 2.7

I observed another user having this same issue with resolution.

 RE: Assertion fail after initializing task watchdog with hardware watchdog fallback 

It appears the watchdog configuration has changed but I'm unable to track down the driver/overlay/etc that changed that doesn't allow this to work.  I see the same assertion as in the linked ticket and the same flow.  

######################
## Task Watchdog
######################

CONFIG_WATCHDOG=y
CONFIG_TASK_WDT=y
CONFIG_WDT_DISABLE_AT_BOOT=y (tried with and with out this)
CONFIG_TASK_WDT_HW_FALLBACK=y
CONFIG_TASK_WDT_MIN_TIMEOUT=1000
CONFIG_TASK_WDT_HW_FALLBACK_DELAY=1000
Again, I never had an issue in my 2.6.2 project, but now it doesn't work in 2.7.
Thanks,
Gabriel
Parents
  • Hi, 

    Could you run and test https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/subsys/task_wdt sample? and compare .config under build/task_wdt/zephyr to find what is missing. 

    Regards,
    Amanda H. 

  • I don't see any significant differences:

    Filtered for wtd, watchdog

    My .config

    Line 2767: CONFIG_WATCHDOG=y
    Line 279: CONFIG_DT_HAS_NORDIC_NRF_WDT_ENABLED=y
    Line 1677: # CONFIG_NRFX_WDT_LOG is not set
    Line 1730: CONFIG_NRFX_WDT=y
    Line 1731: CONFIG_NRFX_WDT0=y
    Line 1732: # CONFIG_NRFX_WDT1 is not set
    Line 1957: CONFIG_HAS_HW_NRF_WDT0=y
    Line 2768: CONFIG_WDT_DISABLE_AT_BOOT=y
    Line 2769: # CONFIG_WDT_LOG_LEVEL_OFF is not set
    Line 2770: # CONFIG_WDT_LOG_LEVEL_ERR is not set
    Line 2771: # CONFIG_WDT_LOG_LEVEL_WRN is not set
    Line 2772: # CONFIG_WDT_LOG_LEVEL_INF is not set
    Line 2773: # CONFIG_WDT_LOG_LEVEL_DBG is not set
    Line 2774: CONFIG_WDT_LOG_LEVEL_DEFAULT=y
    Line 2775: CONFIG_WDT_LOG_LEVEL=2
    Line 2776: CONFIG_WDT_NRFX=y
    Line 2777: # CONFIG_WDT_SHELL is not set
    Line 3889: CONFIG_TASK_WDT=y
    Line 3890: CONFIG_TASK_WDT_CHANNELS=5
    Line 3891: CONFIG_TASK_WDT_HW_FALLBACK=y
    Line 3892: CONFIG_TASK_WDT_MIN_TIMEOUT=1000
    Line 3893: CONFIG_TASK_WDT_HW_FALLBACK_DELAY=20
    Line 3894: # CONFIG_TASK_WDT_SHELL is not set
    Sample task_wdt .config:
    Line   75: CONFIG_WATCHDOG=y
    Line 26: CONFIG_TASK_WDT_HW_FALLBACK_DELAY=20
    Line 124: CONFIG_DT_HAS_NORDIC_NRF_WDT_ENABLED=y
    Line 928: # CONFIG_NRFX_WDT_LOG is not set
    Line 978: CONFIG_NRFX_WDT=y
    Line 979: CONFIG_NRFX_WDT0=y
    Line 980: # CONFIG_NRFX_WDT1 is not set
    Line 1197: CONFIG_HAS_HW_NRF_WDT0=y
    Line 1754: CONFIG_WDT_DISABLE_AT_BOOT=y
    Line 1755: # CONFIG_WDT_LOG_LEVEL_OFF is not set
    Line 1756: # CONFIG_WDT_LOG_LEVEL_ERR is not set
    Line 1757: # CONFIG_WDT_LOG_LEVEL_WRN is not set
    Line 1758: # CONFIG_WDT_LOG_LEVEL_INF is not set
    Line 1759: CONFIG_WDT_LOG_LEVEL_DBG=y
    Line 1760: # CONFIG_WDT_LOG_LEVEL_DEFAULT is not set
    Line 1761: CONFIG_WDT_LOG_LEVEL=4
    Line 1762: CONFIG_WDT_NRFX=y
    Line 2167: CONFIG_TASK_WDT=y
    Line 2168: CONFIG_TASK_WDT_CHANNELS=5
    Line 2169: CONFIG_TASK_WDT_HW_FALLBACK=y
    Line 2170: CONFIG_TASK_WDT_MIN_TIMEOUT=500
    Both files attached. The difference in time outs I've had working before.  
    My code:
    #if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_wdt)
    #define WDT_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(nordic_nrf_wdt)
    #endif

    static const struct device *const hw_wdt_dev = DEVICE_DT_GET_OR_NULL(WDT_NODE);
    ds_result_t SystemLog_setupWatchdog(void)
    {
        if (IS_ENABLED(CONFIG_TASK_WDT))
        {
            int ret;
            const struct device *const hw_wdt_dev = DEVICE_DT_GET_OR_NULL(WDT_NODE);


            if (!device_is_ready(hw_wdt_dev)) {
                LOG_ERR("Hardware watchdog not ready; ignoring it.\n");
            }

            ret = task_wdt_init(hw_wdt_dev);
            if (ret != 0) {
                LOG_ERR("task wdt init failure: %d\n", ret);
                return DS_ERR_FAIL;
            }
        }

        return DS_OK;
    }
    If I use 'watchdog0' as the device, the device is not found and never configures it.  If I use nordic_nrf_wdt, it identifies the device and then crashes immediately.
    My objective is to use the task wdt with hardware fall back.
    This is where is fails as referenced in the other post. 
    void nrfx_wdt_channel_feed(nrfx_wdt_t const * p_instance, nrfx_wdt_channel_id channel_id)
    {
        NRFX_ASSERT(m_cb[p_instance->drv_inst_idx].state == NRFX_DRV_STATE_POWERED_ON);
        nrfy_wdt_reload_request_set(p_instance->p_reg, channel_id);
    }
    This worked perfect in 2.6.2.
    Thanks,
    Gabriel
Reply Children
No Data
Related