cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F765 EXTERNAL CRYSTAL

Kishan Joshi
Associate III

I have custom stm32f765 board it has very minimal design. only some caps and resistor for the reset and boot. My problem is i have attached hse crystal of 16Mhz.

this one

https://www.digikey.in/product-detail/en/epson/TSX-3225-16-0000MF09Z-AC0/SER4069DKR-ND/5413941

and also 12pf ceramic capacitors. i have configured a code to work with hse but still it is not working is there anything i can do to check wether external crystal is working or not ?

by debugging the code i came to know that

while (__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET)

    {

     if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)

     {

      return HAL_TIMEOUT;

     }

    }

code is not going further from this lines  

Can you please guide my how can i debug. ? since the same code is working on the nucleo and nucleo has stlink external clock.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

AN4661, AN4879, AN2867,

https://blog.adafruit.com/2012/01/24/choosing-the-right-crystal-and-caps-for-your-design/

NRST has an internal pull-up - remove the R2. That can also be related to your HSE problem.

View solution in original post

19 REPLIES 19

Not a software issue.

You'll want to tune the characteristics of the circuit, perhaps review application note, and check your math.

The STM32 permits the HSE to be output by MCO/PA8, this can be used to inspect the clock non-invasively.

More invasively you can probe the crystal pins, but this changes the capacitance. If probing causes it to start properly then it is a matter of getting the loading right.

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

Try some capacitors in the 4-5pF range

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

Oh so 12pf won't work? I thought datasheet says 9pf. So 12pf will work fine. ​

Did i choose correct crystal since it is espon and stm32 application note has the recommended it.​

You've told me it is not working.. you're going to have to change some of the variables here, or make some determinations about why it is not starting properly. The capacitors are easy enough to change.

You could check for soldering issues/shorts, and perhaps consider the trace lengths and circuit topology.

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

Oh that's right. I should change caps. Hey could you tell me that it is right oscillator , should i change that too ? Can you please help me it would be very appreciated

Thank you sir​

I don't know the reasons why the 16MHz was chosen, but the crystal should be usable. With 4 pins you need to insure you've connected the right two, and not mirrored/transposed them. If the circuit is otherwise electrically sound my concern is that you have close to 3x the required capacitance.

If it is stuck in the loop that indicates that it is not starting/oscillating. I might also check if the SysTick is running, and have fall-thru behaviour to use the HSI if the HSE fails to start promptly.

For a cut-n-paste design, perhaps use the Nucleo-144 as a reference. NDK Oscillator NX3225GD-8.000M-EXS00A-CG04874

https://www.digikey.com/en/products/detail/ndk-america-inc/NX3225GD-8MHZ-EXS00A-CG04874/9172047

0693W000005CzxwQAC.jpg

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

I guess systick is also not running but if i choose the hsi as base oscillator than my code is working fine it is just a blink code. but the main problem is i cannot use usb without hse that is the main concern.

Thank you sir . I will try to use capacitor and report you back. and i will try to get those crystal as well. This is really very helpfull since i have been searching a lot for external crystal for nucleo board as well. thank you so much sir for the digikey refrence

Hello Sir can you tell me what is the reason i cannot use 16Mhz crystal ? is there any specific reason ?

Thank you for your great helpp!!!