WDOG1 keeps counting while debugging. Why?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

WDOG1 keeps counting while debugging. Why?

跳至解决方案
899 次查看
bp1979
Senior Contributor I

Hi,

Why is the WDOG1 still counting back to zero while I am debugging?

Also in the WDOG SDK example, I experience the same problem.

 

        /*
         * wdogConfig->enableWdog = true;
         * wdogConfig->workMode.enableWait = true;
         * wdogConfig->workMode.enableStop = false;
         * wdogConfig->workMode.enableDebug = false;
         * wdogConfig->enableInterrupt = false;
         * wdogConfig->enablePowerdown = false;
         * wdogConfig->resetExtension = flase;
         * wdogConfig->timeoutValue = 0xFFU;
         * wdogConfig->interruptTimeValue = 0x04u;
         */
        WDOG_GetDefaultConfig(&config);
        config.timeoutValue       = 0xFU; /* Timeout value is (0xF+1)/2 = 8 sec. */
        config.enableInterrupt    = true;
        config.interruptTimeValue = 0x4U; /* Interrupt occurred (0x4)/2 = 2 sec before WDOG timeout. */
        WDOG_Init(DEMO_WDOG_BASE, &config);

        PRINTF("--- I add a breakpoint here, wait for >10 seconds and WDOG triggers ---\r\n");

Read the last statement in the snippet above. I added a breakpoint there. After 10+ sec the watchdog triggers.

Shouldn't this take care of that?

* wdogConfig->workMode.enableDebug = false;

snippet from fsl_wdog impl

void WDOG_GetDefaultConfig(wdog_config_t *config)
{
    assert(NULL != config);

    /* Initializes the configure structure to zero. */
    (void)memset(config, 0, sizeof(*config));

    config->enableWdog             = true;
    config->workMode.enableWait    = false;
    config->workMode.enableStop    = false;
    config->workMode.enableDebug   = false;
    config->enableInterrupt        = false;
    config->softwareResetExtension = false;
    config->enablePowerDown        = false;
    config->timeoutValue           = 0xffu;
    config->interruptTimeValue     = 0x04u;
    config->enableTimeOutAssert    = false;
}
0 项奖励
回复
1 解答
886 次查看
bp1979
Senior Contributor I

Hi @kerryzhou 

Nah, that's not true. 

bp1979_1-1631262833021.png

A Guide to Watchdog Timers for Embedded Systems | Interrupt (memfault.com)

Nevermind, found it myself

bp1979_0-1631262624146.png

when I set the bool to true it works

config.workMode.enableDebug = true;

 

Thanks !

在原帖中查看解决方案

2 回复数
892 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @bp1979 ,

   As you know, the watchdog is the hardware IP module, so, when you enable the WDOG, then the hardware timer will counting, if you don't feed it(refresh the counter), it will be overflow.

  It is the correct result.

Best Regards,

Kerry

0 项奖励
回复
887 次查看
bp1979
Senior Contributor I

Hi @kerryzhou 

Nah, that's not true. 

bp1979_1-1631262833021.png

A Guide to Watchdog Timers for Embedded Systems | Interrupt (memfault.com)

Nevermind, found it myself

bp1979_0-1631262624146.png

when I set the bool to true it works

config.workMode.enableDebug = true;

 

Thanks !