<?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>Kinetis MicrocontrollersのトピックUSD endpoint busy forever</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USD-endpoint-busy-forever/m-p/826431#M49918</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 implemented custom USB class with two interrupt and one bulk endpoint. I used&amp;nbsp;usb_device_cdc_acm.c from SDK 2.1 as a template. USB device is full speed on MK22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes the bulk endpoint freezes in busy state. On PC side reading from the bulk endpoint timeouts then (libusb_bulk_transfer used on PC side) even though on MCU side I can see the endpoint is in busy state transferring data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure&amp;nbsp;s_UsbDeviceKhciState has tranferLength = 0x28a, transferDone = 0 and state = 0x6040 forever. I have to reset MCU to reenable data transfers on my bulk endpoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me diagnose the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: It seems that the issue is caused by switching from HSRUN to RUN mode with USB module enabled. My CPU have to run with 120 MHz, but sometimes I need to write internal flash memory, which is not possible from HSRUN mode so I have to switch to RUN. When I don't switch from HSRUN to RUN and I disable writing to flash then this issue with frozen bulk endpoint doesn't happen, at least it seems to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jun 2018 21:52:25 GMT</pubDate>
    <dc:creator>martindusek</dc:creator>
    <dc:date>2018-06-27T21:52:25Z</dc:date>
    <item>
      <title>USD endpoint busy forever</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USD-endpoint-busy-forever/m-p/826431#M49918</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 implemented custom USB class with two interrupt and one bulk endpoint. I used&amp;nbsp;usb_device_cdc_acm.c from SDK 2.1 as a template. USB device is full speed on MK22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes the bulk endpoint freezes in busy state. On PC side reading from the bulk endpoint timeouts then (libusb_bulk_transfer used on PC side) even though on MCU side I can see the endpoint is in busy state transferring data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure&amp;nbsp;s_UsbDeviceKhciState has tranferLength = 0x28a, transferDone = 0 and state = 0x6040 forever. I have to reset MCU to reenable data transfers on my bulk endpoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me diagnose the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: It seems that the issue is caused by switching from HSRUN to RUN mode with USB module enabled. My CPU have to run with 120 MHz, but sometimes I need to write internal flash memory, which is not possible from HSRUN mode so I have to switch to RUN. When I don't switch from HSRUN to RUN and I disable writing to flash then this issue with frozen bulk endpoint doesn't happen, at least it seems to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2018 21:52:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USD-endpoint-busy-forever/m-p/826431#M49918</guid>
      <dc:creator>martindusek</dc:creator>
      <dc:date>2018-06-27T21:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: USD endpoint busy forever</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USD-endpoint-busy-forever/m-p/826432#M49919</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 let us know the K22 product part number?&lt;/P&gt;&lt;P&gt;There with some different version of K22 product, please check &lt;A href="https://www.nxp.com/docs/en/engineering-bulletin/EB811.pdf"&gt;here&lt;/A&gt; for the detailed info.&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>Mon, 02 Jul 2018 06:45:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USD-endpoint-busy-forever/m-p/826432#M49919</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-07-02T06:45:12Z</dc:date>
    </item>
  </channel>
</rss>

