AnsweredAssumed Answered

WatchDog Configuration of s9keazn8

Question asked by wu wenbin on Aug 29, 2019
Latest reply on Sep 4, 2019 by Felipe García


I have got a problem with WatchDog Configuration of the s9keazn8.

Mcu:s9keazn8    ;

Tool: PE micro multilink universal

software:S32 Design Studio for ARM;Version: 2018.R1


I use the following code  ; I do not get 1s periodic reset but get 51s periodic

#define DisableInterrupts asm("CPSID i")
#define EnableInterrupts asm("CPSIE i")

void WatchDogCfg(void)


   WDOG_CNT = 0X20c5;
   WDOG_CNT = 0X28d9;
   WDOG_TOVAL = 1000;// 1s times out
   WDOG_CS2 = 0x01;


void main(void)



   SIM_SOPT = 0X0000000C;//NMIE:when clear,the pin functions as one of its alternative functions


   GPIOA_PSOR |= 1<<13;//Light the LED A



      #if 0                    // if I don't feed the dog then the mcu will reset and will light off the LED A 
         WDOG_CNT = 0X2A6;
         WDOG_CNT = 0X80B4;





So  i wonder if it has anything to do with starup_code ——void SystemInit (void) .I find that the watchDog is configurated in it.But UPDATE bit is set,so I think it is ok.

what i have done:

1:WDOG->TOVAL = WDOG_TOVAL_TOVAL(0xE803); /* Timeout value */ 


result:  the periodic is 51s too;

2:I use my code instead in the void SystemInit (void)
WDOG_CNT = 0X20c5;
WDOG_CNT = 0X28d9;
WDOG_TOVAL = 1000;
WDOG_CS2 = 0x01;
#if 0
   /* WDOG->TOVAL: TOVAL=0xE803 */
   WDOG->TOVAL = WDOG_TOVAL_TOVAL(0xE803); /* Timeout value */
   /* WDOG->CS2: WIN=0,FLG=0,?=0,PRES=0,?=0,?=0,CLK=1 */
   WDOG->CS2 = WDOG_CS2_CLK(0x01); /* 1-kHz clock source */
   /* WDOG->CS1: EN=0,INT=0,UPDATE=1,TST=0,DBG=0,WAIT=1,STOP=1 */
   WDOG_CS1_TST(0x00) |
   #endif /* (DISABLE_WDOG) */

result:  the periodic is 51s too;it looks llike somewhere else what i don't find.


Last is how i load the code into the actrual mcu: I don't configurate anything ,choose 1 and press 2.

Is there any problem?