<?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: USB CDC Example Receive only fail in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1970007#M66833</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;XiangJun,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The part I'm using is the&amp;nbsp;&lt;/SPAN&gt;MK27FN2M0VM115 in a custom board, but I also tested it in a FRDM-K64F.&lt;/P&gt;&lt;P&gt;I solve the issue partially calling the USB sending fuction without data after receiving:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt; if (s_sendSize)
        {
            uint32_t size = s_sendSize;


			s_sendSize    = 0;

            error = USB_DeviceCdcAcmSend(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_IN_ENDPOINT, NULL, 0);

            if (error != kStatus_USB_Success)
            {
                // Failure to send Data Handling code here
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better solution?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 13:21:09 GMT</pubDate>
    <dc:creator>etronic_arg</dc:creator>
    <dc:date>2024-10-09T13:21:09Z</dc:date>
    <item>
      <title>USB CDC Example Receive only fail</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1965405#M66821</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I just trying to do a Virtual COM communication based on the USB CDC example from SDK.&lt;BR /&gt;I tested the example with success.&lt;/P&gt;&lt;P&gt;I cancel the "echo" part of the APPTask:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static void APPTask(void)
{
    usb_status_t error = kStatus_USB_Error;
    if ((1 == s_cdcVcom.attach) &amp;amp;&amp;amp; (1 == s_cdcVcom.startTransactions))
    {
        /* User Code */
        /* endpoint callback length is USB_CANCELLED_TRANSFER_LENGTH (0xFFFFFFFFU) when transfer is canceled */
        if ((0 != s_recvSize) &amp;amp;&amp;amp; (USB_CANCELLED_TRANSFER_LENGTH != s_recvSize))
        {
            int32_t i;

			/* Copy Buffer to Send Buff */
            for (i = 0; i &amp;lt; s_recvSize; i++)
            {
                s_currSendBuf[s_sendSize++] = s_currRecvBuf[i];
            }

			s_recvSize = 0;
        }


/*
        if (s_sendSize)
        {
            uint32_t size = s_sendSize;


			s_sendSize    = 0;

            error = USB_DeviceCdcAcmSend(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_IN_ENDPOINT, s_currSendBuf, size);

            if (error != kStatus_USB_Success)
            {
                // Failure to send Data Handling code here
            }
        }
*/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I send "HELLO" wth a terminal from a PC, the first time&amp;nbsp;s_currSendBuf fills with the characters.&lt;/P&gt;&lt;P&gt;With the second "HELLO" I send, the terminal stucks.&lt;BR /&gt;&lt;BR /&gt;I just need to receive characters but not send them back.&lt;BR /&gt;What would be the right way to do it?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 21:31:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1965405#M66821</guid>
      <dc:creator>etronic_arg</dc:creator>
      <dc:date>2024-10-01T21:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC Example Receive only fail</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1969408#M66830</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can you tell us the part number you are using?&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 02:48:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1969408#M66830</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-10-09T02:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC Example Receive only fail</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1970007#M66833</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;XiangJun,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The part I'm using is the&amp;nbsp;&lt;/SPAN&gt;MK27FN2M0VM115 in a custom board, but I also tested it in a FRDM-K64F.&lt;/P&gt;&lt;P&gt;I solve the issue partially calling the USB sending fuction without data after receiving:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt; if (s_sendSize)
        {
            uint32_t size = s_sendSize;


			s_sendSize    = 0;

            error = USB_DeviceCdcAcmSend(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_IN_ENDPOINT, NULL, 0);

            if (error != kStatus_USB_Success)
            {
                // Failure to send Data Handling code here
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better solution?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 13:21:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1970007#M66833</guid>
      <dc:creator>etronic_arg</dc:creator>
      <dc:date>2024-10-09T13:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC Example Receive only fail</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1970996#M66836</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Yes, this is a good solution. After you have data, just call the the function to send.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Xiangjun Rong&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;USB_DeviceCdcAcmSend();&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 06:15:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-CDC-Example-Receive-only-fail/m-p/1970996#M66836</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-10-10T06:15:35Z</dc:date>
    </item>
  </channel>
</rss>

