Skip to content

Commit 3103fc8

Browse files
ABOSTMnashif
authored andcommitted
soc: arm: stm32l0: set voltage scaling to range1
Default Voltage scaling range selection (range2) doesn't allow to configure Max frequency switch to range1 to match any frequency Signed-off-by: Alexandre Bourdiol <[email protected]>
1 parent 7650d91 commit 3103fc8

File tree

1 file changed

+9
-0
lines changed
  • soc/arm/st_stm32/stm32l0

1 file changed

+9
-0
lines changed

soc/arm/st_stm32/stm32l0/soc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <arch/arm/aarch32/cortex_m/cmsis.h>
1616
#include <linker/linker-defs.h>
1717
#include <string.h>
18+
#include <stm32_ll_bus.h>
19+
#include <stm32_ll_pwr.h>
1820

1921
/**
2022
* @brief Perform basic hardware initialization at boot.
@@ -43,6 +45,13 @@ static int stm32l0_init(const struct device *arg)
4345
/* At reset, system core clock is set to 2.1 MHz from MSI */
4446
SystemCoreClock = 2097152;
4547

48+
/* Default Voltage scaling range selection (range2)
49+
* doesn't allow to configure Max frequency
50+
* switch to range1 to match any frequency
51+
*/
52+
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
53+
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
54+
4655
return 0;
4756
}
4857

0 commit comments

Comments
 (0)