1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-15 18:00:59 +00:00

fix(core): fix suspending to STOP2 mode

[no changelog]
This commit is contained in:
cepetr 2025-01-13 19:08:16 +01:00 committed by cepetr
parent 4fda1c4dfb
commit 22f132c935
2 changed files with 9 additions and 1 deletions

View File

@ -95,9 +95,16 @@ void powerctl_suspend(void) {
// immediately after exiting STOP2 mode.
irq_key_t irq_key = irq_lock();
// Enter STOP2 mode
// The PWR clock is disabled after system initialization.
// Re-enable it before writing to PWR registers.
__HAL_RCC_PWR_CLK_ENABLE();
// 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();

View File

@ -129,6 +129,7 @@ def configure(
]
features_available.append("usb")
paths += ["embed/io/usb/inc"]
defines += [("USE_USB", "1")]
defines += [
"FRAMEBUFFER",