This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR1642: How to re-enable watchdog after calling SOC_disableWatchdog

Part Number: AWR1642


Hi team,

Customer is using watchdog to monitor the application code. But when they call the function SOC_disableWatchdog, the watchdog is disable successful. After some process, they need to re-enable the watchdog. But calling the SOC_enableWatchdog or Watchdog_open can not re-enable the watchdog driver.

How can we re-configure the watchdog driver after we disable it using SOC_disableWatchdog?

Thanks,

Wesley

  • Hello Wesley,

    What happens when it doesn't disable watchdog at the beginning but directly enables it and proceed to enable it.

    Is there any reason customer is disabling it at the beginning?

    Could you check if wachdog_open function enables watchdog at the bottom of its call? Do the CCS step debug to find out this.

    Regards,

    Jitendra

  • Hello Jitendra,

    Sorry about make you confuse. Customer had already enable the watchdog and the watchdog works normally in app.

    But when they need to do the image upgrade in QSPI flash. They need to disable the watchdog because the longest time of watchdog timer is ~160ms. But earse the flash need about 200ms-1s. In the QSPI driver, the code using while(1) pending for the external flash's response. So it will cause the watchdog reset. 

    Customer wants to avoid this watch dog reset, so they want to disable the watchdog while erase the QSPI flash. While the image upgrade is done. they will re-enable the watchdog.

    Question: customer can disable the watchdog before the flash erase using SOC_disableWatchdog function.  But, they can not re-enable the watchdog by using SOC_enableWatchdog, Whats should customer need to do to re-enable the watchdog?

    Thanks.

    Wesley

  • Hi Wesley,

    I get the reason behind 1sec WDT timer. Please provide me some time to do this experiment and find the solution for you.

    Regards,

    Jitendra

  • Hi Wesley,

    To disable and re-enable you need to modify the driver a bit.

    This is what I did and tested on device.

    watchdog_rti.c ---->

    static void WatchdogRTI_close(Watchdog_Handle handle)
    {
    Watchdog_MCB *ptrWatchdogMCB;
    int32_t errCode;
    /* Get the Watchdog Configuration: */
    Watchdog_Config *ptrWatchdogConfig = (Watchdog_Config*)handle;

    ptrWatchdogMCB = (Watchdog_MCB*)ptrWatchdogConfig->object;

    SOC_disableWatchdog(ptrWatchdogMCB->params.socHandle, &errCode);

    MemoryP_ctrlFree(ptrWatchdogConfig->object,(uint32_t)sizeof(Watchdog_MCB));
    ptrWatchdogConfig->object = NULL;

    return;
    }

    build the watchdog driver and at the application here is the seqeunce-

    /* Before erase command close the watchdog driver and disable WDT */

    Watchdog_close(watchdogHandle);

    /* do the Flash erase here ------------- */

    /* Open the Watchdog driver */

    watchdogHandle = Watchdog_open(0, &watchdogParams);

    Regards,

    Jitendra

  • Hello Jitendra,

    Thanks. It works in my side. I will check with customer.

    Thanks for your great support.

    Regards,

    Wesley