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?
"... 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ā¦
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.