cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0-Discovery with HSE

munger
Associate II
Posted on September 24, 2013 at 23:24

I want to run my Discovery board with an external HSE soldered into X2 on the board. I ran the clock configuration tool and generated a new system_stm32f0xx.c which seems to be correct. It seems to still be using the 8 MHz PLL and I can't tell if it's not trying to use the HSE or is it failing when it starts up. I stuffed X2 (25 MHz), R23, R22, C14, C13 as shown on STM32Discovery schematic. I am using the Demo app that blinks the one LED and you can change the rate of blinking with the USER button. Ideally there is an explanation somewhere that says ''If you want to use the HSE on the Discovery board do this ...'' but I haven't found that. I'd appreciate any ideas of what to look at next.

Thanks.

Mike
4 REPLIES 4
Posted on September 25, 2013 at 00:20

Make sure there aren't any Solder Bridges (SB) still connecting the HSE_IN with the 8 MHz output from the ST-LINK's F103.

Check if HSERDY in RCC_CR goes high after the HSE is enabled, if it does not, then the crystal is not working.

Review also the RCC registers to understand what clock is actually being used, and confirm the PLL settings.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
munger
Associate II
Posted on September 25, 2013 at 17:55

Thanks a million clive1.

Okay, I'm a little closer. Removing the Solder Bridges removes the 8 MHz clock I was seeing on the PF0-OSC_IN so that makes sense. Now just seeing a bit of noise on that line, I know the amplitude is going to be pretty small but should be sinusoidal.

When I single step through SetSysClock() when it gets to:

  RCC->CR |= ((uint32_t)RCC_CR_HSEON);

I do not see the HSEON bit go high which is puzzling. I'd think that bit would go high even with no crystal connected. I believe that multiple clocks can be on, the SW bits in RCC_CFGR select which is used as the System Clock.

Anyway, will go back and check wiring of crystal again although the tech that did it I trust much more than my code.

Mike

munger
Associate II
Posted on September 25, 2013 at 22:22

I found AN2867 which is the Oscillator Design Guide. This has some good info. Possibly the value of 390 for Rext is not quite right. But, I still can't explain why the HSEON bit is not getting set, it seems that I can set it manually while single-stepping.

Posted on September 26, 2013 at 03:09

On a stock STM32F0-Discovery, RCC_CR_HSEON goes on, as does RCC_CR_HSERDY, not sure I can explain why HSEON can't be enabled on your board.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..