2016-03-28 08:57 AM
Hi all,
I have a serious issue with the EWI (Early wakeup interrupt) of the WWDG.I'm using STM32F103 and I'm based on the example of the firmware libraries, I add the configuration of the EWI interrupt : the source code :-----------------------------------------------------------------------------------------/* WWDG configuration */ /* Enable WWDG clock */ RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE);/* On Value line devices, WWDG clock counter = (PCLK1 (24MHz)/4096)/8 = 732 Hz (~1366 us) *//* On other devices, WWDG clock counter = (PCLK1(36MHz)/4096)/8 = 1099 Hz (~910 us) */ WWDG_SetPrescaler(WWDG_Prescaler_8); /* Set Window value to 80; WWDG counter should be refreshed only when the counter is below 80 (and greater than 64) otherwise a reset will be generated */ WWDG_SetWindowValue(80); /* - On Value line devices, Enable WWDG and set counter value to 127, WWDG timeout = ~1366 us * 64 = 87.42 ms In this case the refresh window is: ~1366us * (127-80) = 64.20 ms < refresh window < ~1366us * 64 = 87.42ms - On other devices Enable WWDG and set counter value to 127, WWDG timeout = ~910 us * 64 = 58.25 ms In this case the refresh window is: ~910 us * (127-80) = 42.77 ms < refresh window < ~910 us * 64 = 58.25ms */
WWDG_EnableIT();
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);NVIC_InitStructure.NVIC_IRQChannel = WWDG_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure);
WWDG_ClearFlag(); WWDG_Enable(127);---------------------------------------------------------------------------------------The interrupt service routine code is : void WWDG_IRQHandler(void){ if (WWDG_GetFlagStatus() != RESET) { WWDG_SetCounter(127); WWDG_ClearFlag(); }}----------------------------------------------------------------------The Problem is that the STM32F103 goes directly to EWI interrupt as soon as WWDG is enabled.Can anyone help me please; it is urgent?Thanks,john #stm32f103--wwdg---ewi
2016-03-28 10:16 AM
Hi John, I found some bugs in the WWDG HAL library. Hope this helps.
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fWindow%20Watchdog%20%28WWDG%29%20Early%20Wakeup%20Interrupt%20%28EWI%29%20configuration%20bugs%20in%20firmware%20library&...2016-03-29 01:50 AM
Thx, this helps me to solve the issue.
I can't understand why ST don't clarify this in the ref.Manual !!!