diff --git a/configs/stm3210e-eval/src/up_idle.c b/configs/stm3210e-eval/src/up_idle.c index 13c88ee8080..5b9f3c9faec 100644 --- a/configs/stm3210e-eval/src/up_idle.c +++ b/configs/stm3210e-eval/src/up_idle.c @@ -39,17 +39,19 @@ * Included Files ****************************************************************************/ -#include #include +#include + #include #include #include - -#include #include + #include +#include + #include "up_internal.h" #include "stm32_pm.h" #include "stm32_rcc.h" @@ -288,7 +290,18 @@ static void up_idlepm(void) if (oldstate == PM_STANDBY) { + /* Re-enable clocking */ + stm32_clockenable(); + + /* The system timer was disabled while in PM_STANDBY or + * PM_SLEEP modes. But the RTC has still be running: Reset + * the system time the current RTC time. + */ + +#ifdef CONFIG_RTC + clock_synchronize(); +#endif } } break;