Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE
Hi expert,
My customer want to do a watchdog reset after a boot loader.
and they enable watchdog reset and then wait for reset.
but they can see reset signal on the XRS pin, but the CPU is running away.
I just try to reproduce on TI controlcard.
and I did can only see a reset signal and can not found the LED toggle.
My code is really simple. just enable watchdog and wait for reset and toggle LED.
did I use watchdog wrong?
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Initialize GPIO and configure the GPIO pin as a push-pull output
//
Device_initGPIO();
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1); // Turn on LED
//
// Set the watchdog to generate an interrupt signal or a reset signal
//
SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
//
// Reset the watchdog counter
//
SysCtl_serviceWatchdog();
//
// Enable the watchdog
//
SysCtl_enableWatchdog();
//
// Loop Forever
//
while(1)
{
//
// Turn off LED
//
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0);
DEVICE_DELAY_US(500);
}
}
BR
Emma
