K64F120M watchdog reset problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K64F120M watchdog reset problem

926 Views
wulinweng
Contributor II

Dear Support:
About the watchdog for the software in K64 MCU, and now we encountered a problem is that:
When we do the power on and power off test, sometime the software watchdog will reset the system.
the init of the watchdog time out time is 250ms, core is 120M, bus is 60M.
  WDOG_TOVALH = (uint16_t)0x4CU;     /* Setup time-out value register high */
  WDOG_TOVALL = (uint16_t)0x4B4BU;       /* Setup time-out value register low */ /*Time out counter = 5000011, 250ms*/
And I feed the dog in an ISR like below:
void WDOG_Feed()
{
_int_disable();
WDOG_REFRESH=(uint16_t)0xA602U;
WDOG_REFRESH=(uint16_t)0xB480U;
_int_enable();
}

And the ISR's priority is the highest of the system, the priority num is 2.
the question is I don't know how to feed the dog is the correct way, in the cycle time task like 20ms, or in the highest priority ISR task?

BR,

0 Kudos
Reply
3 Replies

653 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello weng,

You can feed Watchdog in a while(1) , or you can use on time interrupt to feed.

What IDE do you use ? If you use KDS or IAR , in the ksdk, there is one Watchdog demo ,you can refer to :

BR

Alice

0 Kudos
Reply

653 Views
wulinweng
Contributor II

Hello Alice,

My IDE is IAR. My question is that can we feed the dog in the ISR?

because in the feed dog we should disable the int, and what I confuse is that in the ISR to disable the intterrupts to feed the dog?

Is it correct?

BR

Mike

0 Kudos
Reply

653 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Mike,

The ISR you said is watchdog iSR? If yes, i think it late . the interrupt is generate when it does not

feed the watchdog on time , and if after it enter interrupt then feed the watchdog , it is late .

The demo i mentioned last time is here (after install the KSDK1.3):

Freescale\KSDK_1.3.0\examples\frdmk64f\driver_examples\wdog\iar .

BR

Alice

0 Kudos
Reply