2020-11-28 05:06 AM
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.
Solved! Go to Solution.
2020-11-30 12:33 PM
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.
2020-11-28 06:29 AM
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.
2020-11-28 06:31 AM
Try some capacitors in the 4-5pF range
2020-11-28 06:43 AM
Oh so 12pf won't work? I thought datasheet says 9pf. So 12pf will work fine.
2020-11-28 06:44 AM
Did i choose correct crystal since it is espon and stm32 application note has the recommended it.
2020-11-28 07:26 AM
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.
2020-11-28 08:05 AM
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
2020-11-28 06:05 PM
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
2020-11-28 11:13 PM
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
2020-11-28 11:16 PM
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!!!