2021-12-01 04:27 AM
I am using STM32L562E-DK for my development. I have ported SBSFU for it.
I want to add watchdog functionality to it. Currently, I am initializing the watchdog (window) from the application and feeding it from Freerto's task in the application.
Now, I want to init the watchdog in the bootloader and feed it from the application.
For another interface (e.x. timer) we need to deinit the timer in the bootloader before jumping to the application if the same timer is used in the application. As watchdog doesn't have deinit functionality, is it possible to use watchdog from an application that is initialized in bootloader?
@Frantz LEFRERE , Can you please help me regarding it?
2021-12-01 06:12 AM
> is it possible to use watchdog from an application that is initialized in bootloader?
Yes. The procedure to reset the watchdog is the same regardless of where/who starts the watchdog.
2021-12-01 06:16 AM
The watchdog behaves the same, you'd kick it in exactly the same way.
One issue is when to enable it, as flash erase/write operations can stall the MCU, so if the loader implements updates be cognizant of what time certain operations consume.
2021-12-02 12:49 AM
In fact the X-SBSFU package have an implementation of watchdog protection but this has not been put in place in the SBSFU cortex M33.
2021-12-02 04:27 AM
Thanks @TDK , @Community member and @Frantz LEFRERE , for your input,
TO init watchdog I can use HAL_WWDG_Init(&hwwdg) to init. But in the application how I will be able to get the context of initialized watchdog hwwdg in the application?
As HAL_WWDG_Refresh(&hwwdg), Can I use the same configuration and without init If I call HAL_WWDG_Refresh(&hwwdg) API will it refresh the watchdog counter?
2021-12-02 05:15 AM
Simplest way is to write directly in the register :
WRITE_REG(IWDG->KR, IWDG_KEY_RELOAD);
2021-12-08 01:57 AM
Thanks @Frantz LEFRERE , @TDK ,@Community member for your input. I am able to init window watchdog from bootloader and able to feed it from the application.