Bug in STM32F4 Series MCU, window watchdog WWDG.
1. If it is possible to pre-feed the dog interrupt, then the following two points must be met
(1) Before turning on the WWDG interrupt, the EWI flag bit in the SR register must be zeroed out, otherwise the watchdog will constantly reset
(2) Add a small delay to the WWDG_IRQ, otherwise the watchdog will be constantly reset
2. If there are other interrupts in the system, such as keystrokes, set a variable in the key interrupt, which is read in the WWDG_ISR to decide whether to stop feeding the dog
When you press the button, the system flies directly.
A test code is given here. as shown below.
/** ****************************************************************************** * @file USART/USART_Printf/main . c * @author MCD application Team * @version V1.0.1 * @date 13-april-2012 * @brief Main Program Body * * * * * * @attention * * <H2><CENTER> ; ©copyright stmicroelectronics</center>