I am working on lpc2138.I am using Eclipse for writing my code.I need to do some calculation to read temparature.I am using a float value for my calculation.Eclipse is giving errors like
undefined reference to __floatsidf
undefined reference to __muldf3
undefined reference to __truncdfsf2
undefined reference to __fixunssfsi
I have included <math.h>.How do i link this lib to my code.
To get floating point to work, you need to link in the standard library libgcc.a.
I created a “mini-tutorial” for some readers who contacted me about this; at least it will give you an idea of how I selected and linked in libgcc.a
You can download this short pdf file here (be forewarned that megaupload.com is not exactly a family-friendly site). The name of the pdf file (4 pages) is “Adding Library to Eclipse C.pdf”
I just checked and this short pdf file is still stored on megaupload.com. I also just tested it with a simple floating point operation on my AT91SAM7S256-EK board. The OpenOCD debugger showed that the floating point calculations work OK if you have this library.
Give this a try and let me know how you got along.
You have to decide whether you use hard- or soft-float when compiling your toolchain. Hard-float is going to work only on processors with a FPU, or on top of an operating system that provides FPU emulation. Soft-float includes library functions for floating point operations, and works on every system, but can’t make use of an FPU on systems that have one.
Thank you for your reply and advice.At present i am using LPC2138.so harware-FP will not work.So i have to software-fp.
And i have more questiens here…
I am downloading my code on to RAM because of debuging purposes.Using Open-ocd for debugging and amontec jtag.I am running a timer in my application.Till i add this libgcc.a my code was running fine and the timer interrupt was happening the way i did the setup.After i included the lib it started mis behaving.I notieced his kind of situation before also.Those time i did compiling two time after a clean.It solved its own.I configured the timer for IRQ.But when i run it goes to fiq and doing nothing.Where i am doing wrong.Is it because i am running in the ram?