Skip to content

Commit 6765cf7

Browse files
authored
Merge pull request #3311 from xiangxistu/master
[bsp][stm32] fixed a bug that caused system crash by changing the run_mode in low power mode
2 parents 026dcd6 + 4e23cb0 commit 6765cf7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bsp/stm32/libraries/HAL_Drivers/drv_pm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ static void run(struct rt_pm *pm, uint8_t mode)
9595
{
9696
case PM_RUN_MODE_HIGH_SPEED:
9797
case PM_RUN_MODE_NORMAL_SPEED:
98+
HAL_PWREx_DisableLowPowerRunMode();
9899
SystemClock_80M();
99100
/* Configure the main internal regulator output voltage (Range1 by default)*/
100101
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
101102
break;
102103
case PM_RUN_MODE_MEDIUM_SPEED:
104+
HAL_PWREx_DisableLowPowerRunMode();
103105
SystemClock_24M();
104106
/* Configure the main internal regulator output voltage */
105107
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2);

0 commit comments

Comments
 (0)