Question
Voltage scaling: way to set 1.5V/16MHz
Posted on July 18, 2014 at 15:46
I would like to set a Vcore voltage range to 1.5V and then back to default 1.8V on STM32L1xx for some code execution. I did not found anywhere the correct procedure, what everything has to be change, but generally it only seems the FLASH WS needs to be changed too.
Here is what I came to:FLASH_SetLatency(FLASH_Latency_1);
/* Set internal voltage regulator to 1.5V */ PWR_VoltageScalingConfig(PWR_VoltageScaling_Range2); /* Wait Until the Voltage Regulator is ready */ while (PWR_GetFlagStatus(PWR_FLAG_VOS) != RESET) ; /* Some code here */ /* Set internal voltage regulator to 1.8V */ PWR_VoltageScalingConfig(PWR_VoltageScaling_Range1); /* Wait Until the Voltage Regulator is ready */ while (PWR_GetFlagStatus(PWR_FLAG_VOS) != RESET) ; FLASH_SetLatency(FLASH_Latency_0); But after this it ends up in a HardFault. What else needs to be done to dynamically scale the voltage like this? #stm32l1-voltage-scaling