Solved! Go to Solution.
/* This module is used for the terminal emulation. It will allow
HI-WAVE to communicate through the BDM interface with an application
running on the target system */
#ifndef WSPADR /* if not defined on the command line */
#define WSPADR 0x2000 /* define work space for HC912DG128 */
#endiftypedef struct {
unsigned char rxFlag;
unsigned char rxChar;
char* txBuffer;
} TermDataT;
#define TermData (*((TermDataT*)(WSPADR)))static char txBuffer[2];char GetChar(void)
{
char rxChar;
while (TermData.rxFlag == 0); /* wait for input */
rxChar = TermData.rxChar;
TermData.rxFlag = 0;
return rxChar;
}void PutChar(char ch)
{
txBuffer[0] = ch;
txBuffer[1] = 0;
TermData.txBuffer = txBuffer;
while (TermData.txBuffer != 0); /* wait for output buffer empty */
}
Virtual SCI over the BDM cable is a feature available in the BDI firmware.
There is no similar feature available in the P&E firmware (as far as I know).
So if you are debugging though Multilink or Cyclone Pro cable you need to rediect stdio to a SCI port and get the output from there.