summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorliuxinaliang <[email protected]>2020-01-03 11:17:50 +0800
committerliuxinaliang <[email protected]>2020-01-03 11:17:50 +0800
commit4e23cb027f86f5f9f02865fdfc6d9ff60885162b (patch)
treefc0b78b794cc2ae61af6b903d015cd98c5898672 /bsp
parent24f961fa70c7d110dd24c6c5b043aacfe4f2ce13 (diff)
[bsp][stm32] fixed a bug that caused system crash by changing the run_mode in low power mode
Signed-off-by: liuxinaliang <[email protected]>
Diffstat (limited to 'bsp')
-rw-r--r--bsp/stm32/libraries/HAL_Drivers/drv_pm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_pm.c b/bsp/stm32/libraries/HAL_Drivers/drv_pm.c
index 84ddf6cd41..8f3890474e 100644
--- a/bsp/stm32/libraries/HAL_Drivers/drv_pm.c
+++ b/bsp/stm32/libraries/HAL_Drivers/drv_pm.c
@@ -95,11 +95,13 @@ static void run(struct rt_pm *pm, uint8_t mode)
{
case PM_RUN_MODE_HIGH_SPEED:
case PM_RUN_MODE_NORMAL_SPEED:
+ HAL_PWREx_DisableLowPowerRunMode();
SystemClock_80M();
/* Configure the main internal regulator output voltage (Range1 by default)*/
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
break;
case PM_RUN_MODE_MEDIUM_SPEED:
+ HAL_PWREx_DisableLowPowerRunMode();
SystemClock_24M();
/* Configure the main internal regulator output voltage */
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2);