AnsweredAssumed Answered

S32K116 Watchdog Configration Fail

Question asked by hu biao on Oct 26, 2018
Latest reply on Oct 30, 2018 by Daniel Martynek

static void S32K1xx_WDog_Init(void)
{
WDOG_MemMapPtr WDOG_PTR = (WDOG_MemMapPtr)WDOG_BASE;

WDOG_PTR->CNT = 0xD928C520; //unlock watchdog
while( 0 == ( WDOG_PTR->CS & WDOG_CS_ULK(1) ) ); //wait until registers are unlocked
WDOG_PTR->TOVAL = 256; //set timeout value
WDOG_PTR->CS = WDOG_CS_EN(1) | WDOG_CS_CLK(1) | WDOG_CS_INT(1) |
WDOG_CS_WIN(0) | WDOG_CS_UPDATE(0) | WDOG_CS_DBG(1);
while( 1 == ( WDOG_PTR->CS & WDOG_CS_ULK(1) ) ); //wait until registers are locked
while( 0 == ( WDOG_PTR->CS & WDOG_CS_RCS(1) ) ); //wait until new configuration takes effect

}

 

I Init WDG as above,but the Watch dog register CNT don't change, and RCS register don't change to 1.

the WDG don't work.

 

the MCU is S32K116.

Attachments

Outcomes