AnsweredAssumed Answered

STM32F302 Clock Configuration

Question asked by ott.simon on May 21, 2016
Latest reply on Jun 2, 2016 by ott.simon
I am trying to get the Clock Configuration of an STM32F302CB to work. We are using 16 MHz Oscillators. 

With the STM32F4 I used the clock configuration tool to generate the system_stm32xxx.c file. Unfortunately, I did not find a version for the STM32F3. 

I would use the new HAL with the Cube tool but unfortunately we are using the IDE Tasking that is not supported by the tool (Would be great if Tasking would be supported in the future). 

When I configure the Clocks in Cube and generate the code for any supported IDE, I find a generated system_f30x.c file in the project folder, but this seems to be a template without my configured settings (e.g. HSE Value 16.000.000). 

Please let me know if there is any comfortable way to do the clock configuration with the STM32F3 (As with the F4). 

I then tried to configure the clocks manually. The code is attached. My problem is that a read of RCC_GetClocksFreq delivers the correct values: 
HCLK_Frequency = 72000000
SYSCLK_Frequency = 72000000
PCLK2_Frequency = 72000000
PCLK1_Frequency = 36000000
SystemCoreClock = 72000000

But my segger debugger warns that the CPU is running at low speed, about 8 MHz (HSI? The oscillator works fine so this should not be the problem) Therefore, also FreeRTOS is not running properly (The Systick IRQ seems to be much too slow). And therefore the whole system is not working. 

Of course I have set the HSE_VALUE in the stm32f30x.h to 16000000