Skip to main content
raji a
Associate
August 7, 2017
Question

clock change

  • August 7, 2017
  • 2 replies
  • 735 views
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
    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    August 7, 2017
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    raji a
    raji aAuthor
    Associate
    August 8, 2017
    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;