cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble configuring the system clock for an STM32F303K8T6 for speeds higher than 16Mhz (using CubeMX and CubeIDE)

AHatt.1
Associate II

Hardware:

My board is a custom board that has an STM32F303K8T6. It has an external 8Mhz crystal as well as a ferrite choke between VDDA and VDD, and other passive capacitors.

Situation:

I am trying to configure the system clock for 72mhz using Cube MX(6.2.1) and the Cube IDE (1.5.0). First, my test program (blinking LEDs, and printing/receiving serial commands) runs fine when the input to the System Clock Mux is simply the internal (HSI) or external (HSE) clock with no PLL multiplier. It also runs fine with any combination of PLL multiplication and dividing as long as the output of the System Clock Mux is less than or equal to 16mhz (example described below).

Problem:

When I attempt to use a higher PLL multiplier (for example to get my desired clock configuration that's attached), my program seems to crash.

After using the debugger, I see my program enters the SystemClock_Config function, makes it to HAL_RCC_OscConfig, and then the debugger loses communication during the PLL Configuration at the macro" __HAL_RCC_PLL_ENABLE()". Attached are screenshots of these areas of code as well.

I'm not sure how to debug next. I've tried using the internal and external clocks with varying multipliers and have been unable to get anything above 16mhz at the System Clock to work. Ex: Input HSE @8mhz /8 before the PLL MUX with a PLL multiplier of 16x = 16Mhz SYSCLK works fine but I cannot reach my desired clock speed.

Thanks!

11 REPLIES 11

Thanks for the advice! I'll add a bulk capacitor in the next board revision.

Humm.

Maybe you should elaborate no the "does not work" part. When observing using debugger, what does exactly happen, does the program go to an infinite loop, does it go into hardfault, or anything else?

JW