<?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>LPC MicrocontrollersのトピックRe: How determine end of USB bulkOut transfer</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-determine-end-of-USB-bulkOut-transfer/m-p/808029#M32439</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;To provide the fastest possible support, I'd highly recommend you to refer to the USB CDC demos in LPCOpen library (&lt;A class="link-titled" href="https://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_ea_devkit_1788.zip" title="https://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_ea_devkit_1788.zip"&gt;https://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_ea_devkit_1788.zip &lt;/A&gt;) for details.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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>Fri, 13 Jul 2018 02:26:02 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2018-07-13T02:26:02Z</dc:date>
    <item>
      <title>How determine end of USB bulkOut transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-determine-end-of-USB-bulkOut-transfer/m-p/808028#M32438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have programmed a custom USB interface for a LPC1778. To send and receive data I used bulk transfer. Actually, everything works fine, but I have problems when receiving data packets &amp;gt; USB_FS_MAX_BULK_PACKET (= 64) bytes. A complete message can then consist of several 64 byte USB data packets. My problem is, that I do not know when the complete USB message was received and can be processed. &lt;SPAN class="" lang="en"&gt;&lt;SPAN class=""&gt;In most cases, the length of the last data packet will be != 64 bytes and the data can be concatenated until then&lt;/SPAN&gt;&lt;/SPAN&gt;. But this works only as long as the whole package is not a multiple of 64.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idee?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* USB bulk EP_OUT endpoint handler */&lt;BR /&gt;ErrorCode_t lusb_BulkOUT_Hdlr(USBD_HANDLE_T hUsb, void *data, uint32_t event)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* We received a transfer from the USB host. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;switch (event)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;case USB_EVT_OUT:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;usb_rx_length = USBD_API-&amp;gt;hw-&amp;gt;ReadEP(hUsb, LUSB_OUT_EP, usb_rx_buffer + usb_rx_byte_counter);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (usb_rx_length &amp;lt; USB_FS_MAX_BULK_PACKET){&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; // only works if total packet size is not nultiple of 64!&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;usb_rx_bulk_out_ready = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;usb_rx_byte_counter += usb_rx_length;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;usb_rx_bulk_counter++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;case USB_EVT_OUT_NAK:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break;&lt;BR /&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;return LPC_OK;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 09:35:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-determine-end-of-USB-bulkOut-transfer/m-p/808028#M32438</guid>
      <dc:creator>simonepuschmann</dc:creator>
      <dc:date>2018-07-12T09:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: How determine end of USB bulkOut transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-determine-end-of-USB-bulkOut-transfer/m-p/808029#M32439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;To provide the fastest possible support, I'd highly recommend you to refer to the USB CDC demos in LPCOpen library (&lt;A class="link-titled" href="https://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_ea_devkit_1788.zip" title="https://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_ea_devkit_1788.zip"&gt;https://www.nxp.com/downloads/en/software/lpcopen_2_10_keil_iar_ea_devkit_1788.zip &lt;/A&gt;) for details.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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>Fri, 13 Jul 2018 02:26:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-determine-end-of-USB-bulkOut-transfer/m-p/808029#M32439</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-07-13T02:26:02Z</dc:date>
    </item>
  </channel>
</rss>

