Skip to main content
Associate III
July 26, 2024
Solved

STM32F446VET7, SystemClock_Config(); FAULT

  • July 26, 2024
  • 5 replies
  • 1371 views

I used STM32F446VET7 on the board I PCB printed. When I use HSI, I can debug without any problem, but when I want to use HSE, SystemClock_Config(); function enters ErrorHandler().

Can you help me?

This topic has been closed for replies.
Best answer by TDK

Can you show the HSE portion of your schematic?

In particular, the load caps on the crystal oscillator must be chosen correctly.

cd00221665-oscillator-design-guide-for-stm8af-al-s-stm32-mcus-and-mpus-stmicroelectronics.pdf

 

Roughly speaking, load caps should be around

CL1 = CL2 = 2 * (CL - 5 pF)

where CL is the load capacitance of the crystal.

5 replies

Andrew Neil
Super User
July 26, 2024

So step through the code in SystemClock_Config(), and see where the error happens.

Did you set up your clocks using CubeMX (standalone or within CubeIDE)? If not, try that ...

 

EDIT:

Have you tried your code on a known-good board; eg,

https://www.st.com/en/evaluation-tools/nucleo-f446re.html

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
TDK
TDKBest answer
July 26, 2024

Can you show the HSE portion of your schematic?

In particular, the load caps on the crystal oscillator must be chosen correctly.

cd00221665-oscillator-design-guide-for-stm8af-al-s-stm32-mcus-and-mpus-stmicroelectronics.pdf

 

Roughly speaking, load caps should be around

CL1 = CL2 = 2 * (CL - 5 pF)

where CL is the load capacitance of the crystal.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate III
July 26, 2024

I use 16 MHz ECS-160-12-33-AGN-TR with 2x12pF cap.

 

testbenchmark_0-1722026716115.png

 

TDK
July 27, 2024

Debug the code, see where and why it's entering ErrorHandler.

HSE design seems fine.

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