Skip to content

Commit a379655

Browse files
committedJan 17, 2025·
fix(h7): missing regulator state in STOP mode
Fixes #117. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent f522276 commit a379655

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎src/low_power.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,17 @@ void LowPower_stop(serial_t *obj)
495495
// STM32L4+ must keep SRAM3 content when entering STOP2 lowpower mode
496496
HAL_PWREx_EnableSRAM3ContentRetention();
497497
#endif /* PWR_CR1_RRSTP */
498-
// STM32L4xx supports STOP2 mode which halves consumption
498+
// STM32L4xx and STM32H7xx supports STOP2 mode which halves consumption
499+
#if defined(STM32H7xx)
500+
#if defined(PWR_LOWPOWERREGULATOR_ON)
501+
HAL_PWREx_EnterSTOP2Mode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
502+
#else
503+
HAL_PWREx_EnterSTOP2Mode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI);
504+
#endif
505+
HAL_PWREx_EnterSTOP2Mode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
506+
#else
499507
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
508+
#endif
500509
} else
501510
#endif
502511
{

0 commit comments

Comments
 (0)
Please sign in to comment.