I have defined & declared the functions 'sendchar' and 'getkey' as stated in the keil Help documents.
but in retarget.c, the following lines are never compiled. I have included stdio header file in the source file where printf function is used.
#ifdef STDIO extern int sendchar (int ch); extern int getkey (void); #endif
cant figure out what is wrong.
Have figured it out.
select the retarget.c file in the project window, right click and select "options for file 'retarget.c' "
in the pop-up window, select C/C++ tab. in the preprocessor symbols Define field, enter "STDIO".
The compiler control string is modified to
-c --cpu Cortex-M3 -D__RTX -g -O0 --apcs=interwork -I ".\src n inc" -I C:\Keil\ARM\RV31\Inc -I C:\Keil\ARM\CMSIS\Include -I C:\Keil\ARM\Inc\NXP\LPC177x_8x -DSTDIO -o ".\obj\retarget.o"
Considering the amount of license fee that they charge, The keil should give a serious thought for re-documentation. :\