CC1312R: HW Watchdog strange behavior in debug

Part Number: CC1312R
Other Parts Discussed in Thread: SYSBIOS

Hi,

in my application in DEBUG mode I have set HW watchdog with these settings (RESET_OFF and DEBUG_STALL_ON):

    // --- Enable and run HW WDT ---
    // Call HW watchdog initialization functions
    Watchdog_init();

    // Create and enable a Watchdog with resets enabled
    Watchdog_Params_init(&hdWdParams);
    hdWdParams.callbackFxn = (Watchdog_Callback)watchdogHwiCallback;

    hdWdParams.resetMode = Watchdog_RESET_OFF;
    
    hdWdParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
    hwWatchdogHandle = Watchdog_open(CONFIG_WATCHDOG_0, &hdWdParams);
    if (hwWatchdogHandle == NULL) {
        // Error opening HW Watchdog
        SwReset(enErr_openingHwWatchdog);     // Do SW reset
    }
    // Set HW WDT timeout period
    wdTickValue = Watchdog_convertMsToTicks(hwWatchdogHandle, HW_WDT_TIMEOUT_MS);
    Watchdog_setReload(hwWatchdogHandle, wdTickValue);

Runing application I always receive unexpected Interrup by watchdog. Trying to understend the reason I found that it looks like that in Debug the function Watchdog_clear(hwWatchdogHandle) don't reload WDT timer, so my question is:

Is there somethig special with HW watchdog behavior in DEBUG? 

 

  • Hi,

    Please see the technical reference manual documentation for the watchdog. The debug/stall flag allows you to pause a debug session with or without the watchdog timer pausing.

    https://www.ti.com/lit/swcu185 

  • Hi Marie,

    I know the meaning of the  DEBUG_STALL settings. In the documentation I cannot find answers of my questions, so let me ask them in a different way. In my project I am using TI Sysbios and watchdog driver. I don't have a problem with watchdog behavior when I am not in DEBUG (without connected debugger), so all my question are related to the case when debugger is connected an device is in DEBIG session.

    1. I found on my desk that it looks like that the Watchdog_clear() don't reload WDT timer during DEBUG session. I could see reload after Watchdog_setReload() but not after Watchdog_clear(). Should  Watchdog_clear() reload WDT timer always - without connected debugger and with connected debugger (during DEBUG sesion), or there is somethig undocumented?  

    2. During normal device operation (without connected debuger) the WDT is stopped in mcu standby. The question is: Does the WDT is stopped during DEBUG when my programs goes in "statndby" also or because of connected debugger the WDT never stops?

    Regards,

    Dimitar Devedzhiev 

  • Hi Dimitar,

    1. Can you tell me the exact steps for how you found this?

    2. During standby, the sleep clock is used by the watchdog. Since this is so much slower than the regular clock, it will look to you like the watchdog paused, and the effect is more or less the same. Since the probability of the device failing in standby is very low, this is considered best practice.

  • Hi Marie,

    1. About "Can you tell me the exact steps for how you found this?"

    By running a code similar to this below but without these CPUdelays. Testing it again today I found that Watchdog _clear() doesn't work only if I test it step by step, but if I dont halt MCU for some time after Watchdog _clear() execution the WDT is reloded (it works in this case). 

        while(1)
        {
            Watchdog_clear(hwWatchdogHandle);
            CPUdelay(10000 * (48 / 4));       // 10ms
            CPUdelay(500000 * (48 / 4));       // 500ms
            __asm volatile (" NOP ");
        }
     

    2. About: "During standby, the sleep clock is used by the watchdog. Since this is so much slower than the regular clock, it will look to you like the watchdog paused". 

    Does it mean that MCU time in Standby mode is limited by a watchdog value in this case, or just WDT is still running but there will be not an actual WDT reset in Standby mode? I am going create a device that could be in standby for a several days, so if there are limitation it is good to know from now. 

    Best Regards,

    Dimitar Devedzhiev

  • Hi,

    1. If you are stepping through the code the watchdog won't be cleared, this is correct. 

    2. Actually I have to apologize, my previous post was wrong on this subject. When the device is in standby the watchdog is not running.