The following is the suggested code for stopping the WDT while HALTED in debug mode
DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_IWDG_STOP;
iwdg_prescaler preScale = IWDG_PRE_256;
// 1.5 minutes to boot (I set it very long to allow me to debug, while the halt is not working)
iwdg_init(preScale, 12000);
However the compiler complains that
DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_IWDG_STOP;
Neither APB1FZ is a member of DBGMCU, nor does it find the DBGMCU_APB1_FZ_DBG_IWDG_STOP to set the register.
Anyone have any success with the IWDG and halting during debug, by some other method?
Forgot to update the post - I can confirm that the WDT works. Here is the code
void loop() {
// put your main code here, to run repeatedly:
#ifdef ALLOW_WDT
iwdg_feed();
#endif
rtos::ThisThread::sleep_for(mbed::chrono::milliseconds_u32((uint32_t)2000L));
}
in setup or elsewhere
#ifdef ALLOW_WDT
//DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_IWDG_STOP;
__HAL_DBGMCU_FREEZE_IWDG1();
iwdg_prescaler preScale = IWDG_PRE_256; // 1.5 minutes to boot - can adjust
iwdg_init(preScale, 12000); // can adjust
#endif