<?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: [MQX4.1]: Can USB Device Stack Sense a USB Soft-detach in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503871#M16187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hui,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USB_APP_ERROR event is received when an error occurs in any of the USB state machine's states, so probably, when device was in middle of a transaction, you could get the USB_APP_ERROR event (because this transaction wasn't finished) and in other cases, no transactions were taking place when detachment occurred and that is why you didn't received the event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the only way to detect this event (detachment) will be monitoring the VBUS voltage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for all inconvenience it may cause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jan 2016 21:15:18 GMT</pubDate>
    <dc:creator>isaacavila</dc:creator>
    <dc:date>2016-01-21T21:15:18Z</dc:date>
    <item>
      <title>[MQX4.1]: Can USB Device Stack Sense a USB Soft-detach</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503868#M16184</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;My device is a self-powered CDC device and I want it to have capability of sensing a soft-detach. It is required to have USB interface physically connected. Due to power constraints, the USB host can only start enumerating or detaching device by closing/opening switch on D+/D- periodically. The host has full control over attachment and detachment by receiving attach event and detach event from USB host stack. I want to have similar notification from USB device side. Now my question is, is there similar attach event and detach event sent out from USB device stack due to opening/closing of D+/D-?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hui&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 06:49:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503868#M16184</guid>
      <dc:creator>huishao2</dc:creator>
      <dc:date>2016-01-20T06:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: [MQX4.1]: Can USB Device Stack Sense a USB Soft-detach</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503869#M16185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Hui,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, there is no way to detect a Device detachment via software, however, as you are using a self-powered device, you can monitor the 5V voltage from USB connector, this is, if device is connected to a host, the host will provide 5v from that line so you can detect that your device is plugged or unplugged according voltage level on that line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make this, you can configure one GPIO as input and see voltage level on this 5V line (this GPIO should be 5V-tolerant, otherwise, you should add a voltage divider to avoid damage on MCU). This way, if you previously had 5V on this line and suddenly it appears as 0V, it means a detachment event occurred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this can help you!&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Isaac Avila&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:47:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503869#M16185</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-01-21T20:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: [MQX4.1]: Can USB Device Stack Sense a USB Soft-detach</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503870#M16186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the USB connector is required to be connected consistently in this special case. So I have no way to see changes over Vbus.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My test shows, however, I can receive USB_APP_ERROR from callback upon manually breaking D+/D- after device power cycle. I wish this is helpful to me but this event disappeared after I tried a few times of closing/opening D+/D-.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&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;Hui&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:58:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503870#M16186</guid>
      <dc:creator>huishao2</dc:creator>
      <dc:date>2016-01-21T20:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: [MQX4.1]: Can USB Device Stack Sense a USB Soft-detach</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503871#M16187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hui,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USB_APP_ERROR event is received when an error occurs in any of the USB state machine's states, so probably, when device was in middle of a transaction, you could get the USB_APP_ERROR event (because this transaction wasn't finished) and in other cases, no transactions were taking place when detachment occurred and that is why you didn't received the event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the only way to detect this event (detachment) will be monitoring the VBUS voltage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for all inconvenience it may cause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 21:15:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX4-1-Can-USB-Device-Stack-Sense-a-USB-Soft-detach/m-p/503871#M16187</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-01-21T21:15:18Z</dc:date>
    </item>
  </channel>
</rss>

