Watchdog for STM32f20xx #988
-
Hello There, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
STM32F2 has two watchdog peripherals, IWDG and WWGD. Otherwise you could just access the peripheral using the defines from ST header, e.g. for the IWDG (untested code): // Enable power/clock to the IWDG peripheral
modm::platform::Rcc::enable<Peripheral::Iwdg>();
// enable access to the IWDG_PR and IWDG_RLR registers
IWDG->KR = 0x5555;
IWDG->PR = (0b010 << IWDG_PR_PR_Pos); // divider /16
IWDG->RLR = (0xFFF << IWDG_RLR_RL_Pos); // reload value: 0xfff==4095
// starts the watchdog
IWDG->KR = 0xCCCC;
// ...
while(1) {
// ...
IWDG->KR = 0xAAAA;
// ...
} |
Beta Was this translation helpful? Give feedback.
-
Hey, a associate of mine developed this as a basic watchdog support for modm |
Beta Was this translation helpful? Give feedback.
Hey, a associate of mine developed this as a basic watchdog support for modm
#1009