Change clock, from external 72MHz to internal 48MHz

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
billys7
Posts: 8
Joined: Fri Apr 24, 2020 3:38 pm

Change clock, from external 72MHz to internal 48MHz

Post 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?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

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

Post 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 */
}
billys7
Posts: 8
Joined: Fri Apr 24, 2020 3:38 pm

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

Post by billys7 »

Thank you!
Post Reply

Return to “General discussion”