<?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: CDC transfer is received in many events USB High Speed in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321838#M46141</link>
    <description>&lt;P&gt;More details:&lt;/P&gt;&lt;P&gt;I added a usb_echo command in the USB IRQ handler:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void USB1_IRQHandler(void)
{
    usb_echo("USB Interrupt!!\r\n");
    USB_DeviceLpcIp3511IsrFunction(g_composite_hs.deviceHandle);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I echo data without 0x0A:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;echo -n -e '\x1\x2\x3\x4\x5' &amp;gt; /dev/ttyACMX&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCU's output is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USB Interrupt!!
USB Interrupt!!
5 NEW Bytes:
1 2 3 4 5
USB Interrupt!!&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add 0X0A to the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;echo -n -e '\x1\x2\xa\xa\x5' &amp;gt; /dev/ttyACMX&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USB Interrupt!!
USB Interrupt!!
3 NEW Bytes:
1 2 A
USB Interrupt!!
USB Interrupt!!
1 NEW Bytes:
A
USB Interrupt!!
USB Interrupt!!
1 NEW Bytes:
5
USB Interrupt!!&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCU receives interrupts for every chunk, so seems that the linux driver is sending the data in chunks.&lt;/P&gt;&lt;P&gt;I tried to write to the port using binary mode:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fopen("/dev/ttyACMX", "wb")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the data was chunked anyway.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Wireshark confirmed that the data is sent from my linux machine in chunks.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 10:38:18 GMT</pubDate>
    <dc:creator>embedded_eng_</dc:creator>
    <dc:date>2021-08-11T10:38:18Z</dc:date>
    <item>
      <title>CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1320992#M46120</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using&amp;nbsp;&lt;SPAN&gt;lpcxpresso55s16_dev_composite_cdc_msc_bm example with a small modification in "kUSB_DeviceCdcEventRecvResponse" event which prints the received data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        case kUSB_DeviceCdcEventRecvResponse:
        {
            if ((1 == g_deviceComposite_hs-&amp;gt;cdcVcomBulk.attach) &amp;amp;&amp;amp; (1 == g_deviceComposite_hs-&amp;gt;cdcVcomBulk.startTransactions))
            {
                g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk = epCbParam-&amp;gt;length;
                if (!g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk)
                {
                    /* Schedule buffer for next receive event */
                    error = USB_DeviceCdcAcmRecv(handle, USB_CDC_VCOM_DIC_BULK_OUT_ENDPOINT, s_currRecvBuf_BULK,
                                                 g_cdcVcomDicEndpoints_BULK[0].maxPacketSize);
                }

                usb_echo("%d NEW Bytes:\r\n", g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk);
                for(int i = 0 ; i &amp;lt; g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk ; i ++ ) {
                	usb_echo("%X ", s_currRecvBuf_BULK[i]);
                	if(i % 16 == 0 &amp;amp;&amp;amp; i != 0) usb_echo("\r\n");
                	if(i % 8 == 0 &amp;amp;&amp;amp; i != 0) usb_echo("   ");
                }
                usb_echo("\r\n");

                error = USB_DeviceCdcAcmSend(g_deviceComposite_hs-&amp;gt;cdcVcomBulk.cdcAcmHandle, USB_CDC_VCOM_DIC_BULK_IN_ENDPOINT, "", 0);
                g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk = 0;
                g_deviceComposite_hs-&amp;gt;cdcVcomSendSizeBulk    = 0;
            }
        }
        break;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sending a 512B packet using a C code to the relevant CDC port.&lt;/P&gt;&lt;P&gt;When I send the data, The data which is been sent is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;65 E4 9F 40 A2 37 4F B6 D2    D0 AE 99 AC E2 A4 22 8F 
   99 B4 45 4A 2E A4 D1 99    22 23 E7 E0 D2 6 3D 72 
   92 CE AF 25 EA 7E 59 D7    56 1 A BE 4D 91 13 B0 
   4B 33 62 F1 84 62 30 56    A0 2E 2A FB 7 70 E7 9A 
   C9 64 62 2 15 19 E5 A1    F7 85 53 8B 94 D7 E7 8E 
   B8 7E 6 C 9A 53 90 77    60 FF 9F E8 65 87 BD AD 
   8A 2C 70 A5 12 F9 D5 44    48 7D 47 79 D0 83 63 96 
   F3 D0 67 F0 4F 49 63 4A    5E 6E 10 52 3F 9 C5 CD 
   9E 2C C2 AA 55 9E 31 ED    6D E5 A9 2A 1F 4C 72 D2 
   C8 96 2 3A 8A 4A 14 9B    26 AF 99 78 FB 15 E3 52 
   5F 53 D1 C0 21 59 A2 0    C 6F 5B AE 15 F2 19 DC 
   D3 81 E3 11 ED 68 90 A    18 A1 41 AD 60 B6 1F 5B 
   54 98 93 4 1E 0 8E E2    FC 37 9C E8 C2 99 76 A5 
   8B C2 F7 43 60 7A 39 17    B3 8B 20 31 2 C4 D 86 
   2B 5C AC 4A 1F 4E B3 7    7B 63 5F 81 AD A5 B3 EF 
   82 6 60 46 A 24 7B 7F    75 F5 72 D4 B0 47 55 6 
   F9 5F C9 9E D2 D7 BF 6F    39 9F C 37 11 35 12 4A 
   2C C6 8B 5A A8 A9 A5 CE    BB EB E9 66 81 57 66 E2 
   5C F 85 D9 DE 59 1C E    DF 15 E7 8 30 5D CA A7 
   33 7E 69 D4 39 67 18 D7    55 B3 E3 1E 9A 11 B9 1F 
   5E FE 98 34 FB F3 30 7F    DD D9 29 DC 8C 16 50 1A 
   2B 48 0 5D 62 6E 10 E4    C5 1D 59 5D B4 6C 1A 25 
   32 5F 5F 9B 1B 8F D4 CE    94 9C E6 76 3D FC A6 45 
   2A DD 2F F2 8E 20 D0 69    66 1B 5E 9D F9 26 6C BC 
   41 12 CB 10 2F F3 6 24    7A 2D 6D F2 8D 9B BD 6C 
   A5 6A A5 9A 68 B1 BE 7A    E6 B9 12 AA 43 51 D6 20 
   1C C3 A B 33 4C 9A E4    94 6 2 7E 79 F4 6C 2B 
   E4 26 65 71 B4 B9 1D 8A    AA DF 77 9A AE FD 5 5F 
   9D 6E 18 D9 A0 ED D1 68    80 1D FE BC 11 89 21 30 
   D9 AB E2 83 6A D4 59 12    43 13 8 2F 57 37 35 CF 
   47 B3 7D 54 A1 A9 6D A8    CE A9 C2 64 8E 4B C9 F 
   E4 D6 F8 13 54 25 89 83    6F E7 CF B4 6F 87 BB &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the data isn't received in one event, it is received in many events:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;43 NEW Bytes:
65 E4 9F 40 A2 37 4F B6 D2    D0 AE 99 AC E2 A4 22 8F
   99 B4 45 4A 2E A4 D1 99    22 23 E7 E0 D2 6 3D 72
   92 CE AF 25 EA 7E 59 D7    56 1
2 NEW Bytes:
D A
82 NEW Bytes:
BE 4D 91 13 B0 4B 33 62 F1    84 62 30 56 A0 2E 2A FB
   7 70 E7 9A C9 64 62 2    15 19 E5 A1 F7 85 53 8B
   94 D7 E7 8E B8 7E 6 C    9A 53 90 77 60 FF 9F E8
   65 87 BD AD 8A 2C 70 A5    12 F9 D5 44 48 7D 47 79
   D0 83 63 96 F3 D0 67 F0    4F 49 63 4A 5E 6E 10 52
   3F
1 NEW Bytes:
9
57 NEW Bytes:
C5 CD 9E 2C C2 AA 55 9E 31    ED 6D E5 A9 2A 1F 4C 72
   D2 C8 96 2 3A 8A 4A 14    9B 26 AF 99 78 FB 15 E3
   52 5F 53 D1 C0 21 59 A2    0 C 6F 5B AE 15 F2 19
   DC D3 81 E3 11 ED 68 90
2 NEW Bytes:
D A
60 NEW Bytes:
18 A1 41 AD 60 B6 1F 5B 54    98 93 4 1E 0 8E E2 FC
   37 9C E8 C2 99 76 A5 8B    C2 F7 43 60 7A 39 17 B3
   8B 20 31 2 C4 D 86 2B    5C AC 4A 1F 4E B3 7 7B
   63 5F 81 AD A5 B3 EF 82    6 60 46
2 NEW Bytes:
D A
173 NEW Bytes:
24 7B 7F 75 F5 72 D4 B0 47    55 6 F9 5F C9 9E D2 D7
   BF 6F 39 9F C 37 11 35    12 4A 2C C6 8B 5A A8 A9
   A5 CE BB EB E9 66 81 57    66 E2 5C F 85 D9 DE 59
   1C E DF 15 E7 8 30 5D    CA A7 33 7E 69 D4 39 67
   18 D7 55 B3 E3 1E 9A 11    B9 1F 5E FE 98 34 FB F3
   30 7F DD D9 29 DC 8C 16    50 1A 2B 48 0 5D 62 6E
   10 E4 C5 1D 59 5D B4 6C    1A 25 32 5F 5F 9B 1B 8F
   D4 CE 94 9C E6 76 3D FC    A6 45 2A DD 2F F2 8E 20
   D0 69 66 1B 5E 9D F9 26    6C BC 41 12 CB 10 2F F3
   6 24 7A 2D 6D F2 8D 9B    BD 6C A5 6A A5 9A 68 B1
   BE 7A E6 B9 12 AA 43 51    D6 20 1C C3
2 NEW Bytes:
D A
92 NEW Bytes:
B 33 4C 9A E4 94 6 2 7E    79 F4 6C 2B E4 26 65 71
   B4 B9 1D 8A AA DF 77 9A    AE FD 5 5F 9D 6E 18 D9
   A0 ED D1 68 80 1D FE BC    11 89 21 30 D9 AB E2 83
   6A D4 59 12 43 13 8 2F    57 37 35 CF 47 B3 7D 54
   A1 A9 6D A8 CE A9 C2 64    8E 4B C9 F E4 D6 F8 13
   54 25 89 83 6F E7 CF B4    6F 87 BB&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;516B were received.&lt;/P&gt;&lt;P&gt;Somehow, 4B were added.&lt;/P&gt;&lt;P&gt;Each 2 Bytes event includes "D A", but the D was not sent, just the A's, this explains the additional 4B.&lt;/P&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;P&gt;* Why one send event is received as many events in the MCU, how can I fix it?&lt;/P&gt;&lt;P&gt;* Why these 4B were added?&lt;/P&gt;&lt;P&gt;* Why "USB_DeviceCdcAcmSend" function is needed in&amp;nbsp;kUSB_DeviceCdcEventRecvResponse event? without it, just the first event is received.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 09:58:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1320992#M46120</guid>
      <dc:creator>embedded_eng_</dc:creator>
      <dc:date>2021-08-10T09:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321033#M46122</link>
      <description>&lt;P&gt;I don't know whether it helps, but "D" is CR and "A" if LF - i.e. what you will get if you printf("\n").&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 10:30:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321033#M46122</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-08-10T10:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321045#M46125</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I changed the "kUSB_DeviceCdcEventRecvResponse" handler and removed the&amp;nbsp;USB_DeviceCdcAcmSend part (which I think caused the "\n").&lt;/P&gt;&lt;P&gt;Now it looks like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;case kUSB_DeviceCdcEventRecvResponse:
        {
            if ((1 == g_deviceComposite_hs-&amp;gt;cdcVcomBulk.attach) &amp;amp;&amp;amp; (1 == g_deviceComposite_hs-&amp;gt;cdcVcomBulk.startTransactions))
            {
                g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk = epCbParam-&amp;gt;length;
                if (!g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk)
                {
                    /* Schedule buffer for next receive event */
                    error = USB_DeviceCdcAcmRecv(handle, USB_CDC_VCOM_DIC_BULK_OUT_ENDPOINT, s_currRecvBuf_BULK,
                                                 g_cdcVcomDicEndpoints_BULK[0].maxPacketSize);
                }
                usb_echo("%d NEW Bytes:\r\n", g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk);
                for(int i = 0 ; i &amp;lt; g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk ; i ++ ) {
                	usb_echo("%X ", epCbParam-&amp;gt;buffer[i]);
                	if(i % 16 == 0 &amp;amp;&amp;amp; i != 0) usb_echo("\r\n");
                	if(i % 8 == 0 &amp;amp;&amp;amp; i != 0) usb_echo("   ");
                }
                usb_echo("\r\n");
                error = USB_DeviceCdcAcmRecv(handle, USB_CDC_VCOM_DIC_BULK_OUT_ENDPOINT, s_currRecvBuf_BULK,0);
                g_deviceComposite_hs-&amp;gt;cdcVcomRecvSizeBulk = 0;
                g_deviceComposite_hs-&amp;gt;cdcVcomSendSizeBulk    = 0;
            }
        }
        break;&lt;/LI-CODE&gt;&lt;P&gt;Now, after I send the 512B packet, I receive:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;43 NEW Bytes:
65 E4 9F 40 A2 37 4F B6 D2    D0 AE 99 AC E2 A4 22 8F
   99 B4 45 4A 2E A4 D1 99    22 23 E7 E0 D2 6 3D 72
   92 CE AF 25 EA 7E 59 D7    56 1
0 NEW Bytes:

82 NEW Bytes:
BE 4D 91 13 B0 4B 33 62 F1    84 62 30 56 A0 2E 2A FB
   7 70 E7 9A C9 64 62 2    15 19 E5 A1 F7 85 53 8B
   94 D7 E7 8E B8 7E 6 C    9A 53 90 77 60 FF 9F E8
   65 87 BD AD 8A 2C 70 A5    12 F9 D5 44 48 7D 47 79
   D0 83 63 96 F3 D0 67 F0    4F 49 63 4A 5E 6E 10 52
   3F
0 NEW Bytes:

57 NEW Bytes:
C5 CD 9E 2C C2 AA 55 9E 31    ED 6D E5 A9 2A 1F 4C 72
   D2 C8 96 2 3A 8A 4A 14    9B 26 AF 99 78 FB 15 E3
   52 5F 53 D1 C0 21 59 A2    0 C 6F 5B AE 15 F2 19
   DC D3 81 E3 11 ED 68 90
0 NEW Bytes:

60 NEW Bytes:
18 A1 41 AD 60 B6 1F 5B 54    98 93 4 1E 0 8E E2 FC
   37 9C E8 C2 99 76 A5 8B    C2 F7 43 60 7A 39 17 B3
   8B 20 31 2 C4 D 86 2B    5C AC 4A 1F 4E B3 7 7B
   63 5F 81 AD A5 B3 EF 82    6 60 46
0 NEW Bytes:

173 NEW Bytes:
24 7B 7F 75 F5 72 D4 B0 47    55 6 F9 5F C9 9E D2 D7
   BF 6F 39 9F C 37 11 35    12 4A 2C C6 8B 5A A8 A9
   A5 CE BB EB E9 66 81 57    66 E2 5C F 85 D9 DE 59
   1C E DF 15 E7 8 30 5D    CA A7 33 7E 69 D4 39 67
   18 D7 55 B3 E3 1E 9A 11    B9 1F 5E FE 98 34 FB F3
   30 7F DD D9 29 DC 8C 16    50 1A 2B 48 0 5D 62 6E
   10 E4 C5 1D 59 5D B4 6C    1A 25 32 5F 5F 9B 1B 8F
   D4 CE 94 9C E6 76 3D FC    A6 45 2A DD 2F F2 8E 20
   D0 69 66 1B 5E 9D F9 26    6C BC 41 12 CB 10 2F F3
   6 24 7A 2D 6D F2 8D 9B    BD 6C A5 6A A5 9A 68 B1
   BE 7A E6 B9 12 AA 43 51    D6 20 1C C3
0 NEW Bytes:

92 NEW Bytes:
B 33 4C 9A E4 94 6 2 7E    79 F4 6C 2B E4 26 65 71
   B4 B9 1D 8A AA DF 77 9A    AE FD 5 5F 9D 6E 18 D9
   A0 ED D1 68 80 1D FE BC    11 89 21 30 D9 AB E2 83
   6A D4 59 12 43 13 8 2F    57 37 35 CF 47 B3 7D 54
   A1 A9 6D A8 CE A9 C2 64    8E 4B C9 F E4 D6 F8 13
   54 25 89 83 6F E7 CF B4    6F 87 BB&lt;/LI-CODE&gt;&lt;P&gt;Total of 507B, some data is missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 10:44:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321045#M46125</guid>
      <dc:creator>embedded_eng_</dc:creator>
      <dc:date>2021-08-10T10:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321060#M46126</link>
      <description>&lt;P&gt;So, you are 'missing' 5 bytes. I looked through your sent data and you have 4 'A' (LF) characters and 1 'D' (CR) characters, making 5. I wonder if something is ignoring CR and LF characters?&lt;/P&gt;&lt;P&gt;As en experiment, try changing the data to add more CR and LF and another with fewer CR and LF and see what that tells you.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 11:02:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321060#M46126</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-08-10T11:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321063#M46127</link>
      <description>&lt;P&gt;p.s. I notice each packet break in after a CR or LF character, so something is looking for line breaks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 11:03:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321063#M46127</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-08-10T11:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321087#M46128</link>
      <description>&lt;P&gt;You're right, I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo dd if=/dev/urandom of=/dev/ttyACMX count=1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And seems that the packet is cut to different chunks every time.&lt;/P&gt;&lt;P&gt;Then I tried data without D or A and it was sent as 1 chunk.&lt;/P&gt;&lt;P&gt;Thanks for that.&lt;/P&gt;&lt;P&gt;I'll try to find the cause.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 11:47:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321087#M46128</guid>
      <dc:creator>embedded_eng_</dc:creator>
      <dc:date>2021-08-10T11:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321838#M46141</link>
      <description>&lt;P&gt;More details:&lt;/P&gt;&lt;P&gt;I added a usb_echo command in the USB IRQ handler:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void USB1_IRQHandler(void)
{
    usb_echo("USB Interrupt!!\r\n");
    USB_DeviceLpcIp3511IsrFunction(g_composite_hs.deviceHandle);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I echo data without 0x0A:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;echo -n -e '\x1\x2\x3\x4\x5' &amp;gt; /dev/ttyACMX&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCU's output is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USB Interrupt!!
USB Interrupt!!
5 NEW Bytes:
1 2 3 4 5
USB Interrupt!!&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add 0X0A to the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;echo -n -e '\x1\x2\xa\xa\x5' &amp;gt; /dev/ttyACMX&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USB Interrupt!!
USB Interrupt!!
3 NEW Bytes:
1 2 A
USB Interrupt!!
USB Interrupt!!
1 NEW Bytes:
A
USB Interrupt!!
USB Interrupt!!
1 NEW Bytes:
5
USB Interrupt!!&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCU receives interrupts for every chunk, so seems that the linux driver is sending the data in chunks.&lt;/P&gt;&lt;P&gt;I tried to write to the port using binary mode:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fopen("/dev/ttyACMX", "wb")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the data was chunked anyway.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Wireshark confirmed that the data is sent from my linux machine in chunks.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 10:38:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321838#M46141</guid>
      <dc:creator>embedded_eng_</dc:creator>
      <dc:date>2021-08-11T10:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: CDC transfer is received in many events USB High Speed</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321857#M46142</link>
      <description>&lt;P&gt;I think this is because tty devices are 'cooked' (internally buffered until CR/LF) - as you would expect to see on a terminal. You need to open the raw device. Take a look at this&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/58404561/how-to-open-a-tty-device-in-noncanonical-mode-on-linux-using-net-core" target="_blank"&gt;https://stackoverflow.com/questions/58404561/how-to-open-a-tty-device-in-noncanonical-mode-on-linux-using-net-core&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 10:52:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CDC-transfer-is-received-in-many-events-USB-High-Speed/m-p/1321857#M46142</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-08-11T10:52:32Z</dc:date>
    </item>
  </channel>
</rss>

