AnsweredAssumed Answered

Changing STM32 sysclk in run mode

Question asked by kovaliov.nikolaj on Oct 23, 2014
Latest reply on Oct 24, 2014 by waclawek.jan
Good day,

Is it possible to change system clock (PLL) during run mode.

I tried to change it with this one, but does not worked:

RCC->PLLCFGR = PLL_M | (PLL_N << 6) | (((PLL_P >> 1) -1) << 16) |
                   (RCC_PLLCFGR_PLLSRC_HSE) | (PLL_Q << 24);

Still have same:
SYSCLK_Frequency: 84000000 //cannot change it 

HCLK_Frequency  : 84000000 //I can change it
//RCC_HCLKConfig(RCC_SYSCLK_Div2);

PCLK1_Frequency : 42000000 //I can change it
//RCC_PCLK1Config(RCC_HCLK_Div2);

PCLK2_Frequency : 84000000 //I can change it
//RCC_PCLK2Config(RCC_HCLK_Div1);

In some tasks I need my 84 MHz, for some tasks I do not need to have so much power, should be good to lower my CPU speed to save some energy.
Or there are some more ways to save some energy?

Outcomes