<?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 USB stack and hardware de-initialization in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882721#M1409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been through all of the docs on the SDK's USB stack and I can't find anything useful about the deinit functions or what sequence they should be used in, and I can't find any demos that make use of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to shut down a composite device and reset the SIE, including a bus reset.&amp;nbsp; This is so the device can switch between composite mode and MSD only.&amp;nbsp; I'm moving my code from the v5 beta stack, and the hardware deinit was handled by my own code, but I'm trying to keep this version cleaner and avoid duplication of anything that's already there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's&amp;nbsp;USB_DeviceStop,&amp;nbsp;USB_DeviceDeinit, and&amp;nbsp;USB_DeviceClassDeinit.&amp;nbsp; It's not clear if any of these call each other or if any of them shut down the SIE hardware - presumably&amp;nbsp;USB_DeviceStop, but it doesn't say so explicitly. Can someone tell me what the expected sequence is to shut everything down?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Apr 2019 17:33:52 GMT</pubDate>
    <dc:creator>scottm</dc:creator>
    <dc:date>2019-04-05T17:33:52Z</dc:date>
    <item>
      <title>USB stack and hardware de-initialization</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882721#M1409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been through all of the docs on the SDK's USB stack and I can't find anything useful about the deinit functions or what sequence they should be used in, and I can't find any demos that make use of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to shut down a composite device and reset the SIE, including a bus reset.&amp;nbsp; This is so the device can switch between composite mode and MSD only.&amp;nbsp; I'm moving my code from the v5 beta stack, and the hardware deinit was handled by my own code, but I'm trying to keep this version cleaner and avoid duplication of anything that's already there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's&amp;nbsp;USB_DeviceStop,&amp;nbsp;USB_DeviceDeinit, and&amp;nbsp;USB_DeviceClassDeinit.&amp;nbsp; It's not clear if any of these call each other or if any of them shut down the SIE hardware - presumably&amp;nbsp;USB_DeviceStop, but it doesn't say so explicitly. Can someone tell me what the expected sequence is to shut everything down?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2019 17:33:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882721#M1409</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2019-04-05T17:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: USB stack and hardware de-initialization</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882722#M1410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function you need to call is &lt;STRONG&gt;USB_DeviceStop&lt;/STRONG&gt;, this function disables the device functionality and detach the device from the host.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Referring the other functions, &lt;STRONG&gt;USB_DeviceDeinit&lt;/STRONG&gt; is called inside &lt;STRONG&gt;USB_DeviceClassDeinit&lt;/STRONG&gt;. This will discard all the parameters registered as USB devices. Please keep in mind that this function should be called after &lt;STRONG&gt;USB_DeviceStop&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Felipe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2019 22:39:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882722#M1410</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-04-08T22:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: USB stack and hardware de-initialization</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882723#M1411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The process that's worked for me so far is calling&amp;nbsp;USB_DeviceClassDeinit() followed by setting the&amp;nbsp;USBTRC0_USBRESET bit - and also deleting the USB device task so as to not complicate the restart logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like&amp;nbsp;USB_DeviceStop just clears the DP pull-up bit.&amp;nbsp; Any reason I shouldn't use USBRESET instead to reset the module state?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My concern is for making sure the stack restarts in a consistent way.&amp;nbsp; The default mode is MSD-only since it doesn't prompt for a driver on any modern OS, and the user can select a composite MSD + CDC serial mode when needed.&amp;nbsp; I'm not sure this is a use case foreseen by the API, but it's been working OK so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 18:10:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882723#M1411</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2019-04-10T18:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: USB stack and hardware de-initialization</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882724#M1412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing your implementation. From my perspective you shouldn’t have issues by resetting the module your way. If you have any questions please don’t hesitate to ask me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2019 22:20:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-stack-and-hardware-de-initialization/m-p/882724#M1412</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-04-12T22:20:35Z</dc:date>
    </item>
  </channel>
</rss>

