cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F302RE Hard fault handler

akshayamk
Associate II
Posted on February 27, 2017 at 10:07

Hi all, I am using a STM32F302RE MCU with a customised board. My code works find when I run it at normal temperature. However, when I test it at 55 degrees, the code goes to Hard fault handler after the line in the source code is placing data in the pTxMsg pointer's data field. Any reasons why this could be happening or any ways to solve this? I have already tried increasing my stack size but this does not seem to solve the problem. Any help is appreciated!

#stm32 #stm32f302re #stm32f302
3 REPLIES 3
Nesrine M_O
Lead II
Posted on February 27, 2017 at 10:40

Hi

MK.ShaSha

,

  1. Could you please precise your MCU operating frequency and VDD?
  2. Are you executing your code from flash memory ? if yes could you please check your wait state configuration if are within the specifaication?
  3. What type of hardfault are you facing (try to read the SCB->CFSR)?

-Nesrine-

akshayamk
Associate II
Posted on February 28, 2017 at 01:49

1. MCU PCLK: 20 MHz, VDD: 3.3V

2. Yes, executing from flash memory. I have checked my wait state config and I do not find any issues with them.

3. I have checked the SCB->CFSR register. I have the FORCED bit of hard fault set and INVSTATE of usage handler set.

Posted on February 28, 2017 at 03:27

Ok, but why is it faulting on that pointer? Is the pointer invalid? What address is it trying to access? Does that address appear valid/viable? Do you sanity check the pointer before use?

Shouldn't need a wait-state at 20 MHz, does adding one impact things?

Is the issue with the STM32? Could it be a regulator, capacitor, crystal, or something else? How localized is the heat application? Can you apply the heat probe directly/only on the STM32? Can you output the internal clock via MCO?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..