AnsweredAssumed Answered

STM32Cube: a bug in clock configuration?

Question asked by khazanskii.roman on Apr 22, 2015
I'm using STM32Cube with stm32f103RB mcu.

I tried to create a simple test project and run into couple of issues. 

1) I have configured project for external clock source (8 MHz) and made HCLK equal to 72 MHz. I checked MCO with oscilloscope  and RCC was configured correct. 
Then I changed external crystal to 12 MHz, opened the same cube project and changed HSE frequency there to 12 MHz and made HCLK once again equal to 72 MHz. Every field was blue, but RCC was actually configured to 24 MHz.

I tried changing HCLK frequency to some other value and then back again, forcing cube to "recalculate" - that didn't help.

I believe there is some bug regarding changes in HSE frequency.

If I create a new project and put there 12 MHz in HSE - everything is correct.

2) Despite the fact that in the clock configuration "To Cortex System Timer" (i.e. SysTick) there is an fixed divisor /8. So if I set HCLK to 72 MHz, Cube shows me that SysTick frequency will be equal to 9 MHz.

But in the actual generated project SysTick is clocked at 72 MHz (and it's reload value actually is set to 71999 to achieve 1 KHz interrupt frequency). That is just a bit misleading.

Outcomes