2025-09-18 5:32 AM - last edited on 2025-09-18 6:06 AM by mƎALLEm
I saw a strange behavior when using STM32F401RBTx, to show you I added only 1 output as LED and toggled it.
I have just that much code. I tried with 16 MHz, 48 MHz, 64 MHz, 84 MHz. It went hard fault when speed is 64 MHz or 84 MHz.
This is the clock setting which calculated by STM32CubeIDE.
It goes inside of HAL_RCC_ClockConfig function and can't go beyond HAL_InitTick function. When I put breakpoint inside HAL_InitTick I could delay hard fault little bit and saw below callstack.
I tried this with 2 microcontrollers and same thing was happening. How can I solve this? Thank you.
2025-09-18 5:56 AM
Could this have something to do with it?
2025-09-18 6:02 AM
Hard fault on high clock speeds suggests a hardware issue, not a code issue.
Is this a custom board? VCAP voltage okay? Power sufficient? Wait states set appropriately?
Include the schematic and IOC file if you can.
2025-09-18 6:32 AM
I didn't do any configuration for this but I can see it is already configured as Power Scale 2, even before HAL_RCC_ClockConfig function. It is also set in the hard fault handler.
2025-09-18 7:20 AM
What board are you using? a custom board?
If so, did you refer to the STM32F4xxx hardware getting started application note AN4488, especially the schematics on page 34?