cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault_Handler exception...

yoav
Associate II
Posted on May 16, 2013 at 13:53

Hello,

I'm using the STM32F4 on the discovery evaluation board.

I wrote a simple function that calculates the mean of a vector. When the code is starting to make the summation it goes to HardFault_Handler...

Here is the mean function, a moment before the exception:

0690X00000604sxQAA.png

When I hit F10, the code goes to void HardFault_Handler(void) at stm32f4xx_it.c.

Here is the call of the function:

SNR = CalcMean((float*)local_data_buffer.data_struct.handVISNRBuff,5);

Any Ideas?!

Thanks!

Yoav

#hardfault_handler
10 REPLIES 10
Posted on May 21, 2013 at 16:26

Other ideas, please...?

 

Getting to the point where I'd need to see the project, I can't glean enough information from the screen shots. The stack pointer and memory addresses look reasonable at a glance.

Perhaps it's a FPU_IRQHandler issue rather than a hard fault. Perhaps your array contains values that aren't valid floating point representations?

Suggest also you look at getting your Hard Fault handler to display diagnostic output, see the Joseph Yiu examples.

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