| Details | Message |
|---|
Read-Only Author Michal Ogard Posted 19-Jun-2006 15:05 GMT Toolset ARM |  printf doesn't work Michal Ogard 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 |  RE: printf doesn't work Dan Henry 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 |  RE: printf doesn't work A.W. Neil "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 |  RE: printf doesn't work Michal Ogard 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 |  RE: printf doesn't work Dan Henry 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 |  So make it work! Andy Neil "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 |  RE: So make it work! Andy Neil 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 |  RE: So make it work! Michal Ogard Andy!
Thanks a lot. I made some mistake in reprogramming putchar :(. Thanks for help again!
Michal |
|