<?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 twr_k64 demo USB example in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479967#M29355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried to run the USB CDC HOST and CDC DEVICE&amp;nbsp; demo in SDK 1.3 , using 2 TWR_64K and KDS3.0 with no luck. I just pass the initialization phase and DEVICE is never attached. A very gracious&amp;nbsp; user named ISSAC has been helping me tremendously but it just refuses to attach the device. If any one have some thoughts, Please let me know.&lt;/P&gt;&lt;P&gt;So I decided to run the similar demos Freescale_BM_USB_Stack_v5.0&amp;nbsp; using IAR platform.&lt;/P&gt;&lt;P&gt;I'm trying to build the project from the following folder:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Freescale_BM_USB_Stack_v5.0\Src\example\host\cdc\cdc_serial\bm\iar\host_cdc_serial_twrk64f120m&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; So created a wok-space and had to add few include path This is what I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture_IAR_Worbench.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/3815i81BB0A8B3DE159EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture_IAR_Worbench.PNG" alt="Capture_IAR_Worbench.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It is passing the compile phase however it fails in the linking phase since its looking for a library file usbh.a&lt;/P&gt;&lt;P&gt;in the folder shown in the output council of the workbench that does not exist . where is this file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Ideas? Anyone?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh Hajiani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Apr 2016 22:57:35 GMT</pubDate>
    <dc:creator>kooroshhajiani</dc:creator>
    <dc:date>2016-04-04T22:57:35Z</dc:date>
    <item>
      <title>twr_k64 demo USB example</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479967#M29355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried to run the USB CDC HOST and CDC DEVICE&amp;nbsp; demo in SDK 1.3 , using 2 TWR_64K and KDS3.0 with no luck. I just pass the initialization phase and DEVICE is never attached. A very gracious&amp;nbsp; user named ISSAC has been helping me tremendously but it just refuses to attach the device. If any one have some thoughts, Please let me know.&lt;/P&gt;&lt;P&gt;So I decided to run the similar demos Freescale_BM_USB_Stack_v5.0&amp;nbsp; using IAR platform.&lt;/P&gt;&lt;P&gt;I'm trying to build the project from the following folder:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Freescale_BM_USB_Stack_v5.0\Src\example\host\cdc\cdc_serial\bm\iar\host_cdc_serial_twrk64f120m&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; So created a wok-space and had to add few include path This is what I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture_IAR_Worbench.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/3815i81BB0A8B3DE159EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture_IAR_Worbench.PNG" alt="Capture_IAR_Worbench.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It is passing the compile phase however it fails in the linking phase since its looking for a library file usbh.a&lt;/P&gt;&lt;P&gt;in the folder shown in the output council of the workbench that does not exist . where is this file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Ideas? Anyone?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh Hajiani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2016 22:57:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479967#M29355</guid>
      <dc:creator>kooroshhajiani</dc:creator>
      <dc:date>2016-04-04T22:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: twr_k64 demo USB example</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479968#M29356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Koorosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In USB Stack 5.0, you need to compile USB library for your host application, it is located at: &amp;lt;Freescale_BM_USB_Stack_v5.0&amp;gt;\Src\usb_core\host\build\iar\usbh_bm_twrk64f120m. After building the USB Host library, you will be able to compile your project correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:39:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479968#M29356</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-04-05T16:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: twr_k64 demo USB example</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479969#M29357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks  Issac.&lt;/P&gt;&lt;P&gt;Yes you’re right, I forgot to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Koorosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:53:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479969#M29357</guid>
      <dc:creator>kooroshhajiani</dc:creator>
      <dc:date>2016-04-05T16:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: twr_k64 demo USB example</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479970#M29358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isaac;&lt;/P&gt;&lt;P&gt;I had to leave USB implementation for a while to do some other embedded task and now I'm back again.&lt;/P&gt;&lt;P&gt;So I was able to get the HOST from:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Freescale_BM_USB_Stack_v5.0\Src\example\host\cdc\cdc_serial\bm\iar\host_cdc_serial_twrk64f120m&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;to attach the device from SDK:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Freescale\Freescale USB Stack v4.0.3\Source\Device\app\cdc\iar_ew\kinetis_k20&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture_CDC_TERM.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32289i5A05ABBDC112AF4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture_CDC_TERM.PNG" alt="Capture_CDC_TERM.PNG" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Now as you know I'm a novice when it comes to USB. So my goal is to send just a few bytes from host to device and visa versa&amp;nbsp; .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I see a function named&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_io_cdc_serial_write_async &lt;/STRONG&gt; ,Is this the function to call for that purpose? I placed a break point on this function but it never hits.&lt;/P&gt;&lt;P&gt;one last thing when I type characters in my terminal before I press enter, They're echoed back on screen My local echo on my terminal is off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh Hajiani&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 21:52:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479970#M29358</guid>
      <dc:creator>kooroshhajiani</dc:creator>
      <dc:date>2016-04-14T21:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: twr_k64 demo USB example</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479971#M29359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Koorosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About characters being echoed, in cdc_serial.h there is a macro to enable/disable echo in serial terminal:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14606720812078713 jive_text_macro" data-renderedposition="86_8_1192_32" jivemacro_uid="_14606720812078713" modifiedtitle="true"&gt;&lt;P&gt;#define CDC_SERIAL_ECHO_BACK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;So you need to set it to 0 in order to disable echoing back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For CDC example, progam is reading data from UART (serial terminal) and they are stored in a buffer that will be sent to USB later. This data is sent by using:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14606724633799001 jive_text_macro" data-renderedposition="222_8_1192_16" jivemacro_uid="_14606724633799001" modifiedtitle="true"&gt;&lt;P&gt;num_done = _io_cdc_serial_write(s_f_usb_info.f_usb, &amp;amp;usb_tx_buf[usb_tx_done], (send_cnt &amp;gt; CDC_MAX_PKT_SIZE? CDC_MAX_PKT_SIZE : send_cnt));&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;In this case, s_f_usb_info.f_usb is the FILE PTR to write to USB module, usb_tx_buf[] is the buffer where the data is stored and third parameter specifies how many data will be sent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this can help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:37:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/twr-k64-demo-USB-example/m-p/479971#M29359</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-04-14T22:37:45Z</dc:date>
    </item>
  </channel>
</rss>

