cancel
Showing results for 
Search instead for 
Did you mean: 

In function SystemInit(),system_stm32l0xx.c file, I am confused by this code: RCC->CFGR &= (uint32_t)0xFF02FFFF;

wjian.10
Associate II

Hello, everyone,

Thank you so much for you time. I have a question for you. According to device reference manual RM0377 for STM32L0xx series, in chapter 7.3.3 Clock configuration register (RCC_CFGR), set PLLDIV[1:0] to 00 is not allowed. So how can SystemInit() in official firmware provided by ST configure   RCC->CFGR using this code : RCC->CFGR &= (uint32_t)0xFF02FFFF;  

Looking forward to you guidance.

yours, a newcomer.=)

3 REPLIES 3

Isn't it also turning off the PLL? The value of other bit is inconsequential if the unit itself is not enabled and clocking. See also reset value.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
wjian.10
Associate II

I saw that bit field VOS[1:0] of PWR_CR is also "forbidden" to set to 00, and it note that "bits are unchanged and keep the previous value, no voltage change occurs". Is that the same case for setting PLLDIV[1:0]?

Thank you so much for your reply. PLL is indeed turned off. I am curious about if I accidentally set those field to "not allowed" or "forbidden" value, what problem will it cause? Is it "unknown consequence"?