2024-07-26 07:54 AM
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?
Solved! Go to Solution.
2024-07-26 09:16 AM
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.
2024-07-26 09:09 AM - edited 2024-07-26 09:26 AM
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,
2024-07-26 09:16 AM
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.
2024-07-26 01:47 PM
I use 16 MHz ECS-160-12-33-AGN-TR with 2x12pF cap.
2024-07-27 06:38 AM - edited 2024-07-27 06:38 AM
Debug the code, see where and why it's entering ErrorHandler.
HSE design seems fine.
2024-07-31 11:48 AM
The error was in hardware. I resolder components and its work just fine.
Thank you guys!