[arm-gnu] Cortex-M3 and Floating Point Problems
Mark Mulrooney
mmulrooney at teledyne.com
Thu Jun 21 19:38:18 UTC 2012
The printf being pulled in is from the thumb2/libc.a file according to the map file; I've attached the map file.
We are not using any macros iprintf as far as I know.
I'm not sure I understand what you mean by the CodeBench printf vs the alternative printf. We do not use CodeBench at all, we are using makefiles and the compiler.
Thanks,
Mark
-----Original Message-----
From: Carlos O'Donell [mailto:carlos_odonell at mentor.com]
Sent: Thursday, June 21, 2012 15:18
To: Mark Mulrooney
Cc: arm-gnu at codesourcery.com
Subject: Re: [arm-gnu] Cortex-M3 and Floating Point Problems
On 6/21/2012 2:48 PM, Mark Mulrooney wrote:
> It appears you are correct, good catch! Now my next question would be
> why. I'm using the standard libraries provided by CodeSourcery. I did
> notice while stepping through the code that the last assembly
> instruction before branching to printf is a ldrd call and I also
> noticed there is a compiler option for -mfix-cortex-m3-ldrd. I added
> that in but it still doesn't seem to work correctly.
The `-mfix-cortex-m3-ldrd' is automatically enabled when you specify -mcpu=cortex-m3.
You haven't provided a test case or linker map file so all we can do is guess.
The Sourcery CodeBench bare-metal C library is ISO C compabitle and therefore provides %f support.
Care to add `-Wl,-Map,linkermap.txt` to your final link with gcc and look to see there where printf is coming from?
Some other options might be:
* You used macro tricks to call iprintf instead of printf
to make the executable smaller, but forgot iprintf doesn't
support %f?
* You aren't using the CodeBench printf, and the alternate
printf doesn't support %f?
* And lastly... the CodeBench printf has a bug.
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell at mentor.com
carlos at codesourcery.com
+1 (613) 963 1026
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: apf11.map
URL: <http://sourcerytools.com/pipermail/arm-gnu/attachments/20120621/12c850b2/attachment.ksh>
More information about the arm-gnu
mailing list