How could one defeat the config byte enabled watchdog?
Easy with an openocd script that keeps resetting by writing to the peripheral reg.
Something like this every few ms.
IWDG, write reset key
mww 0x40003000 0xAAAA
WWDG, reload counter
mww 0x40002C00 0xFF
Is there any control over the watchdog timeout period, when the wdog is thus enabled?
Starts instantly after reset, holding the default reset values (Pre=4, Load=4095).
That's 500ms, should be enough to init any mcu >1000 times! Otherwise just clear the WWDG periodically.
AFAIK there's nothing keeping you from modifying these values. But you can't turn the WWDG off if set by HW.
BTW I noticed I've mixed up a bit the IWDG and WWDG.
The IWDG takes the slow 32KHz LSI clock (32KHz), has pre 4...256 and 12-bit downcounter.
So max counter value is 4095(+1), with pre=256 gives 32 seconds!
HW IWDG cannot be stopped/halted by any means, can only be cleared.
WWDG clock source is APB1/4096, then has pre=1:2:4:8 (Default is 8 ), and a 7bit downcounter.
The counter resets to 0x7F and starts counting down, it'll trigger a reset in the transition of 0x40 to 0x3F.
So, you must reload the counter before it gets that low.
You can have anywhere between 4096*1*1=4096, to 4096*8*(0x7F-0x3F)=2.1M clocks.
Normally APB1 runs at half the CPU clock, so at 84MHz 4096=48us and 2.1M=24.9ms timeout.
HW WWDG cannot be stopped either, but can be halted by a debugger using DBGMCU bits.
(RM is your friend).