cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030C6 wih external oscillator (HSE)

BJerk.1
Associate II

I am trying to understand how to setup the microcontroller (STM32F030 in this case) to use external oscillator. I am using blinking LED as a test to see if the code is running.

To setup the HSE I did following:

  • selected Crystal/Ceramic Resonator in High Speed Clock under RCC
  • under TIM1 set Internal clock as a Clock Source
  • under clock configuration tab selected HSE under PLL source mux and System clock mux

When I run the microcontroller it runs even if I disconnect the external oscillator.

I am not sure if the microcontroller goes to internal RC when there is no external oscillator or I need to do some additional work?

1 ACCEPTED SOLUTION

Accepted Solutions
berendi
Principal

Read the RCC registers and post them here, or you can check them against their description in the reference manual.

Code generated by CubeMX supports only two kinds of error handling, either ignoring any problem or locking up. Never use it in production code.

View solution in original post

2 REPLIES 2
TDK
Guru

The default CubeMX generated code will let the program continue even if the HSE fails to initialize. That may be what is happening here. I would instrument the Error_Handler() function with an infinite loop or something else to prevent it from returning immediately.

If you feel a post has answered your question, please click "Accept as Solution".
berendi
Principal

Read the RCC registers and post them here, or you can check them against their description in the reference manual.

Code generated by CubeMX supports only two kinds of error handling, either ignoring any problem or locking up. Never use it in production code.