Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

printf with GCC using uclibc (ntfreak2000)

2005-02-25 by tiogate

--- In lpc2000@yahoogroups.com, "ntfreak2000" <ntfreak2@h...> wrote:

> Keil gcc uses uclibc, the version you require is:
> 
> int write (int file, char * ptr, int len)
> {
>     return len;
> }

Thank you, Spen. You are right: I've overridden write() and now 
printf outputs to the UART0. But there is an issue and I think it 
might be related to what you said next:

> Be careful of uisng uclibc as a clib, even though it is a better 
lib 
> for smaller devices it comes under lgpl rather than gpl. This is 
only 
> really a problem if you are statically linking with the libs.

Well, the issue is: the .HEX file generated with GCC is enormous! 
Like 56 kb for a prog that only prints a single formatted variable 
to UART0. The exact same code compiled with "Keil ARM Tools" 
generates a .HEX file that is only 10 kb big.

Do you guys think that such a gigantic .HEX file is because of 
this "statically linking" problem of uclibc? If so, what alternative 
lib do you suggest?

Fernando

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.