Skip to main content
Carlos Diaz R.
Associate III
April 10, 2019
Solved

[SOLVED] Getting Hard and Usage Faults when setting the HCLK of STM32F411RE to anything above 60MHz

  • April 10, 2019
  • 2 replies
  • 886 views

Hi,

I'm working on porting a project from the Nucleo-F411 to a custom PCB. Everything works fine when setting the HCLK to 60MHz and below (running from the internal HSI RC clock and PLL), but i'm getting Hard and Usage Faults when setting the HCLK to anything above 60MHz, the target HCLK is 82MHz.

Find attached the CubeMX project i'm using, can you replicate the issue?

This topic has been closed for replies.
Best answer by Tesla DeLorean

Sorry, not looking to replicate CubeMX failures.

Does the faster code fail on the NUCLEO?

Make sure there are sufficient wait states on the FLASH.

Check voltages and capacitors on VCAP pins.

Make sure you have an adequate STACK allocation.

Use a proper Hard Fault Handler, so you can better identify the source of the fault, it occurs at one location, or is more randomized in nature.

Make sure the clock configuration code clears the auto/local variable structure properly.

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
April 10, 2019

Sorry, not looking to replicate CubeMX failures.

Does the faster code fail on the NUCLEO?

Make sure there are sufficient wait states on the FLASH.

Check voltages and capacitors on VCAP pins.

Make sure you have an adequate STACK allocation.

Use a proper Hard Fault Handler, so you can better identify the source of the fault, it occurs at one location, or is more randomized in nature.

Make sure the clock configuration code clears the auto/local variable structure properly.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Carlos Diaz R.
Associate III
April 10, 2019

It was a VCAP pin problem, i reworked the pin solder and now it's working, even with the HCLK configured at 84MHz.

I knew it was something silly, thanks a lot for your help Clive :)