<?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: How to get the USB host CDC example working with FTDI adapter. in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809044#M7856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's for your answer.&lt;/P&gt;&lt;P&gt;Yes I can see that host is sending the&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;GET_LINE_CODING&lt;SPAN&gt;&amp;nbsp;request to device, but it fails every time with&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;kStatus_USB_TransferStall error. Also I do not understand how FTDI 232 device can set its UART baudrate without host setting it. Device does not know what baudrate is desired.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;BR,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Risto&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Oct 2018 07:02:55 GMT</pubDate>
    <dc:creator>ristomustonen</dc:creator>
    <dc:date>2018-10-24T07:02:55Z</dc:date>
    <item>
      <title>How to get the USB host CDC example working with FTDI adapter.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809042#M7854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to use "SDK_2.3.1_MK21FN1M0Axxx12" package USB example "usb_host_cdc" with "FTDI 232" adapter with custom board. Device is powered ON and detected OK when plugged in the USB connector:&lt;/P&gt;&lt;P&gt;Terminal printout:&lt;BR /&gt;===================&lt;BR /&gt;host init done&lt;BR /&gt;This example requires that the CDC device uses Hardware flow&lt;BR /&gt;if the device does't support it, please set USB_HOST_UART_SUPPORT_HW_FLOW to zero and rebuild this project&lt;BR /&gt;Type strings, then the string&lt;BR /&gt;will be echoed back from the device&lt;BR /&gt;device cdc attached:&lt;BR /&gt;pid=0x6001 vid=0x403 address=1&lt;BR /&gt;cdc device attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After connection, USB_HostCdcDataSend() function works. UART terminal data is sent through USB and RS232 line and looped back from Rx-Tx wired loopback connector. Test data is then echoed back to UART terminal correctly. But the data baudrate at RS232 line (checked with oscilloscope) is exactly the USB speed 1.5 MHz. To be able to communicate with another device at RS232 bus the speed must be 115200 bit/s.&lt;/P&gt;&lt;P&gt;So the "outPipe" communication works but at USB speed.&lt;BR /&gt;"USB_HostSend(cdcInstance-&amp;gt;hostHandle, cdcInstance-&amp;gt;outPipe, transfer)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to figure out how to change the RS232 line baudrate and I have tested to set it with function USB_HostCdcSetAcmLineCoding(), which I wrote according the similar Get - function USB_HostCdcGetAcmLineCoding().&lt;BR /&gt;====================&lt;BR /&gt;g_LineCode.dwDTERate = 115200;&lt;BR /&gt;g_LineCode.bDataBits = 8; &lt;BR /&gt;g_LineCode.bParityType = 0;&lt;BR /&gt;g_LineCode.bCharFormat = 1; &lt;BR /&gt;USB_HostCdcSetAcmLineCoding(cdcInstance-&amp;gt;classHandle, &amp;amp;g_LineCode, USB_HostCdcControlCallback, (void *)cdcInstance);&lt;BR /&gt;. . .&lt;BR /&gt;usb_status_t USB_HostCdcSetAcmLineCoding(usb_host_class_handle classHandle,&lt;BR /&gt; usb_host_cdc_line_coding_struct_t *uartLineCoding,&lt;BR /&gt; transfer_callback_t callbackFn,&lt;BR /&gt; void *callbackParam)&lt;BR /&gt;{&lt;BR /&gt;return USB_HostCdcControl(classHandle, USB_REQUEST_TYPE_DIR_OUT | USB_REQUEST_TYPE_TYPE_CLASS | USB_REQUEST_TYPE_RECIPIENT_INTERFACE,&lt;BR /&gt; USB_HOST_CDC_SET_LINE_CODING, 0, 0, 7, (uint8_t *)uartLineCoding, callbackFn, callbackParam);&lt;BR /&gt;}&lt;BR /&gt;. . .&lt;BR /&gt;USB_HostSendSetup(cdcInstance-&amp;gt;hostHandle, cdcInstance-&amp;gt;controlPipe, transfer)&lt;BR /&gt;===================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the transfer is fails every time.&lt;BR /&gt;"data transfer error = 10" (kStatus_USB_TransferStall)&lt;/P&gt;&lt;P&gt;And similarly all other "controlPipe" operations are failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the same result with both Bare Metal and FreeRTOS code.&lt;/P&gt;&lt;P&gt;I wonder if I'm trying to do right thing to change baudrate of line and why data transfer is stalled every time with "controlPipe". Does anyone have this kind of problems with CDC type device. I'll be grateful if I'll get some help and solution with this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Risto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2018 06:03:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809042#M7854</guid>
      <dc:creator>ristomustonen</dc:creator>
      <dc:date>2018-10-19T06:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the USB host CDC example working with FTDI adapter.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809043#M7855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Risto,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During CDC device enumeration, the USB host will send some request command, such as: GET_LINE_CODING request to get CDC device current serial parameter configuration, such as&amp;nbsp; baud rate, stop bit, parity type and data bits.&lt;/P&gt;&lt;P&gt;For the USB CDC host and USB CDC device using bulk transfer to transfer data, which actual USB data transfer speed doesn't followed the serial baud rate setting, which try to emulate the serial communication. The FTDI 232 device can transfer received USB data to real UART port with correct baud rate.&lt;/P&gt;&lt;P&gt;So, customer doesn't need to modify USB Host CDC setting.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 03:38:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809043#M7855</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-10-22T03:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the USB host CDC example working with FTDI adapter.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809044#M7856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's for your answer.&lt;/P&gt;&lt;P&gt;Yes I can see that host is sending the&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;GET_LINE_CODING&lt;SPAN&gt;&amp;nbsp;request to device, but it fails every time with&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;kStatus_USB_TransferStall error. Also I do not understand how FTDI 232 device can set its UART baudrate without host setting it. Device does not know what baudrate is desired.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;BR,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Risto&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 07:02:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809044#M7856</guid>
      <dc:creator>ristomustonen</dc:creator>
      <dc:date>2018-10-24T07:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the USB host CDC example working with FTDI adapter.</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809045#M7857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Risto,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to test FTDI232 USB to Serial tool, while I test below three types without success.&lt;/P&gt;&lt;P&gt;The TWR-K21F120MA serial terminal shows "device not supported."&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76987iF3F0E026AFA33A6D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So I test with FRDM-K64 board with USB CDC device routine, which can pass the test.&lt;/P&gt;&lt;P&gt;I could find below USB CDC device line coding at &amp;lt;virtual_com.c&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/77033i3CF9C2DBD6A3BD96/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The macro definition located at &amp;lt;virtual_com.h&amp;gt; file&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/77077i31D651C80FBD35EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I checked the USB CDC Host driver at &amp;lt;usb_host_cdc.c&amp;gt; file, there without provide API function to SET_LINE_CODING. That's why customer can't change USB CDC device baud rate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76703iEBB4C57E83E79B74/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for the attention.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2018 07:38:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-get-the-USB-host-CDC-example-working-with-FTDI-adapter/m-p/809045#M7857</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-10-25T07:38:36Z</dc:date>
    </item>
  </channel>
</rss>

