Watchdog in mdot/xdot
- This topic has 4 replies, 4 voices, and was last updated 6 years, 7 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Hello,
Is there a internal watchdog in mdot/xdot? How is it programmed?
thanks
Hi Sergio,
There is a watchdog available in the mdot and xdot. The mdot uses an STM32F411RE processor and the xdot uses an STM32L151CC processor. We do not enable the watchdog.
Kind regards,
Leon
OK,thanks
Helpful links:
Watchdog Example:
https://github.com/fboris/STM32Cube_FW_F4/blob/master/Projects/STM324xG_EVAL/Examples/IWDG/IWDG_Example/Src/main.c
STM32F411xC/E Reference Manual:
https://www.st.com/resource/en/reference_manual/dm00119316.pdf
For the xDot:
IWDG_HandleTypeDef hiwdg;
...
// Enable watchdog. Clock is 37 KHz, reload is 0xfff, prescaler 256, so we need to
// reset the watchdog within 0xfff / 37k * 256 seconds = 28 seconds.
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_256;
hiwdg.Init.Reload = 0xfff;
if ( HAL_IWDG_Init(&hiwdg) != HAL_OK ) {
// Error
}
Call HAL_IWDG_Refresh(&hiwdg)
to reset the watchdog.
Note that this watchdog can’t be disabled and will keep running in sleep mode (stop, not sure about standby).