MKE04VTG4 Controller is getting reset frequently when both systick timer & watchdog timer are enabled.
This is not happening when systick timer is not initialised.
Sir, but in user manual systick timer clock is mentioned.
Please got through below for both systick & watchdog intialisations...
void systick_init()
{
SysTick->LOAD= SYSTICK_TIMER_VALUE;
SysTick->CTRL=(SysTick_CTRL_TICKINT_Msk|SysTick_CTRL_ENABLE_Msk); // INTERRUPT, ENABLE & CLOCKSOURCE ARE SET TO 0
}
void watch_dog_init()
{
WDOG8_GetDefaultConfig(&wdog_config);
wdog_config.enableUpdate = false;
wdog_config.workMode.enableWait = false;
wdog_config.clockSource = kWDOG8_ClockSource1; // FOR 1KHZ CLK
wdog_config.timeoutValue = 50; // WATCH DOG TIMER MUST FEED FOR EVERY 25 MSEC
WDOG8_Init(WDOG,&wdog_config);
}
Hi, Muralidhar,
Can you tell me the cycle time of the systick? If you set it as 500mS or 1S, what is the result?
BTW, if you set up the watchdog feeding cycle time as 250mS, what is the result?
BR
XiangJun Rong
Hi, Muralidhar,
I suppose that you do not have the systick interrupt service routine(ISR) or there is wrong instruction in the ISR of systick, which leads to hardfault error.
As a test, if you disable watchdog, and enable systick, the ISR of systick can happens frequently?
Pls post your code so that we can have a review.
BR
Xiangjun Rong