2024-06-27 05:08 AM
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 :)
Solved! Go to Solution.
2024-06-27 07:44 AM - edited 2024-06-27 07:45 AM
> 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?
2024-06-27 05:22 AM
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 ?
2024-06-27 05:22 AM
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.
2024-06-27 06:13 AM
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.
2024-06-27 07:44 AM - edited 2024-06-27 07:45 AM
> 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?
2024-06-28 01:43 AM
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.
2024-06-28 01:44 AM
Thankyou for the response. The issue is with the oscillator only, I chose the wrong one.
2024-06-28 02:13 AM
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:
2024-06-28 02:18 AM
Yes I am replacing the oscillator. but I have one more issue my Type C port is not getting detected. is this oscillator could be any reason for that?