Skip to main content
Associate III
August 4, 2023
Question

how to disable watchdog on STM32G071KBU3

Hi,
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.
Regards.

    This topic has been closed for replies.

    4 replies

    TDK
    August 4, 2023

    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""."
    DAUSILIAuthor
    Associate III
    August 7, 2023

    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.

    Tesla DeLorean
    Guru
    August 7, 2023

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..