AnsweredAssumed Answered

STM32L100C Discovery clock after reset

Question asked by Kozlov.Dmitrii on Dec 9, 2015
Latest reply on Dec 9, 2015 by Kozlov.Dmitrii
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)

Outcomes