AnsweredAssumed Answered

Voltage scaling: way to set 1.5V/16MHz

Question asked by pribyl.adam on Jul 18, 2014
Latest reply on Aug 25, 2014 by pribyl.adam
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?

Outcomes