I'm attempting to get the watchdog timer working on an STM32F072. Here's what I see:
* The watchdog does reset periodically as expected.
* However, wdgReset() seems to hang the system, or cause an immediate reset - hard to immediately tell.
Has the wdgTimer() been tested / certified for the STM32F0 ? I did not see it listed in the testhal for this processor.
I've enabled it both in the mcuconf.h and halconf.h and implemented it simply in my main.c:
Code: Select all
#define MAIN_THREAD_SLEEP_MS 1000
#define WATCHDOG_TIMEOUT 1000
/* Watchdog configuration and initialization
*/
static void start_watchdog(void)
{
const WDGConfig wdgcfg = {
STM32_IWDG_PR_64,
STM32_IWDG_RL(WATCHDOG_TIMEOUT)
};
wdgStart(&WDGD1, &wdgcfg);
}
int main(void) {
halInit();
chSysInit();
start_watchdog();
while (true) {
chThdSleepMilliseconds(MAIN_THREAD_SLEEP_MS);
wdgReset(&WDGD1);
}
return 0;
Thanks for any help.