<?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 data request cancel in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-data-request-cancel/m-p/843791#M50822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fixed. I called USB_DeviceCancel without specifying endpoint direction on endpointAddress parameter. It is a little confusing that on other USB_DeviceXXX functions one doesn't have to specify the direction, but on&amp;nbsp;&lt;SPAN&gt;USB_DeviceCancel it is needed. I didn't notice that till now...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Correct way is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USB_DeviceCancel(myClassHandle-&amp;gt;handle, &lt;SPAN&gt;myClassHandle&lt;/SPAN&gt;-&amp;gt;bulkIn.ep | (USB_IN &amp;lt;&amp;lt; 7U));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Dec 2018 12:24:38 GMT</pubDate>
    <dc:creator>martindusek</dc:creator>
    <dc:date>2018-12-07T12:24:38Z</dc:date>
    <item>
      <title>USB data request cancel</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-data-request-cancel/m-p/843789#M50820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I use this function to send data from my USB device to host PC on BULK IN endpoint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;usb_status_t USB_DeviceSendRequest(usb_device_handle handle, uint8_t endpointAddress, uint8_t *buffer, uint32_t length)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Host PC app reads data using libusb. The app can be suddenly switched off with data send request pending. When the app is launched again, it sends command to my USB device to cancel any pending requests (the app doesn't want to receive any old data, as they are invalid). So, my USB device calls:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;usb_status_t USB_DeviceCancel(usb_device_handle handle, uint8_t endpointAddress)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on that BULK IN endpoint. It returns success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I start to send data on my BULK IN endpoint again, I can see that my app receives also old data from that cancelled request. I assume there is something wrong with&amp;nbsp;&lt;SPAN&gt;USB_DeviceCancel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to use USB_DeviceCancel to correctly handle my scenario?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2018 22:27:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-data-request-cancel/m-p/843789#M50820</guid>
      <dc:creator>martindusek</dc:creator>
      <dc:date>2018-12-06T22:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: USB data request cancel</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-data-request-cancel/m-p/843790#M50821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you provided the chip part number and MCUXpresso SDK version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you share your experience about how to regenerate this issue?&lt;/P&gt;&lt;P&gt;We want to do a test locally. Thank you.&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>Fri, 07 Dec 2018 04:46:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-data-request-cancel/m-p/843790#M50821</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-12-07T04:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: USB data request cancel</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-data-request-cancel/m-p/843791#M50822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fixed. I called USB_DeviceCancel without specifying endpoint direction on endpointAddress parameter. It is a little confusing that on other USB_DeviceXXX functions one doesn't have to specify the direction, but on&amp;nbsp;&lt;SPAN&gt;USB_DeviceCancel it is needed. I didn't notice that till now...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Correct way is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USB_DeviceCancel(myClassHandle-&amp;gt;handle, &lt;SPAN&gt;myClassHandle&lt;/SPAN&gt;-&amp;gt;bulkIn.ep | (USB_IN &amp;lt;&amp;lt; 7U));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2018 12:24:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-data-request-cancel/m-p/843791#M50822</guid>
      <dc:creator>martindusek</dc:creator>
      <dc:date>2018-12-07T12:24:38Z</dc:date>
    </item>
  </channel>
</rss>

