AnsweredAssumed Answered

CodeWarrior 4.6 printf() and P & E BDM

Question asked by Dennis Wong on Mar 27, 2007
Latest reply on Feb 8, 2008 by CrasyCat
Hi all,

I need to use the printf() command to print to the testterm window when debugging through the BDM.

I have use the following code fragments to initialize:


#define NOCHAR -1

typedef struct {
unsigned char SCxBDH;
unsigned char SCxBDL;
unsigned char SCxCR1;
unsigned char SCxCR2;
unsigned char SCxSR1;
unsigned char SCxSR2;
unsigned char SCxDRH;
unsigned char SCxDRL;
} SCIStruct;

/* terminal.wnd */
#define SCI_ADDR 0x00c8
#define SCI (*((SCIStruct*)(SCI_ADDR)))

and here is my TERMIO_PutChar:
void TERMIO_PutChar(char ch) {
/* sends a character to the terminal channel */
while (!(SCI.SCxSR1 & 0x80)); /* wait for output buffer empty */
SCI.SCxDRL = ch;

However, I can't get the output from my TERMINAL OR TESTTERM windows. What should be the port setting for Virtual SCI? SCI.Output and SCI.Input? When I look up in the Inspector module, I found there is two SCIs objects, namely Sci0 and SCI. However both of them are not memory mapped object.

Any pointers would be greatly appreciated.