Skip to main content
Associate II
June 27, 2024
Solved

External oscillator issue ( stm not booting)

  • June 27, 2024
  • 8 replies
  • 4836 views

Hello, 

I have designed my PCB with stm32f427VIT6 and a 24Mhz crystal oscillator. I was trying to upload and test the normal blink code and it's not working. If I disable the external clock, the LED works and does not work with an external clock. I am completely new to STM, I did not know exactly whether I messed up with the design or could not configure the clock properly. I am attaching the schematics of my connection and a screenshot of the clock configuration that I have tried. Kindly help me :) 

Jeeva_0-1719489952248.png

Jeeva_1-1719489972408.png

Jeeva_2-1719490012982.png

 

 

This topic has been closed for replies.
Best answer by BarryWhit

 I did not know exactly whether I messed up with the design

 

oscillator circuits are delicate and need to be layed out with care. Can you post a screenshot of how you laid out the crystal and capacitors in your PCB near the MCU chip? How did you choose the 8pf capacitors?

8 replies

Andrew Neil
Super User
June 27, 2024

Have you tried using the debugger to see exactly where it fails with the external clock ?

When you used the internal clock, did you still have the SYSCLK at 180 MHz ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
JeevaAuthor
Associate II
June 28, 2024

Hii.., Thank you for your reply. I have found the issue. the issue was with the oscillator only where I used the wrong one. the pinouts for the oscillator I used are different from the circuit I made. replacing the oscillator would solve the issue.

Jeeva_0-1719564158158.pngJeeva_1-1719564189213.png

 

Andrew Neil
Super User
June 28, 2024

One of those is an actual, active oscillator;  the other is just a passive crystal !

The circuit you showed is designed for the passive crystal.

See:

https://community.st.com/t5/stm32-mcus-products/stm32f4-osc-problem/m-p/664136/highlight/true#M241592

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
June 27, 2024

Probably stuck and died in Error_Handler() perhaps have that flag one of your LEDs, or use the debugger.

Have code starting the HSE fail more elegantly when the crystal doesn't start.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
June 27, 2024

Check the code in SystemClock_Config() using HAL_RCC_OscConfig(), perhaps add code to alternatively use HSI (16 MHz) + PLL to get the operational speed you want in case HSE fails to start.

Then debug the component choices / loading of the HSE, that precludes it starting, or start sufficiently quickly.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
BarryWhit
BarryWhitBest answer
Lead
June 27, 2024

 I did not know exactly whether I messed up with the design

 

oscillator circuits are delicate and need to be layed out with care. Can you post a screenshot of how you laid out the crystal and capacitors in your PCB near the MCU chip? How did you choose the 8pf capacitors?

"- If someone's post helped resolve your issue, please thank them by clicking ""Accept as Solution"".- Please post an update with details once you've solved your issue. Your experience may help others."