cancel
Showing results for 
Search instead for 
Did you mean: 

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

Carlos Diaz R.
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

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
Up vote any posts that you find helpful, it shows what's working..
Carlos Diaz R.
Associate III

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 :-)