Skip to content

Commit a279c14

Browse files
kasjerKhiemNguyenT
authored andcommitted
hal: renesas: smartbond: Do not freeze watchdog when enabled
Code was freezing watchdog after waking up from deep sleep. After first deep sleep watchdog was disabled and in case of lockup platform would not reset as expected. Freezing should be done only if watchdog was disabled for build. In case where Zephyr will feed watchdog there is no need to freeze it. Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg.xr@bp.renesas.com>
1 parent 62136a8 commit a279c14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

smartbond/da1469x_hal/da1469x_sleep.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ int da1469x_sleep(void)
7373
sys_clock_selection = CRG_TOP->CLK_CTRL_REG & CRG_TOP_CLK_CTRL_REG_SYS_CLK_SEL_Msk;
7474
slept = da1469x_enter_sleep();
7575
if (slept) {
76+
#if !defined(CONFIG_WATCHDOG)
7677
/* Watchdog is always resumed when PD_SYS is turned off, need to
7778
* freeze it again if there's no one to feed it.
7879
*/
7980
GPREG->SET_FREEZE_REG = GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk;
8081
SYS_WDOG->WATCHDOG_REG = SYS_WDOG_WATCHDOG_REG_WDOG_VAL_Msk;
81-
82+
#endif
8283
da1469x_pd_acquire(MCU_PD_DOMAIN_SYS);
8384
if (da1469x_is_wakeup_by_jtag()) {
8485
wait_for_jtag = 1;

0 commit comments

Comments
 (0)