2025-04-07 1:04 AM - last edited on 2025-04-07 2:17 AM by Andrew Neil
When ever I configure HSE in my ioc file for my custom PCB my code stops at SystemClock_Config() or HAL_Delay().
One time when I replaced 48Mhz crystal oscillator with 32 Mhz my LVCU code worked on HSE but it was considerably slow than HSI even on 170 Mhz.
When I created another project to test HSE the same problem continues i.e SystemClock_Config() and HAL_Delay() stopped .
Can some one tell what should be the ioc file setting for HSE so that SystemClock_Config() and HAL_Delay() works.
(LVCU working,distance2 not working)
Solved! Go to Solution.
2025-04-09 11:59 AM
2025-04-10 1:30 AM - edited 2025-04-10 1:50 AM
Hello,
Is this the part of crystal in the schematics?
10kOhm (I think R16) as series resistor? Are you sure?
Did you calculate it according to what AN2867 stated?
According to the values in the schematics and what the AN stated:
Rext = 1 / (2 x PI x 48MHz x 30pf) = 110 ohm
So 10K is a very big value.
Then you need to recalculate the gain margin (as stated in the application note).
Also RExt needs to be 0 ohm unless you find the crystal is overdriven: