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.

TMS320F280049M: Correct way to perform software reset operation using watchdog

Part Number: TMS320F280049M


Hello,

I would like to ask, what is the correct procedure to trigger software watchdog reset. Following the example watchdog_ex1_service.c, these are the steps I make in my project:

  1. In Device_init() - disabled the watchdog
  2. SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET); - Set the watchdog to generate a reset signal
  3. SysCtl_serviceWatchdog(); - reset the watchdog counter
  4. SysCtl_enableWatchdog(); - enable watchdog
  5. SysCtl_serviceWatchdog(); - in main loop, reset the watchdog timer 

Then,

a)      in my project, when I called my reset code:

 

EALLOW;

WdRegs.WDCR.all = 0x0000;      

EDIS;

 

 the result is that following function is called:

 static void Interrupt_illegalOperationHandler(void)

{

    //

    // Something has gone wrong.  The CPU has tried to execute an illegal

    // instruction, generating an illegal instruction trap (ITRAP).

    //

    ESTOP0;

    for(;;)

    {

        ;

    }

}

 

and then:

MCU then hangs in undefined state, definitely was not reseted correctly.

b)      in the example watchdog_ex1_service.c, when I change SYSCTL_WD_MODE_INTERRUPT to SYSCTL_WD_MODE_RESET and then when watchdog timeout is triggered, the result is again:

 

So, my question is, what is the correct way to reset device from code using watchdog. Is there something that I missed?

 

Many thanks, Marek