Home arrow Support arrow Forums

Luminary Micro Forums

orinem

Expert Boarder

2006/11/08 17:01

Codesourcery tools and sprintf

Has anyone managed to compile with the Codesourcery toolchain and include library functions such as sprintf?

I can compile the driver library, examples and FreeRTOS port, but as soon as I add a sprintf() call, code which works with the Keil tools, I get 'unrelated' linker errors.

Orin.

login or register to reply

kenlem

Fresh Boarder

2006/11/11 23:01

Re:Codesourcery tools and sprintf

I'm guessing that sprintf works with Keil and not Codesourcery because Keil must supply some Stellaris specific run time library that Codesourcery doesn't.

login or register to reply

orinem

Expert Boarder

2006/11/12 19:40

Re:Codesourcery tools and sprintf

kenlem wrote:
I'm guessing that sprintf works with Keil and not Codesourcery because Keil must supply some Stellaris specific run time library that Codesourcery doesn't.

Yes, Keil seem to supply their own library.

I finally got it to compile with the latest 2006q3 Codesourcery release.

You need to add libnosys.a (-lnosys flag) to get rid of the undefined symbols.

Then you get really horrified at the amount of code it drags in!
Over 30k of code just to get sprintf.

Orin.

login or register to reply

mthomas

Senior Boarder

2006/11/14 08:48

Re:Codesourcery tools and sprintf

orinem wrote:

Then you get really horrified at the amount of code it drags in!
Over 30k of code just to get sprintf.


Yes, the stdio-functions in the newlib as included in the Codesourcery toolchain is known to produce a rather huge amounts of code. If you don't need floating-point support you can use siprintf (still ca. 15k).

Martin Thomas

login or register to reply