Question
STM32F4 simple math calculation causes hardfault
Posted on March 21, 2013 at 18:06
float
hypo2;
int32_t XH=0,YH=0,ZH=0;
...............
hypo2= (XH*(XH*1.0) + YH*(YH*1.0));
hello forum,
in the above code XH and YH are 32 bit integers
hypo2 is float variable
becouse I want the calculation result to be float
thats why I multiply XH with 1.0 when calculation square of it
however at this point the program crashes and uC goes into hardfault handler
the same code is workingat STM32F103 without error
my compiler is yagarto
please advice , thank you
#math-stm32f4