Skip to content

Commit

Permalink
fixup! fix(core): fix suspending to STOP2 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cepetr committed Jan 6, 2025
1 parent 0124317 commit 220fd9e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/embed/sys/powerctl/stm32u5/powerctl_suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,16 @@ void powerctl_suspend(void) {
// immediately after exiting STOP2 mode.
irq_key_t irq_key = irq_lock();

// Enable PWR peripheral clock
// (required by the following HAL_PWREx_EnterSTOP2Mode)
// The PWR clock is disabled after system initialization.
// Re-enable it before writing to PWR registers.
__HAL_RCC_PWR_CLK_ENABLE();

// Enter STOP2 mode
// Enter STOP2 low-power mode
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

// Disable PWR clock after use
__HAL_RCC_PWR_CLK_DISABLE();

// Recover system clock
SystemInit();

Expand Down

0 comments on commit 220fd9e

Please sign in to comment.