Question
STM32L100C Discovery clock after reset
Posted on December 09, 2015 at 16:22
I've started to look for the answer for the following question after finding out the problem with UART. It did not work correctly, and I tried to change baud rate from 115200 to 57600. After that UART worked.
I use SystemCoreClock variable and after updating it gets value 32M. But in accordance to UART baud rate actual clock value is 16M.I use startup_stm32lxx_mpd.s code, which calls SystemInit -> SetSysClock. It tries to set PLL(HSE) as clock source. But STM32L-DISCO doesn't have external source by default.It's strange, but after init process register shows that PLL is used and clock frequency is 32MHz.If not to use SystemInit clock source is MSI with frequency about 2 MHz as datasheet claims.How can it happen?ANSWER:Set the HSEBYP before HSEON. (see comments below) #stm32l100 #clock #systeminit