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.

C6748 detect watchdog

Hello,

Is there a way in this DSP to know when a watchdog reset occurred (so that I can revert to a backup firmware)? Some processors have a bit that can be read that tells the reason for reset but I couldn't find any information for this one.

Thank you in advance,

David.

  • Hi David,

    I hope we can't get time stamp info while watchdog reset enabled.

    We can write own software code to save the time when watchdog enable bit asserted but if any software/system get (panic) hangs then this concept would failure.

  • Hi David Luca,

    The WDTFLAG will get set when the watchdog timer occurs. But, once the watch dog time out event occurs, it resets the enttire processor which will clear all the WDT registers including the WDTFLAG of WDTCR.

    The Watch dog timer trigggers the POR. During POR, the RTC peripheral will not get reset during the POR; which means the RTC register values are retained though the POR occurs.

    When the watch dog time out event occurs, in the ISR of WDT, you can write a value to one of the RTC scratch registers to indicate that the watch dog time out event occured. 

    After the device reset happens, in the next firmware run, you can read the value of the scratch registers to know whether the reset happens is due to WDT or POR and reset the value of the scratch register before enabling the watch dog timer. 

    (Note: I have not tried this option; just a suggestion.)

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • Hi Shankari,

    Using scratch registers is a really good suggestion, thank you. One thing I don't think will work is the interrupt, as I see on page 1412 that diagram doesn't mention the interrupt trigger, only that will reset the device so the core may start the interrupt execution but reset core at the same time. Also other higher priority interrupts may be in progress. What I'll do is use another timer to set scratch registers some time (total interrupts latency times I assume) just before the watchdog would expire but that depends on RTOS when the tick function gets executed.

    Best regards,

    David.