Hello All,
I'm using a Keil eval Cortex-M3 eval board and using uVision v4.23, and trying to redirect printf output so stdout displays on the lovely LCD display instead to the serial port. I have defined putchar in my main.c, but somewhat expectedly get several compiler errors as a result.
unsigned int putchar (unsigned int ch) { GLCD_DisplayChar(row, col, FONTINDEX, ch); return ch; }
It seems that putchar is defined as a macro in <stdio.h> and my attempting to define a replacement results in errors as follows:
main.c(51): error: #79: expected a type specifier main.c(51): error: #147-D: declaration is incompatible with "int putc(int, FILE *)" (declared at line 657 of "C:\Keil\ARM\RV31\Inc\stdio.h") main.c(51): error: #141-D: unnamed prototyped parameters not allowed when body is present main.c(52): error: #20: identifier "row" is undefined Target not created
Several hours later I'm no closer to a solution. Apologies if the answer is something obvious - I'm rather new at this. Any help would be appreciated.
-Rob
Hi! I had the same error with program using Cortex-M3 board. I also want to redirect printf output to another output channel. I had solve the problem by following the instructions in this link: http://www.keil.com/support/man/docs/gsac/gsac_retargetcortex.htm I hope my reply is not too late. :)