AnsweredAssumed Answered

Watchdog interrupt not handled

Question asked by biafra on Nov 2, 2018
Latest reply on Nov 8, 2018 by biafra

Hi everyone,

 

I'm using MCUXpresso 10.2.1, with a custom board based on K66 device.

I've enabled the watchdog interrupt that writes a value to an external battery backed up memory, but it doesn't seem to be executed.

 

This is the wdog init code I've used:

 

WDOG_GetDefaultConfig( &WdogConfig );
WdogConfig.clockSource = kWDOG_AlternateClockSource;
WdogConfig.prescaler = kWDOG_ClockPrescalerDivide5;
WdogConfig.workMode.enableStop = true;
WdogConfig.enableInterrupt = true;
WdogConfig.timeoutValue = WDOG_TIMEOUT_VAL( CLOCK_GetFreq( kCLOCK_BusClk ), WdogConfig.prescaler );
WDOG_Init( WDOG, &WdogConfig );
NVIC_SetPriority( WDOG_EWM_IRQn, WDOG_INTPRIO );
EnableIRQ( WDOG_EWM_IRQn );

 

This is the interrupt function:

 

void WDOG_EWM_IRQHandler( void )
{
*(( unsigned long *)0x90000000 ) = 0x1234ABCD;
}

 

If I stop servicing the watchdog, the CPU resets, but the interrupt is not serviced.

The interrupt priority is higher than every other one.

 

Do I need other code for the interrupt to be executed?

 

Many thanks

Biafra

Outcomes