Skip to content

Commit 5963a31

Browse files
committed
[NUCLEO_F401RE] Restart PLL after deepsleep
1 parent 75716e0 commit 5963a31

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F401RE/system_stm32f4xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
*/
127127

128128
/* [ADDED FOR MBED] */
129-
static void SystemClock_Config(void);
129+
void SystemClock_Config(void);
130130

131131
/**
132132
* @}
@@ -266,7 +266,7 @@ void SystemCoreClockUpdate(void)
266266

267267
/* [ADDED FOR MBED]
268268
Configure the System clock to 84 MHz (max value) using the internal HSI 16 MHz clock */
269-
static void SystemClock_Config(void)
269+
void SystemClock_Config(void)
270270
{
271271
RCC_ClkInitTypeDef RCC_ClkInitStruct;
272272
RCC_OscInitTypeDef RCC_OscInitStruct;

libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F401RE/sleep.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#include "cmsis.h"
3232
#include "stm32f4xx_hal.h"
3333

34+
// This function is in the system_stm32f4xx.c file
35+
extern void SystemClock_Config(void);
36+
3437
static TIM_HandleTypeDef TimMasterHandle;
3538

3639
void sleep(void)
@@ -43,4 +46,6 @@ void deepsleep(void)
4346
{
4447
// Request to enter STOP mode with regulator in low power mode
4548
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
49+
// After wake-up from STOP reconfigure the PLL
50+
SystemClock_Config();
4651
}

0 commit comments

Comments
 (0)