7 years ago.

Correct procedure for changing SystemCoreClock? STM32F091RC.

I'm working offline in Keil uVision 5 and mbed os 5.4. Is there an official correct procedure for configuring the system clock to something other than the mbed default? I understand HSE vs HSI, PLLS, etc. This is a question about the organization of mbed os and how to ensure this change propagates correctly and everything works right. I tried adjusting PLL settings inside:

system_stm32f0xx.c

The micro slows down and SystemCoreClock from main() is reported slower, as expected. But now some of the peripheral timing (like UART 2 baud rate) are not right. That is, even though I changed system clock during micro startup, this information seems not to making its way into the uart initialization.

SystemCoreclock is declared in system_stm32f0xx.h and defined in system_stm32f0xx.c. Should the initialization value make any difference on final system clock speed? Changing this to my target clock rate does actually resolve the issue with UART baud rate, but it doesn't seem like it should.

uint32_t SystemCoreClock = 48000000;

Any insight appreciated. Thanks.

Be the first to answer this question.