cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F411E-Discovery Board] HAL_RCC_OscConfig() always returns HSE_TIMEOUT while waiting for HSE to be ready and I can't figure out why. All peripherals are initialized to default Mode.

DNguy.9
Associate II

Using STM32CubeIDE v1.6.1 on MacOS 11.3.1

Steps to reproduce:

  1. Create a new STM32 project.
  2. Board Selector -> Select STM32F411E-Disco
  3. Name project, leave everything else as default, hit finish.
  4. Initialize all peripherals with their default Mode? Yes
  5. Debug as STM32-M C/C++ Application.
  6. Hit play then pause and you'll end up in the Error_Handler.
  • Stepping through the program it errors out waiting for the HSE to be ready.

Troubleshooting:

  1. I made sure I wasn't insane and choosing the wrong board. I am staring at the board name on the back of the PCB as I write this.
  2. I am able to use the board and interact with the LEDs and button when using the internal clock.
  3. Tried to increase HSE Startup Timeout to 10 seconds, still times out.
  4. I checked the solder bridges, SB14, SB16, R66 are off and I made sure with a multimeter.

I want to use the USB OTG but can't do so without the external clock but I haven't tried to use an entirely separate clock circuit yet. What bothers me the most is that I'm using entirely default settings and getting the error. I'm new to the entire workflow so I feel like I'm just missing something really obvious. Thank you in advance to anyone reading this. I've been bashing my head at this for a few weeks now.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Change RCC->HSE from "BYPASS clock source" to "Crystal/Ceramic Resonator".

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

View solution in original post

5 REPLIES 5
TDK
Guru

Change RCC->HSE from "BYPASS clock source" to "Crystal/Ceramic Resonator".

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

I forgot to mention it in troubleshooting but that was one of the first things I tried and it still didn’t work. Tried multiple times to do this. Thanks.

Changing from BYPASS clock source to Crystal/Ceramic Resonator and then power cycling the board was the solution.

Can't believe it took me this long to figure out. I still don't understand the root cause though. For now it's good enough.

Have the same issue, like you said power cycle is the key :grinning_face_with_sweat:

You are an actual GOD!