<?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: Sending out more than 64 bytes of with with USB Virtual COM demo in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528940#M5502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Ellisys USB Analizer: &lt;A href="http://www.ellisys.com/" title="http://www.ellisys.com/"&gt;Ellisys - USB and Bluetooth Protocol Analyzers&lt;/A&gt; &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, 18 Aug 2016 18:00:36 GMT</pubDate>
    <dc:creator>isaacavila</dc:creator>
    <dc:date>2016-08-18T18:00:36Z</dc:date>
    <item>
      <title>Sending out more than 64 bytes of with with USB Virtual COM demo</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528936#M5498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried a couple approaches to sending out large chunks (up to 4k bytes) of data using the virtual COM port example (MK22FN512VLH12, KSDK 1.3.0) however none of them have worked.&amp;nbsp; I've found that you can send out 64 bytes, once, without a problem; however, sending out more than that, or calling USB_Class_CDC_Send_Data multiple times does not work as expected and I don't know why.&amp;nbsp; Take this code for example, in &lt;STRONG&gt;Virtual_Com_App():&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (g_send_size)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t error;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t size = g_send_size;&lt;/P&gt;&lt;P&gt;&amp;nbsp; g_send_size = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t stuff[64] = { 65, 65, 65, ..., 65, 0 };&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t j;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(j = 0; j &amp;lt; 5; j++)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = USB_Class_CDC_Send_Data(applicationHandle, DIC_BULK_IN_ENDPOINT, stuff, 64);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calling &lt;STRONG&gt;USB_Class_CDC_Send_Data&lt;/STRONG&gt; consecutively does not work.&amp;nbsp; If I remove the for loop, it works as expected.&amp;nbsp; Also, if I call &lt;STRONG&gt;USB_Class_CDC_Send_Data(applicationHandle, DIC_BULK_IN_ENDPOINT, stuff, 200); &lt;/STRONG&gt;this does not work either, returns USB_ERR (0xFF).&amp;nbsp; I'm trying to figure out how I can write a chunk of data to the COM port without any or with minimal interaction from the PC side.&amp;nbsp; How can this be done using the USB Virtual COM demo? &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 21:02:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528936#M5498</guid>
      <dc:creator>kevinlfw</dc:creator>
      <dc:date>2016-07-21T21:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sending out more than 64 bytes of with with USB Virtual COM demo</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528937#M5499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question may be relevant: &lt;A _jive_internal="true" href="https://community.nxp.com/thread/385999?q=virtual%20com" title="https://community.nxp.com/thread/385999?q=virtual%20com"&gt;https://community.nxp.com/thread/385999?q=virtual%20com&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I've never really had to change the SerialPort settings from their defaults when writing communication apps in .NET.&amp;nbsp; Whats the reason behind this, and is there something I can change so that I don't have to set DtrEnable?&amp;nbsp; Lastly, does setting the baud rate correctly actually matter since its really a USB device after all?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2016 14:13:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528937#M5499</guid>
      <dc:creator>kevinlfw</dc:creator>
      <dc:date>2016-07-22T14:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sending out more than 64 bytes of with with USB Virtual COM demo</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528938#M5500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem here is that Maximum packet size for Bulk endpoint in Full speed is set to 64 (wMaxPacketSize in endpoint descriptor), so, in order to send more than 64 bytes, multiple transactions must be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified default example and could send more than 64 bytes, and the difference between your example and mine is that buffer that will be sent is not a LOCAL VARIABLE (as far as I know, USB CDC does not uses internal buffer and does not copy the information that you want to send in internal buffer, so it shouldn't be saved in local variables):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I made:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14697207339585052 jive_text_macro" data-renderedposition="242_8_1192_16" jivemacro_uid="_14697207339585052" modifiedtitle="true"&gt;&lt;P&gt;uint8_t buffer[] = {"This is a buffer larger than 64 bytes: 0123456789ABCDEF... Test for sending more than 64 bytes\n"};&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, In Virtual_Com_App i modified to send this buffer everytime that i received any data from Host:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14697208781265370 jive_text_macro" data-renderedposition="310_8_1192_528" jivemacro_uid="_14697208781265370" modifiedtitle="true"&gt;&lt;P&gt;void Virtual_Com_App(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* User Code */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((0 != g_recv_size) &amp;amp;&amp;amp; (0xFFFFFFFF != g_recv_size))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int32_t i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Copy Buffer to Send Buff */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i = 0; i &amp;lt; g_recv_size; i++)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_PRINTF("Copied: %c\n\r", g_curr_recv_buf[i]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_curr_send_buf[g_send_size++] = g_curr_recv_buf[i];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_recv_size = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (g_send_size)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t size = sizeof(buffer);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g_send_size = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = USB_Class_CDC_Send_Data(g_app_handle, DIC_BULK_IN_ENDPOINT,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer, size);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (error != USB_OK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_PRINTF("Error on USB_Class_CDC_Send_Data\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Failure to send Data Handling code here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, I could see that message was sent correctly (First, 64 bytes were sent then, missing 32 bytes are sent):&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Sending more than 64 bytes in CDC Example.jpg"&gt;&lt;IMG alt="Sending more than 64 bytes in CDC Example.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/50886iB23FCE5520AFB135/image-size/large?v=v2&amp;amp;px=999" title="Sending more than 64 bytes in CDC Example.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Have you tried to declare this buffer as global?&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>Mon, 02 Nov 2020 13:33:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528938#M5500</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2020-11-02T13:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sending out more than 64 bytes of with with USB Virtual COM demo</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528939#M5501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/isaacavila"&gt;isaacavila&lt;/A&gt; Thanks for the feedback.&amp;nbsp; Its all figured out :smileyhappy:.&amp;nbsp; Could you tell me what tool you used to sniff USB protocol (the last screenshot)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 17:57:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528939#M5501</guid>
      <dc:creator>kevinlfw</dc:creator>
      <dc:date>2016-08-18T17:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sending out more than 64 bytes of with with USB Virtual COM demo</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528940#M5502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Ellisys USB Analizer: &lt;A href="http://www.ellisys.com/" title="http://www.ellisys.com/"&gt;Ellisys - USB and Bluetooth Protocol Analyzers&lt;/A&gt; &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, 18 Aug 2016 18:00:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-out-more-than-64-bytes-of-with-with-USB-Virtual-COM-demo/m-p/528940#M5502</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-08-18T18:00:36Z</dc:date>
    </item>
  </channel>
</rss>

