<?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>MQX Software SolutionsのトピックRe: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158932#M1024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice the USB DCD driver is not available in MAX3.8? The two functions in usb_dcd_poll_kn.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_kusb_dcd_polled_read&lt;/P&gt;&lt;P&gt;_kusb_dcd_polled_write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are basically empty. Do you have a more complete codes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 14 Oct 2012 10:10:11 GMT</pubDate>
    <dc:creator>keithtang</dc:creator>
    <dc:date>2012-10-14T10:10:11Z</dc:date>
    <item>
      <title>TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158927#M1019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a tower kit with K60 MCU and configured the hw to use the USB port on TWR-SER to power the system and use as IO for MQX's 3.7.0 USB CDC example. Everything works fine with the demo code. I'd now like to redirect all printf()/stdio communication to the USB_CDC (virtual com) instead of UART (ttyf&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Checking mqx\source\bsp\twrk60n512\twrk60n512.h﻿, the default entry &lt;STRONG&gt;BSP_DEFAULT_IO_CHANNEL defined as "ttyf:"&lt;/STRONG&gt;﻿ would be my first choice to modify and redirect stdio but I have not found a valid entry to redirect to USB CDC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I have to write a new BSP driver (AN3902) in order to redirect printf() to USB instead of UART or am I trying to reinvent the wheel and there is a simple solution that I overlooked? I'd prefer to keep as much portable and compatible with MQX libraries to avoid having to adapt&amp;nbsp; my code with every minor MQX library release.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;W.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Aug 2011 22:06:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158927#M1019</guid>
      <dc:creator>wopi</dc:creator>
      <dc:date>2011-08-13T22:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158928#M1020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am also looking for the same solution. Anyone has any updates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 14:33:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158928#M1020</guid>
      <dc:creator>keithtang</dc:creator>
      <dc:date>2012-06-12T14:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158929#M1021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There is the function for redirecting&amp;nbsp; STDOUT, STDIN, STDERR to your driver handle _io_set_handle(...).&lt;/P&gt;&lt;P&gt;Usage:&lt;/P&gt;&lt;P&gt;&amp;lt;old driver handle&amp;gt; = _io_set_handle(IO_STDOUT, &amp;lt;new driver handle&amp;gt;);&lt;/P&gt;&lt;P&gt;Return value of this function is previous driver handle. You can use it latter to redirect&amp;nbsp; STDOUT back.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 18:36:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158929#M1021</guid>
      <dc:creator>BielikM</dc:creator>
      <dc:date>2012-06-14T18:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158930#M1022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you tell me how to implement io_sethandle when using a Processor Expert project?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to send serial data back throug the USB port to my workstation by selecting UART2 on the K70 TOWER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I would like to redirect stdio from this project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me if io_sethandle() is still the proper method to achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2012 23:45:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158930#M1022</guid>
      <dc:creator>crezyoz</dc:creator>
      <dc:date>2012-07-23T23:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158931#M1023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi crezyoz,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not familiar with Processor expert t, can't help you in that area.&lt;/P&gt;&lt;P&gt;io_sethandle is the function you need and the one which redirects the output as stated by BielikM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 13:57:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158931#M1023</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-07-25T13:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158932#M1024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice the USB DCD driver is not available in MAX3.8? The two functions in usb_dcd_poll_kn.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_kusb_dcd_polled_read&lt;/P&gt;&lt;P&gt;_kusb_dcd_polled_write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are basically empty. Do you have a more complete codes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Oct 2012 10:10:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158932#M1024</guid>
      <dc:creator>keithtang</dc:creator>
      <dc:date>2012-10-14T10:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158933#M1025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Keith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"DCD" stands for Device Charger Detection; maybe you wanted to write "CDC" (Communication Device Class)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Teckna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 09:18:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158933#M1025</guid>
      <dc:creator>Teckna</dc:creator>
      <dc:date>2012-10-15T09:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158934#M1026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arrrr... thanks for pointing out the mistake, Teckna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK CDC is the correct term I intended to use. Do you have a driver that mimicking the UART? Virtual Comm uses application layer for the demo, but I am looking for the kernel level driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please point me to the right direction, thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 16:43:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158934#M1026</guid>
      <dc:creator>keithtang</dc:creator>
      <dc:date>2012-10-15T16:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158935#M1027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Freescale MQX, there is \usb\host\examples\cdc\cdc_serial example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;usb_class_cdc_install_driver() function installs USB serial device driver to the MQX I/O subsystem ("tty0:" in the example). Then from a user task, you can fopen, fread and fwrite to it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2012 05:18:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158935#M1027</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2012-10-16T05:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158936#M1028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is an application level function, it does not handle kernel level xxprintf() functions. I am a bit disappointed, as writing kernel level CDC is a nightmare to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 02:46:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158936#M1028</guid>
      <dc:creator>keithtang</dc:creator>
      <dc:date>2012-11-14T02:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158937#M1029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where does this &amp;lt;new driver handle&amp;gt; come from in the virtual_com example?&lt;/P&gt;&lt;P&gt;It has a g_app_handle, but io_sethandle wants a FILE_PTR??I&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;old driver handle&amp;gt; = _io_set_handle(IO_STDOUT, &amp;lt;new driver handle&amp;gt;);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 17:54:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158937#M1029</guid>
      <dc:creator>kristies1</dc:creator>
      <dc:date>2013-06-24T17:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: TWRSER - Redirecting printf() to USB CDC (virtual com)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158938#M1030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did anyone work out a solution for this???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so could you please share?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 11:00:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/TWRSER-Redirecting-printf-to-USB-CDC-virtual-com/m-p/158938#M1030</guid>
      <dc:creator>F50SC</dc:creator>
      <dc:date>2015-04-02T11:00:01Z</dc:date>
    </item>
  </channel>
</rss>

