2010-06-04 10:09 AM
problem with casting between float and int
2011-05-17 04:53 AM
Ole! it works:) thx all of you!
2011-05-17 04:53 AM
Hi,
I have recently reached the floating point problem for cortex m3 stm32f103 mcu. I saw that compiler generates __aeabi_ui2f which is undefined.
This problem occurs only when I am trying to cast to float. If I have an unsigned int variable with a value assigned to it and cast this variable to float this is working fine(only if I enable compiler optimizations), but if I pass a number to a function and try to cast that number to float compiler creates this undefined instruction.
Please let me know if you have managed to get it to work properly.
I have attached my test project.
Thank you,
Andrei
2011-05-17 04:53 AM
Perhaps you should #include <math.h>, and provide the linker with the correct path (-L) to the libraries you need.
I think you need to be looking for libm.a in the lib/thumb2 directory (ie appropriate for the STM32) for your tools. http://www.network-theory.co.uk/docs/gccintro/gccintro_17.html