Skip to content

Commit 5aaf3a3

Browse files
authored
Merge pull request #14720 from chrJost/STM32L5x2_pwr_register
STM32L5: corrected voltage scaling when using MSI
2 parents be9850b + 3bfa124 commit 5aaf3a3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

targets/TARGET_STM/TARGET_STM32L5/system_clock.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ uint8_t SetSysClock_PLL_MSI(void)
121121
{
122122
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
123123
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
124-
125-
/* Configure the main internal regulator output voltage */
126-
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE0) != HAL_OK) {
127-
return 0; // FAIL
128-
}
129-
124+
130125
/* Configure LSE Drive Capability */
131126
__HAL_RCC_PWR_CLK_ENABLE();
132127
__HAL_RCC_SYSCFG_CLK_ENABLE();
133128
HAL_PWR_EnableBkUpAccess();
134129
__HAL_RCC_RTCAPB_CLK_ENABLE();
135130

131+
/* Configure the main internal regulator output voltage */
132+
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE0) != HAL_OK) {
133+
return 0; // FAIL
134+
}
135+
136136
#if MBED_CONF_TARGET_LSE_AVAILABLE
137137
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
138138
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;

0 commit comments

Comments
 (0)