Skip to main content
Graduate
June 27, 2024
Solved

External oscillator issue ( stm not booting)

  • June 27, 2024
  • 3 replies
  • 2657 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?

    3 replies

    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 ?

    JeevaAuthor
    Graduate
    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

     

    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

     

    Graduate II
    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.

    Graduate II
    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.

    BarryWhitAnswer
    Graduate II
    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?