AnsweredAssumed Answered

F2 floating point call causes hard fault

Question asked by neff.vance on Jun 24, 2014
Latest reply on Jun 29, 2014 by Clive One
I've started trying to use software floating point with the STM32F205.
I'm sure this has to do with the Yagarto/GCC toolchain, but I'm hoping someone can give me some ideas as to what might be going wrong.

At this point, I'm simply trying to multiply to #s, ie.
printf( "got here 1" );
float x = 2.0f;
printf( "got here 2" );
float y;
printf( "got here 3" );
y = x * 4.0f;
printf( "got here 4" );

I get a hard fault before the "got here 4" line prints.
The dump shows that PC and LR are pointing to locations in the above routine (not sure exactly where).  Never did get the debugging working.
These are my compiler settings:
-Wstrict-prototypes
-Werror=return-type
-Wformat
-Wmissing-format-attribute
-fno-common
-std=gnu99
-mcpu=cortex-m3
-mfloat-abi=soft
-mthumb

and these are my linker settings
-mcpu=cortex-m3  -mthumb -mfloat-abi=soft -msoft-float

I increased my stack size 4 times normal.

The map file shows that _arm_addsubsf3.o, _arm_muldivsf3.o, etc are included with the routines __subsf3, __addsf3, __mulsf3, __aeabi_fmul, __aeabi_fsub, __aeabi_fadd, etc.
Though, for some reason, the double versions appear to be included as well.

I know this should not be difficult, but I've run out of ideas.

Any thoughts will be appreciated!
Vance











Outcomes