Problems dividing HCLK - STM32L433RCTxP
Hi, everyone.
When implementing a sort of delay function using Timer2 to have a more precise time control, while putting the MCU in power-saving mode, I noticed that the division performed to the APB1/2 clocks does not correspond to what's programmed. See below a short description of what I observed:
RCC->CFGR |= (RCC_CFGR_PPRE1_DIV1 | RCC_CFGR_PPRE2_DIV1); //No division, as expected
RCC->CFGR |= (RCC_CFGR_PPRE1_DIV2 | RCC_CFGR_PPRE2_DIV2); //No division, expected by 2
RCC->CFGR |= (RCC_CFGR_PPRE1_DIV4 | RCC_CFGR_PPRE2_DIV4); //Divides HCLK by 2, expected by 4
RCC->CFGR |= (RCC_CFGR_PPRE1_DIV8 | RCC_CFGR_PPRE2_DIV8); //Divides HCLK by 4, expected by 8
Meanwhile, I noticed that on the .ioc file the frequency at the output of the APB1 Prescaler gets multiplied by two if this prescaler is greater than 1 (2, 4, 8 or 16), as shown below.





I can't change the multiplier that outputs the clock to the APB1 timer clocks and, thus, I suspect that these might be related since it might explain what I observed.
Is that so? If, yes, what's the reason and/or can I find documentation regarding this topic?
Thanks in advance,
Pedro Machado
