cancel
Showing results for 
Search instead for 
Did you mean: 

clock change

raji a
Associate
Posted on August 07, 2017 at 15:08

Hit

    I am Using STM32L0 Discovery board, i want to switching the clock configuration from HSI to MSI and Vice vesa in my application . 

For LowPower run  Mode ,i need MSI clock .During Startup ,Sleep Mode ,and after LowPower run Mode i need to switch From MSI to HSI clock .

Please Help me how to do this .

#clock-configuration
2 REPLIES 2
Posted on August 07, 2017 at 18:38

Using what library?

Review SystemClock_Config() code. Use of HAL_RCC_OscConfig() and HAL_RCC_ClockConfig()

Libraries typically have multiple examples, and use-case demonstrations. Review those.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 08, 2017 at 07:19

Thanks for your reply . pLEASE find my sysclock_config() below 

 RCC_OscInitTypeDef RCC_OscInitStruct;

 RCC_ClkInitTypeDef RCC_ClkInitStruct;

 __HAL_RCC_PWR_CLK_ENABLE();

 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;

 RCC_OscInitStruct.HSIState = RCC_HSI_ON;

 RCC_OscInitStruct.HSICalibrationValue = 16;

 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;

 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;