Alrighty, I know this thread is about 2 years old, but it touches on exactly what I'm doing...
Skipping the long explanation, I need to capture the watchdog interrupt... but I can't seem to get it right.
I'm enabling the WDT with:
Code:
AT91C_BASE_WDTC->WDTC_WDMR = 0xCF | (0xCF << 16) | AT91C_WDTC_WDFIEN | AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT;
When our system crashes and the watchdog would normally reset it... it just hangs. We're already configured to catch the system interrupt, as we use the PIT (and were previously using the dbgu). Inside the interrupt I'm checking the status register of the Watchdog:
Code:
U32 nWatchdogStatus = AT91C_BASE_WDTC->WDTC_WDSR;
if (nWatchdogStatus)
{
// put the below line in your ISR where you want the RESET...
RSTC_CR = RSTC_CR_PROCRST | RSTC_CR_PERRST | RSTC_KEY(0xA5);
}
but it never seems to actually hit the reset command (which I stole from this thread, thanks!).
If I put the watchdog config back to the previous way:
Code:
AT91C_BASE_WDTC->WDTC_WDMR = 0xCF | (0xCF << 16) | AT91C_WDTC_WDRSTEN | AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT;
The system resets just like it should.
I'm setting up the AIC to handle the interrupt (and setting up the PMC) below.
Code:
// open interrupt
AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_SYS, INTERRUPT_PRIORITY_SEVEN, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, InterruptServicer::Interrupt_ID_SYS);
// Enable Peripheral clock in PMC for PITC
AT91F_PITC_CfgPMC();
// Enable AIC to catch the interrupt
AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_SYS);
// Enable Interrupts
AT91F_PITEnableInt(AT91C_BASE_PITC);
This is the only interrupt in the system set at priority seven.
Anyone have any idea what I'm doing wrong? Any help would be greatly appreciated, thank you.