Keil Logo Arm Logo

Discussion Forum

printf doesn't work

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Michal Ogard
Posted
19-Jun-2006 15:05 GMT
Toolset
ARM
New! printf doesn't work
I'm trying to use printf() function on LPC2138 UART0 but it seems it doesn't work. It works fine on UART1 but not on UART0. Am I missing something? Must I use some redirect or something?

Michal
Read-Only
Author
Dan Henry
Posted
19-Jun-2006 15:38 GMT
Toolset
ARM
New! RE: printf doesn't work
printf() outputs through putchar() which usually outputs to a single I/O device. Does your putchar() allow for multiple I/O devices? How do you switch between them?
Read-Only
Author
A.W. Neil
Posted
19-Jun-2006 15:46 GMT
Toolset
ARM
New! RE: printf doesn't work
"printf() outputs through putchar()..."

http://www.keil.com/support/man/docs/ca/ca_printf.htm

"... which usually outputs to a single I/O device."

You will need to consult your compiler Manuals (specifically, the Library section) to find out the specific requirements of the particular putchar() implementation.

I wouldn't be surprised if GCC requires you to do some sort of "device open" for the UART; I have no idea for RealView - you'll have to read that one up for yourself!
Read-Only
Author
Michal Ogard
Posted
19-Jun-2006 16:35 GMT
Toolset
ARM
New! RE: printf doesn't work
I did sweep over the manuals for my compiler (http://www.keil.com/support/man/docs/ca/ca_putchar.htm ) but I can't find any thing valuable in there. Because of that I put my problem on a forum. I know RTFM sometimes works but not in this case…
Read-Only
Author
Dan Henry
Posted
19-Jun-2006 16:45 GMT
Toolset
ARM
New! RE: printf doesn't work
http://www.keil.com/support/man/docs/ca/ca_putchar.htm

As it suggests on that page, you'll have to modify the source to provide the functionality you require.
Read-Only
Author
Andy Neil
Posted
19-Jun-2006 16:54 GMT
Toolset
ARM
New! So make it work!
"but I can't find any thing valuable in there."

Eh???

http://www.keil.com/support/man/docs/ca/ca_putchar.htm says:

"Source code is provide in the LIB folder."

See also http://www.keil.com/support/man/docs/ca/ca_lib_source.htm

You have the complete source code, so you can see exactly what it's doing, and modify it to your requirements!
Read-Only
Author
Andy Neil
Posted
19-Jun-2006 16:56 GMT
Toolset
ARM
New! RE: So make it work!
http://www.keil.com/support/docs/2014.htm

http://www.keil.com/download/docs/288.asp
Read-Only
Author
Michal Ogard
Posted
19-Jun-2006 17:06 GMT
Toolset
ARM
New! RE: So make it work!
Andy!

Thanks a lot. I made some mistake in reprogramming putchar :(. Thanks for help again!


Michal

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.