From d6fb676814392a298687b01263652816dd8839cc Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Thu, 21 Mar 2019 19:42:08 +0100 Subject: [PATCH] stm32l0/pm: clear wakeup flags when setting STOP mode. --- cpu/stm32_common/periph/pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu/stm32_common/periph/pm.c b/cpu/stm32_common/periph/pm.c index cca24bcf80..d2cf058d67 100644 --- a/cpu/stm32_common/periph/pm.c +++ b/cpu/stm32_common/periph/pm.c @@ -43,7 +43,8 @@ #if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F3) #define PM_STOP_CONFIG (PWR_CR_LPDS) #elif defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32L1) -#define PM_STOP_CONFIG (PWR_CR_LPSDSR | PWR_CR_ULP) +/* Enable ultra low-power and clear wakeup flags */ +#define PM_STOP_CONFIG (PWR_CR_LPSDSR | PWR_CR_ULP | PWR_CR_CWUF) #elif defined(CPU_FAM_STM32L4) #define PM_STOP_CONFIG (PWR_CR1_LPMS_STOP1) #elif defined(CPU_FAM_STM32F7)