<?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: Custom printf handler for CW MCU 10.2/Kinetis in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Custom-printf-handler-for-CW-MCU-10-2-Kinetis/m-p/209882#M8221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Not sure about the C++ project, but in C project I use to define functions with the following prototypes to redirect printf:&lt;/P&gt;&lt;P&gt;int __read_console(__file_handle handle, unsigned char* buffer, size_t * count);&lt;BR /&gt;int __write_console(__file_handle handle, unsigned char* buffer, size_t* count);&lt;BR /&gt;int __close_console(__file_handle handle);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;PetrC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2012 14:37:19 GMT</pubDate>
    <dc:creator>PetrC</dc:creator>
    <dc:date>2012-02-27T14:37:19Z</dc:date>
    <item>
      <title>Custom printf handler for CW MCU 10.2/Kinetis</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Custom-printf-handler-for-CW-MCU-10-2-Kinetis/m-p/209881#M8220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;our C++ project targets CW10.2 on Kinetis and uses EWL. We've written our own custom logger. Now, a third-party library thinks it may just call printf() to output error messages. Currently, the EWL printf writes these messages to the debugger via some kind of Cortex debug magic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead, I'd like to redirect the output to our logger. I've tried defining my own __ConsoleWrite function in my application, but that changed nothing; the printf call still went to the debugger. What else can I try? I'd like to keep the other C standard library functions, so I'd like to continue including EWL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;KA&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Feb 2012 00:11:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Custom-printf-handler-for-CW-MCU-10-2-Kinetis/m-p/209881#M8220</guid>
      <dc:creator>konrada</dc:creator>
      <dc:date>2012-02-25T00:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom printf handler for CW MCU 10.2/Kinetis</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Custom-printf-handler-for-CW-MCU-10-2-Kinetis/m-p/209882#M8221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Not sure about the C++ project, but in C project I use to define functions with the following prototypes to redirect printf:&lt;/P&gt;&lt;P&gt;int __read_console(__file_handle handle, unsigned char* buffer, size_t * count);&lt;BR /&gt;int __write_console(__file_handle handle, unsigned char* buffer, size_t* count);&lt;BR /&gt;int __close_console(__file_handle handle);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;PetrC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 14:37:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Custom-printf-handler-for-CW-MCU-10-2-Kinetis/m-p/209882#M8221</guid>
      <dc:creator>PetrC</dc:creator>
      <dc:date>2012-02-27T14:37:19Z</dc:date>
    </item>
  </channel>
</rss>

