Skip to content

Commit 102ac1a

Browse files
ABOSTMcfriedt
authored andcommitted
drivers: clock_control: stm32u5: set voltage scaling VOS for MSIS
In case of MSIS selected as system clock source it is necessary to set Voltage scaling (VOS) when freqency is greater than 24MHz Signed-off-by: Alexandre Bourdiol <[email protected]>
1 parent ffb6a31 commit 102ac1a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/clock_control/clock_stm32_ll_u5.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,15 @@ void config_src_sysclk_msis(LL_UTILS_ClkInitTypeDef s_ClkInitStruct)
487487
LL_SetFlashLatency(new_hclk_freq);
488488
}
489489

490+
if (new_hclk_freq > MHZ(24)) {
491+
/* when freq > 24MHz it is necessary to set voltage scaling
492+
* to range3
493+
*/
494+
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE3);
495+
while (LL_PWR_IsActiveFlag_VOS() == 0) {
496+
}
497+
}
498+
490499
/* Set MSIS as SYSCLCK source */
491500
set_up_clk_msis();
492501
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_MSIS);

0 commit comments

Comments
 (0)