From 8402c26cfa98b4689f5ac4673952a654cfe5b678 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 18 Apr 2019 17:15:11 +1000 Subject: [PATCH] stm32/powerctrl: Enable EIWUP to ensure RTC wakes device from standby. --- ports/stm32/powerctrl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/stm32/powerctrl.c b/ports/stm32/powerctrl.c index 165919977f..669e568f8a 100644 --- a/ports/stm32/powerctrl.c +++ b/ports/stm32/powerctrl.c @@ -390,6 +390,12 @@ void powerctrl_enter_standby_mode(void) { // enable previously-enabled RTC interrupts RTC->CR |= save_irq_bits; + #if defined(STM32F7) + // Enable the internal (eg RTC) wakeup sources + // See Errata 2.2.2 "Wakeup from Standby mode when the back-up SRAM regulator is enabled" + PWR->CSR1 |= PWR_CSR1_EIWUP; + #endif + // enter standby mode HAL_PWR_EnterSTANDBYMode(); // we never return; MCU is reset on exit from standby