Yahoo Groups archive

Lpc2000

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

Message

can't get printf() to print on UART0 with GNU

2005-02-24 by tiogate

Hello, gentlemen,

   I am experiencing something that does not make sense to me. To 
make my debugging easier I wish to use the printf function to send 
formatted output to UARTO. 

   Fine. As far as I can see, I did everything right: I rewrote the 
putchar function so it writes to UART0, and the putchar function 
works OK. 

   However, when I use the printf function, it does not output to 
UART0 (if it outputs to something at all), and I can't understand 
why not.

   Checking the .MAP file, I see the compiler takes the putchar 
function that is in my main.o and the remaining functions that 
printf uses (such as puts, fflush, etc) it takes from libc.a .

   If I DO NOT write my putchar, I see from the .MAP file that the 
compiler takes putchar.o from libc.a -- and then I understand why it 
wouldn't send anything to the UART0. But why doesn't printf send to 
the UART0 if my putchar function tells it to?

Hoping for some enlightening from you gurus,

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.