Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Aug 2016 09:46 AM by  Adam Ford
USB tries to enumerate after a device is unplugged
 13 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Derek Valleroy
New Member
New Member
Posts:26


--
05 Aug 2016 09:31 AM

    Hello,
    We are using the Torpedo as a USB host, and sometimes when we disconnect our High Speed USB HID device from it, we see odd behavior from the kernel.

    After a disconnect, we immediately see a low-speed device try to enumerate (and fail), followed up by a few more high speed enumeration events (that fail) that occur every 15 seconds. I don't see any USB traffic when these messages occur (verified with an o-scope and logic analyzer). After this, the host will not even try to enumerate our HID device when we plug it back in.

    Has anyone else experienced this? Any luck alleviating it?

    FYI, here are our kernel messages:

    Aug  2 18:15:16 DM-37x user.info kernel: [ 1216.669097] usb 1-1: USB disconnect, device number 43  // <- This is when we unplug our HID
    Aug  2 18:15:16 DM-37x user.info kernel: [ 1217.046112] usb 1-1: new low speed USB device number 44 using musb-hdrc
    Aug  2 18:15:31 DM-37x user.info kernel: [ 1232.296264] usb 1-1: new high speed USB device number 45 using musb-hdrc
    Aug  2 18:15:46 DM-37x user.err kernel: [ 1247.429077] usb 1-1: device descriptor read/64, error -110
    Aug  2 18:16:02 DM-37x user.err kernel: [ 1262.663482] usb 1-1: device descriptor read/64, error -110
    Aug  2 18:16:02 DM-37x user.info kernel: [ 1262.898040] usb 1-1: new high speed USB device number 46 using musb-hdrc
    Aug  2 18:16:12 DM-37x user.err kernel: [ 1273.327362] usb 1-1: device not accepting address 46, error -110
    Aug  2 18:16:12 DM-37x user.info kernel: [ 1273.460906] usb 1-1: new high speed USB device number 47 using musb-hdrc
    [ 1283.896667] hub 1-0:1.0: unable to enumerate USB device on port 1

     
    Regards,
    Derek

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    05 Aug 2016 10:05 AM

    It appears as if you're using the OTG driver, and it has some current limits. Sometimes connecting it to a powered hub helps when there is a sudden inrush of current.

    You also might want to observe the USB voltage on your scope when you observe this behavior.

    Can you try connecting your HID device to a powered hub and connecting that to the USB and see if the problem persists?

    adam
    Derek Valleroy
    New Member
    New Member
    Posts:26


    --
    05 Aug 2016 10:51 AM

    Okay, thanks!

    I'm curious, do you know how the inrush of current is detected?

    Also, is there anything in particular to look for with the voltages?

     -Derek

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    05 Aug 2016 11:04 AM
    USB1_VBUS is driven by the TPS65950 and can only supply 100 mA of current on VBUS per the design checklist. If the current inrush is too high the voltage may dip or drop causing instability on the USB bus. If you see this on the scope it may be an indication of too much current being drawn into the peripheral from the PMIC.

    The checklist also suggests A 4.7 uF capacitor must connect J2.11 and J2.13 (USB1_VBUS) to ground to help.

    The checklist is on our support site:

    http://support.logicpd.co...rtalid=0&EntryId=586 in section 2.1.1

    adam
    Derek Valleroy
    New Member
    New Member
    Posts:26


    --
    09 Aug 2016 09:18 AM

    I see, thanks. We actually have an external supply for Vbus, so we're not using the SOM Vbus. We do have the 10uF capacitor connected to ground on the SOM Vbus.

    On my scope I can see the SOM Vbus drop to ground (and stay there) when this failure happens. I'm guessing this indicates over-current. This really confuses me thought, because the PMIC isn't supplying current, so I don't understand why the Vbus would turn off. Do you know if there is something else that can cause this kind of behavior? Maybe the PMIC also monitors D+/D- for some over-current indication?

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    09 Aug 2016 12:35 PM
    Are you only using host mode or are you using the OTG port to also be a device?

    adam
    Derek Valleroy
    New Member
    New Member
    Posts:26


    --
    09 Aug 2016 12:56 PM
    We're only using host mode.
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    09 Aug 2016 12:58 PM
    You could try to tie the ID pin to ground and see if that stabilizes the issue. It could be ESD/debouncing of the ID pin that may cause the driver to not think it's in host mode.

    If that doesn't work, can you post a full dump of the kernel logs (dmesg)?

    adam
    Derek Valleroy
    New Member
    New Member
    Posts:26


    --
    09 Aug 2016 03:58 PM

    We have the ID pin tied to ground through a 1.5k resistor, but thanks.

    Here is the kernel log. I removed messages coming from our application.

    [ 1216.669097] usb 1-1: USB disconnect, device number 43
    [ 1217.046112] usb 1-1: new low speed USB device number 44 using musb-hdrc
    Aug  2 18:15:16 DM-37x user.info kernel: [ 1216.669097] usb 1-1: USB disconnect, device number 43
    Aug  2 18:15:16 DM-37x user.info kernel: [ 1217.046112] usb 1-1: new low speed USB device number 44 using musb-hdrc
    [ 1232.296264] usb 1-1: new high speed USB device number 45 using musb-hdrc
    Aug  2 18:15:31 DM-37x user.info kernel: [ 1232.296264] usb 1-1: new high speed USB device number 45 using musb-hdrc
    [ 1247.429077] usb 1-1: device descriptor read/64, error -110
    Aug  2 18:15:46 DM-37x user.err kernel: [ 1247.429077] usb 1-1: device descriptor read/64, error -110
    [ 1262.663482] usb 1-1: device descriptor read/64, error -110
    Aug  2 18:16:02 DM-37x user.err kernel: [ 1262.663482] usb 1-1: device descriptor read/64, error -110
    [ 1262.898040] usb 1-1: new high speed USB device number 46 using musb-hdrc
    Aug  2 18:16:02 DM-37x user.info kernel: [ 1262.898040] usb 1-1: new high speed USB device number 46 using musb-hdrc
    [ 1273.327362] usb 1-1: device not accepting address 46, error -110
    Aug  2 18:16:12 DM-37x user.err kernel: [ 1273.327362] usb 1-1: device not accepting address 46, error -110
    [ 1273.460906] usb 1-1: new high speed USB device number 47 using musb-hdrc
    Aug  2 18:16:12 DM-37x user.info kernel: [ 1273.460906] usb 1-1: new high speed USB device number 47 using musb-hdrc
    [ 1283.889923] usb 1-1: device not accepting address 47, error -110
    [ 1283.896667] hub 1-0:1.0: unable to enumerate USB device on port 1

    *Note: at this point our code resets the root hub, and re-applies power to our device. I'm not sure if there is a delay between the code executing and these messages being printed.

    [ 1284.265167] usb 1-1: new high speed USB device number 48 using musb-hdrc
    [ 1284.399322] usb 1-1: device descriptor read/64, error -19
    [ 1284.632324] usb 1-1: device descriptor read/64, error -19
    [ 1284.866729] usb 1-1: new high speed USB device number 49 using musb-hdrc
    Aug  2 18:16:23 DM-37x user.err kernel: [ 1283.889923] usb 1-1: device not accepting address 47, error -110
    Aug  2 18:16:23 DM-37x user.err kernel: [ 1283.896667] hub 1-0:1.0: unable to enumerate USB device on port 1
    Aug  2 18:16:23 DM-37x user.info bp_mat[876]: Info: LibUsbAcquisitionDevice::dnit Msg: Root hub reset
    Aug  2 18:16:23 DM-37x user.info kernel: [ 1284.265167] usb 1-1: new high speed USB device number 48 using musb-hdrc
    Aug  2 18:16:23 DM-37x user.err kernel: [ 1284.399322] usb 1-1: device descriptor read/64, error -19
    Aug  2 18:16:24 DM-37x user.err kernel: [ 1284.632324] usb 1-1: device descriptor read/64, error -19
    Aug  2 18:16:24 DM-37x user.info kernel: [ 1284.866729] usb 1-1: new high speed USB device number 49 using musb-hdrc
    [ 1285.078125] usb 1-1: device descriptor read/64, error -19
    [ 1285.311950] usb 1-1: device descriptor read/64, error -19
    [ 1285.546417] usb 1-1: new high speed USB device number 50 using musb-hdrc
    [ 1285.975952] usb 1-1: device not accepting address 50, error -19
    [ 1286.100952] usb 1-1: new high speed USB device number 51 using musb-hdrc
    Aug  2 18:16:24 DM-37x user.err kernel: [ 1285.078125] usb 1-1: device descriptor read/64, error -19
    Aug  2 18:16:24 DM-37x user.err kernel: [ 1285.311950] usb 1-1: device descriptor read/64, error -19
    Aug  2 18:16:24 DM-37x user.info kernel: [ 1285.546417] usb 1-1: new high speed USB device number 50 using musb-hdrc
    Aug  2 18:16:25 DM-37x user.err kernel: [ 1285.975952] usb 1-1: device not accepting address 50, error -19
    Aug  2 18:16:25 DM-37x user.info kernel: [ 1286.100952] usb 1-1: new high speed USB device number 51 using musb-hdrc
    [ 1286.530639] usb 1-1: device not accepting address 51, error -19
    [ 1286.540954] hub 1-0:1.0: unable to enumerate USB device on port 1
    Aug  2 18:16:25 DM-37x user.err kernel: [ 1286.530639] usb 1-1: device not accepting address 51, error -19
    Aug  2 18:16:25 DM-37x user.err kernel: [ 1286.540954] hub 1-0:1.0: unable to enumerate USB device on port 1

    Derek Valleroy
    New Member
    New Member
    Posts:26


    --
    10 Aug 2016 09:46 AM
    One more thing... This issue is pretty rare to reproduce, so I've been experimenting with forcing it by pulling the D- line high (to mimic the odd low-speed device detection message). I can reliably reproduce it by pulling D- high, and then pulling both D- and D+ high, which I believe is an illegal Single Ended 1 (SE1) USB state.

    I'm wondering if maybe the USB driver will shutdown the PMIC when it detects an SE1? Perhaps our rare failure is caused by an SE1 when the data lines are being disconnected?
    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    10 Aug 2016 09:58 AM
    I am going to e-mail you a patch for use in host-only. You'll see an e-mail from from our support system, and sometimes they end up in the spam filters, so if you don't get something in the next couple hours, please check your spam filter.
    I will e-mail it to the address on file based on your account.

    adam
    Derek Valleroy
    New Member
    New Member
    Posts:26


    --
    10 Aug 2016 11:01 AM
    Awesome, thanks, I'll give it a shot. I see it in my email.
    Derek Valleroy
    New Member
    New Member
    Posts:26


    --
    10 Aug 2016 04:42 PM

    Unfortunately, I still see the same issue.

    The behavior does seem to be a little different. If I force the failure by pulling up D- and D+, I still see a -110 error. However, the Vbus voltage stays high. If I then wait for the failures to stop being reported (~1 minute after I remove the pull-ups), the Vbus is still high. Then if I plug in my device, the Vbus voltage immediately goes low, and I don't get enumeration with my device. This is different because before, the Vbus voltage would go low at the first -110 error.

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:794


    --
    11 Aug 2016 09:46 AM
    Let's take this offline. I'm going to send you a private e-mail.

    adam
    You are not authorized to post a reply.