<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CodeWarrior 4.6 printf() and P &amp; E BDM in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128076#M689</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Only thing you can try is open a Terminal Component and select "Serial port" as Default Configuration.&lt;/DIV&gt;&lt;DIV&gt;Then select the appropriate serial port and baud rate on the bottom of the configuration window.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;make sure to connect your board SCI with your Host COM port and you should be able to see output from printf in the Terminal window.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If this does not work, you will need to open a HyperTerminal window to see printf.&lt;/DIV&gt;&lt;DIV&gt;In both cases you need to connect target board SCI with your Host COM port to see output.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Virtual SCI is not enabled for P&amp;amp;E connection.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2007 17:15:13 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2007-03-27T17:15:13Z</dc:date>
    <item>
      <title>CodeWarrior 4.6 printf() and P &amp; E BDM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128075#M688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to use the printf() command to print to the testterm window when debugging through the BDM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have use the following code fragments to initialize:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#include&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#define NOCHAR -1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;typedef struct {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxBDH;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxBDL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxCR1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxCR2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxSR1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxSR2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxDRH;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned char SCxDRL;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} SCIStruct;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* terminal.wnd */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define SCI_ADDR 0x00c8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define SCI (*((SCIStruct*)(SCI_ADDR)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and here is my TERMIO_PutChar:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void TERMIO_PutChar(char ch) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/* sends a character to the terminal channel */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while (!(SCI.SCxSR1 &amp;amp; 0x80)); /* wait for output buffer empty */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCI.SCxDRL = ch;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any pointers would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 10:33:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128075#M688</guid>
      <dc:creator>wongmld</dc:creator>
      <dc:date>2007-03-27T10:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior 4.6 printf() and P &amp; E BDM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128076#M689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Only thing you can try is open a Terminal Component and select "Serial port" as Default Configuration.&lt;/DIV&gt;&lt;DIV&gt;Then select the appropriate serial port and baud rate on the bottom of the configuration window.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;make sure to connect your board SCI with your Host COM port and you should be able to see output from printf in the Terminal window.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If this does not work, you will need to open a HyperTerminal window to see printf.&lt;/DIV&gt;&lt;DIV&gt;In both cases you need to connect target board SCI with your Host COM port to see output.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Virtual SCI is not enabled for P&amp;amp;E connection.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 17:15:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128076#M689</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-03-27T17:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior 4.6 printf() and P &amp; E BDM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128077#M690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks very much.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 12:08:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128077#M690</guid>
      <dc:creator>wongmld</dc:creator>
      <dc:date>2007-04-02T12:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior 4.6 printf() and P &amp; E BDM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128078#M691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;CrasyCat:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there a reason that Virtual SCI over the BDM cable seems to be possible with CW for HCS12 V4.6 for the Abatron BDI cable but not for the P&amp;amp;E Multilink/Cyclone Pro cables? There is example code with CW 4.6 for doing terminal i/o with the Abatron BDI with output going to the terminal component window. See the TERMBGND.C file for the "Calculator - Ram" example.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I believe that it might&amp;nbsp;be possible to do console I/O over BDM with the P&amp;amp;E Multilink cable and the Codewarrior HIWAVE debugger. I see that the 3rd party tool called the NoIce debugger from John Hartman (see&amp;nbsp;&lt;A href="http://www.noicedebugger.com/68hc12.html" rel="nofollow" target="_blank"&gt;http://www.noicedebugger.com/68hc12.html&lt;/A&gt;) has&amp;nbsp;a&amp;nbsp;Virtual SCI feature which works over BDM with the P&amp;amp;E Micro multilink cable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here is a short excerpt from the TERMBGND.c which shows how the terminal i/o ram buffer on the target is used to perform i/o to the terminal component. I believe that WSPADR is also used to define a terminal i/o buffer when HIWAVE uses D-Bug12 over a serial cable rather than BDM.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;/* This module is used for the terminal emulation. It will allow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; HI-WAVE to communicate through the BDM interface with an application&lt;BR /&gt;&amp;nbsp;&amp;nbsp; running on the target system */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;#ifndef WSPADR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* if not defined on the command line */&lt;BR /&gt;#define WSPADR&amp;nbsp;&amp;nbsp; 0x2000&amp;nbsp;&amp;nbsp; /* define work space for HC912DG128 */&lt;BR /&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;typedef struct {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; unsigned char rxFlag;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; unsigned char rxChar;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; char*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txBuffer;&lt;BR /&gt;} TermDataT;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;#define&amp;nbsp; TermData (*((TermDataT*)(WSPADR)))&lt;/DIV&gt;&lt;DIV&gt;static char txBuffer[2];&lt;/DIV&gt;&lt;DIV&gt;char GetChar(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; char rxChar;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; while (TermData.rxFlag == 0); /* wait for input */&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; rxChar = TermData.rxChar;&lt;BR /&gt;&amp;nbsp; TermData.rxFlag = 0;&lt;BR /&gt;&amp;nbsp; return rxChar;&lt;BR /&gt;}&lt;/DIV&gt;&lt;DIV&gt;void PutChar(char ch)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; txBuffer[0] = ch;&lt;BR /&gt;&amp;nbsp; txBuffer[1] = 0;&lt;BR /&gt;&amp;nbsp; TermData.txBuffer = txBuffer;&lt;BR /&gt;&amp;nbsp; while (TermData.txBuffer != 0); /* wait for output buffer empty */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;}&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 08:47:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128078#M691</guid>
      <dc:creator>GordFinlay</dc:creator>
      <dc:date>2008-02-08T08:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior 4.6 printf() and P &amp; E BDM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128079#M692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Virtual SCI over the BDM cable is a feature available in the BDI firmware.&lt;BR /&gt;There is no similar feature available in the P&amp;amp;E firmware (as far as I know).&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 18:10:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-4-6-printf-and-P-E-BDM/m-p/128079#M692</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-02-08T18:10:22Z</dc:date>
    </item>
  </channel>
</rss>

