Page 1 of 1

Change clock, from external 72MHz to internal 48MHz

Posted: Mon Oct 05, 2020 11:43 am
by billys7
Hello,
I want to use an STM32F103 without external oscillators. My experiments are on a Bluepill and I am trying to change the clock from external clock 72MHz to internal clock 48MHz. I know which registers i have to change, but i don't think that it is so easy. I can't make it to work.

What is the procedure?

Re: Change clock, from external 72MHz to internal 48MHz

Posted: Mon Oct 05, 2020 12:27 pm
by fpiSTM
Hi,


simply redefine at sketch level the void SystemClock_Config(void) as this is a WEAK (for ref: https://github.com/stm32duino/Arduino_C ... t.cpp#L105)

Use extern "C" else this wil not work:

Code: Select all

extern "C" void SystemClock_Config(void) {
  /* Your custom clock config */
}

Re: Change clock, from external 72MHz to internal 48MHz

Posted: Tue Oct 06, 2020 7:18 am
by billys7
Thank you!