Showing results for 
Search instead for 
Did you mean: 

how to disable watchdog on STM32G071KBU3

Associate II

I need to disable windowed watchdog before jump from application to my custom Bootloader.
From LL enable routine and from rm0444, I read that bit WDGA (Activation bit) of WWDG_CR register, can only be set.
The reset of this bit is only possible after a reset of the micro.
I also try, before jump to Bootloader, to refresh the WWD with a number of counts to have watchdog period of 120 ms.
Is not enough to avoid a reset during jump.
Any other way to disable the watchdog?

Thank you.


The watchdog can only be disabled by a reset.

Put the jump to bootloader code at the start of your program and check for a magic value in SRAM somewhere for the jump. In your program, write the magic value and reset and it'll jump to the bootloader.

If you feel a post has answered your question, please click "Accept as Solution".
Associate II

Another question about the usage of the watchdog:

Once the watchdog is enabled, is possible to modify prescaler end reload value?

I try to make it but I get an hardfault during jump. If I delete the code that modify prelacaler end  reload I correctly make the jump.

I need to know this, because I'm trying to shape the time to reset based on the operation I'm going to do (for example jump to bootloader, flash erase, standard application execution...)

Thank you.

Not sure if you can tamper with the watchdog settings once started. You seem to indicate it's not allowed, or causes a fault. So let's assume it doesn't work.

Suggest you reset, and catch that in your Reset_Handler, transferring control to your application immediately without starting the watchdog.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..