Full hardware floating point option

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi all,

I would like to take advantage of hardware floating point unit in XMC4500. However, selecting 'Full hardware floating point (-mfloat-abi=hard) option under Miscellaneous section of compiler options in DAVE4 throws bunch of linker errors.

Please help.

Sam
0 Likes
4 Replies
Not applicable
Hi Sam,

With referring to "DAVE TIP of the day: Things need to do when use math functions", you may try to "add '__FPU_PRESENT'" in Compiler Preprocessor configuration (Go to Project -> Active Project Properties -> C/C++ Build -> Settings -> ARM-GCC C Compiler, add "__FPU_PRESENT" in the Preprocessor).

BR,
Zain
0 Likes
Not applicable
Thanks Zain. Adding __FPU_PRESENT to compiler settings does not work as the problem is related to linker. The errors go something like this:
"Trial.elf uses VFP register arguments, c:/davev4/dave-4.0.0/eclipse/arm-gcc-49/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m\libg_nano.a(lib_a-nano-msizer.o) does not"
It seems that libg_nano and lib_gcc being linked have not been compiled with FPU flag turned on and by default linker does not know where to look for appropriate files. After posting the question I found out that adding following library search paths on linker tab takes care of the problem.
"C:\DAVEv4\DAVE-4.0.0\eclipse\ARM-GCC-49\lib\gcc\arm-none-eabi\4.9.3\armv7e-m\fpu"
"C:\DAVEv4\DAVE-4.0.0\eclipse\ARM-GCC-49\arm-none-eabi\lib\armv7e-m\fpu"

However, it is tedious to do that in every project so I am still looking for a better solution.

Sam
0 Likes
ningareddy_moda
Employee
Employee
Hi,

When you change the 'Full hardware floating point (-mfloat-abi=hard) option under Miscellaneous section of compiler, a similar option is to be selected in Linker-->Miscellaneous --> Floating Point.
This feature is added in Dave4.1.2 version.
0 Likes
Not applicable
That's it, upgrading to 4.1.2 took care of the problem. Thanks.

Sam
0 Likes