I have a ChibiOS 3.x program on a STM32F4 microcontroller where I use the IWDG watchdog to reset the MCU on errors like this:
int main() {
iwdgInit();
iwdgStart(&IWDGD, &wd_cfg);
while(true) {
// ... do stuff
}
}
If I now attach my debugger and, at any point, stop the program (manually or via a breakpoint), the microcontroller will reset after the timeout defined by the watchdog configuration (and therefore cause issues in my debugging process)
How can I disable this behaviour, i.e. how can I disable the IWDG while the core is stopped due to the debugger?
I have tried disabling it entirely, however, I need to leave it running to catch unwanted IWDG resets.