cancel
Showing results for 
Search instead for 
Did you mean: 

HSE fails to initialize in STM32F205ZG using SPL

aatif shaikh
Associate III

hello!

  I was devolving my project on the "STM3220xG eval-board" (based on controller "STM32F207IGH6"). Now as my custom made controller board is ready (based on "STM32F205ZGT6"), I ported my code for it by changing in peripheral's Pin-numbers and Keil settings (controller selection).

   In my custom made controller board I've kept the crystal settings same as eval board, but still due to an unknown issue my clock source keeps on switching on HSI (16Mhz). I've tried with 16Mhz crystal as well with PLL-M=16, PLL-N=240, PLL-P=2, PLL-Q=4 and HSE_VALUE =16000000 but still, no positive results. 

on the other hand, I've ported the same code for NUCLEO-F207ZG with PLL-M=8, PLL-N=240, PLL-P=2, PLL-Q=4 and HSE_VALUE =8000000 and its working quite well.

    can anyone help me with the understanding of "Clock's Initialization" or rectifying my issue?

Thanking with Regards

Aatif Shaikh

1 ACCEPTED SOLUTION

Accepted Solutions

So with a 25 MHz HSE you'd want HSE_VALUE of 25000000 and PLL_M of 25

You use the MCO (PA8) pin to observe if your oscillator is oscillating without changing the capacitance of the circuit with your scope probe. It is a debugging step.

You should already have reference code

STM32Cube_FW_F2_V1.7.0\Projects\STM322xG_EVAL\Templates\Src\main.c

STM32Cube_FW_F2_V1.7.0\Projects\STM322xG_EVAL\Templates\Inc\stm32f2xx_hal_conf.h

#uphillskiing

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4

You should enable the HSE, but not use it in the PLL, and then feed it to the PA8/MCO pin and validate that it is functioning correctly, ie correct duty, frequency, stability, etc. Also measure the start time,

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
aatif shaikh
Associate III

I've only connected a 25Mhz crystal on PHO and PH1. So we are not using MCO (PA8) pins. hence I want to run my custom made board only on HSE and later on full speed with the help of PLL scaling (120Mhz).

is there any reference code available which doesn't use MCO? I just need a basic sequence of clock initialization.

So with a 25 MHz HSE you'd want HSE_VALUE of 25000000 and PLL_M of 25

You use the MCO (PA8) pin to observe if your oscillator is oscillating without changing the capacitance of the circuit with your scope probe. It is a debugging step.

You should already have reference code

STM32Cube_FW_F2_V1.7.0\Projects\STM322xG_EVAL\Templates\Src\main.c

STM32Cube_FW_F2_V1.7.0\Projects\STM322xG_EVAL\Templates\Inc\stm32f2xx_hal_conf.h

#uphillskiing

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

thanks, with code generated by STMCubeMX my clock is perfectly working. I think there is something wrong with SPL reference clock configuration.