2025-05-16 9:15 AM
Hi,
I used to run my STM32F303RE at 72Mhz clock from a 8Mhz CMOS oscillator. . Timers8/1 operated at 72Mhz as well. That worked fine.
I had to change the CMOS oscillator from 8 to 24Mhz.
I tried two modifications, see attachment:
a) I changed PLLMul from x9 to x3 and left PREDiv. at /1.
b) I changed PREDiv to /3 and left PLLMul at x9.
In both cases CubeIDE clocktree was fine with the setup, 72Mhz imput clock at Timers8/1.
Eventually now the input clock of the timers is low by factor 9, it is 8Mhz.
What did I miss?
Thank you.
Cheers
Detlef
Solved! Go to Solution.
2025-05-16 9:37 AM
Yes, sounds odd, not sure if we're missing some detail.
If you're using an XO (External Oscillator), rather than a crystal, you should be using HSE_BYPASS mode.
The Classic F3 architecture doesn't allow for different TIMCLK sources (Peripheral Clocks)
2025-05-16 9:37 AM
Yes, sounds odd, not sure if we're missing some detail.
If you're using an XO (External Oscillator), rather than a crystal, you should be using HSE_BYPASS mode.
The Classic F3 architecture doesn't allow for different TIMCLK sources (Peripheral Clocks)
2025-05-16 12:18 PM
>Eventually now the input clock of the timers is low by factor
I dont unterstand: how you know, what is the real timer clock now? And changing HSE and adapt divider will not change the timer clock.
2025-05-16 2:18 PM
Hi,
I know the real timer clock by routing the output of the timer to an output pin and hooking up an oscilloscope or a counter. This works fine since decades.
I don't know how to bypass HSE input logic, this block is grayed out, maybe there are switches which are not available with CubeIDE.
I just realized another weird aspekt: the baudrates for USART2 work fine, so the USART seems to have the exspected clockrate. I will check the clock frequency for the processor kernel with SYSTICKS, maybe the problem is limited to the counters.
THX
Cheers
Detlef
2025-05-17 2:05 AM
Dear @DetlefS ,
it may happen that Timers are clocked by 72MHz directly from PLL output, but system clock mux is selecting HSI clock at 8MHz , you can check that by outputting the main MCO clock on PA8 and see the CPU and APB clocks . Hope it helps you.
STOne-32
2025-05-18 6:48 AM
Hi,
bypassing HSE was the solution, thank you.
It was grayed out in the clock tree selection window and it took me a while to find it in PinoutConfiguration -> SystemCore -> RCC -> HSEbypass.
Changing the clock configuration on the fly is challenging as well with PLL sync issues and CSS kicking in.
But now it is working, thx.
Cheers
Detlef
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.