<?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>CodeWarrior Development ToolsのトピックRe: How to tie my serial port driver into printf</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-tie-my-serial-port-driver-into-printf/m-p/2083640#M9266</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/249155"&gt;@lslonim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;printf() is not possible since there is NO "standard output" in CodeWarror HCS08. User has to implement their own "pseudo" prinf() function, i.e. to format the output in memory and then print out through SCI.&lt;/P&gt;
&lt;P&gt;Please put an #include "termio.h"&amp;nbsp; statement in the code. We can find this file under CodeWarrior install folder.&lt;/P&gt;
&lt;P&gt;The following code runs successfully on QG8. You can refer it on DZ60. The method is the same,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_1-1745214484292.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/334012iB4A171123DB46EEA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_1-1745214484292.png" alt="ZhangJennie_1-1745214484292.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1745214446908.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/334011i8F08E98996C4BEE0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1745214446908.png" alt="ZhangJennie_0-1745214446908.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Apr 2025 05:50:23 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2025-04-21T05:50:23Z</dc:date>
    <item>
      <title>How to tie my serial port driver into printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-tie-my-serial-port-driver-into-printf/m-p/2083461#M9262</link>
      <description>&lt;P&gt;Hi, I'm using CW 11.1 because my processor is MC9S08DZ60A. I am porting some code from another compiler. The existing code tied its serial port driver into &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;printf&lt;/FONT&gt; &lt;/STRONG&gt;by coding a function named &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;putchar&lt;/FONT&gt;&lt;/STRONG&gt;. But when I try to build that function, I get a whole bunch of weird compiler errors.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;int putchar( char c ) /* stdio - for printf to use */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;sci_write(c);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;return(c);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The errors I get on the first line of the function are:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Multiple markers at this line&lt;BR /&gt;- C2801 ')' missing&lt;BR /&gt;- C2801 ';' missing&lt;BR /&gt;- C1815 c not declared (or typename)&lt;BR /&gt;- C5002 Illegal type&lt;BR /&gt;- Syntax error&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I am so confused. Is &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;putchar&lt;/FONT&gt; &lt;/STRONG&gt;a macro and not a function? What is the right way to tell &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;printf&lt;/FONT&gt; &lt;/STRONG&gt;I want it to use my serial driver? Any suggestions appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lloyd&lt;/P&gt;</description>
      <pubDate>Sat, 19 Apr 2025 22:55:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-tie-my-serial-port-driver-into-printf/m-p/2083461#M9262</guid>
      <dc:creator>lslonim</dc:creator>
      <dc:date>2025-04-19T22:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to tie my serial port driver into printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-tie-my-serial-port-driver-into-printf/m-p/2083640#M9266</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/249155"&gt;@lslonim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;printf() is not possible since there is NO "standard output" in CodeWarror HCS08. User has to implement their own "pseudo" prinf() function, i.e. to format the output in memory and then print out through SCI.&lt;/P&gt;
&lt;P&gt;Please put an #include "termio.h"&amp;nbsp; statement in the code. We can find this file under CodeWarrior install folder.&lt;/P&gt;
&lt;P&gt;The following code runs successfully on QG8. You can refer it on DZ60. The method is the same,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_1-1745214484292.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/334012iB4A171123DB46EEA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_1-1745214484292.png" alt="ZhangJennie_1-1745214484292.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1745214446908.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/334011i8F08E98996C4BEE0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1745214446908.png" alt="ZhangJennie_0-1745214446908.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 05:50:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-tie-my-serial-port-driver-into-printf/m-p/2083640#M9266</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2025-04-21T05:50:23Z</dc:date>
    </item>
  </channel>
</rss>

