WDOG1 keeps counting while debugging. Why?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

WDOG1 keeps counting while debugging. Why?

Jump to solution
1,254 Views
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 Kudos
Reply
1 Solution
1,241 Views
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 !

View solution in original post

2 Replies
1,247 Views
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 Kudos
Reply
1,242 Views
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 !