2009-09-25 15:54:14     USB device doesn't reconnect after reboot like it does after cycling power

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-09-25 15:54:14     USB device doesn't reconnect after reboot like it does after cycling power

Steve Strobel (UNITED STATES)

Message: 80459   

 

I am working with a USB device (cell phone) which connects and works great each time our BF537 board with an ISP1362 USB interface is powered up.  If, however, we just type "reboot" rather than cycling power, it isn't recognized when uClinux restarts (it doesn't show up in /proc/bus/usb/devices).  If a USB flash drive is connected instead, it shows up and works regardless of whether power is cycled or we just type reboot.

 

After rebooting, the only ways I have found to get the phone to register as a USB device again are to cycle power to the Blackfin board, push the power button on the phone, or unplug the USB cable and plug it back in.  I think that the phone might register only once unless it detects a loss of power on its USB connector, as it beeps when I plug or unplug the charger (which plugs into the USB connector) in the same way it does when the power to the Blackfin board is turned off, and as the Blackfin board is powered up (about the time it prints the MOTD).  It does not beep at any time when I just reboot uClinux.

 

Can anyone suggest how I might get the phone to re-register as a USB device?  Is there a way to force the USB interface to turn off the power (maybe faking an over-current condition)?  Thanks for any suggestions.

 

Steve

QuoteReplyEditDelete

 

 

2009-09-29 14:27:41     Re: USB device doesn't reconnect after reboot like it does after cycling power

Steve Strobel (UNITED STATES)

Message: 80646   

 

I figured I should follow up for the sake of anyone finding this thread later. I tried enabling CONFIG_USB_SUSPEND; it caused lots of error messages and kept things from working even after cycling power (I am using uClinux-dist-2008R1.5-RC3, so those problems might be fixed in a newer version).  Rather than fight with that complicated system or update right now, I took a look at the driver.

 

isp1362_hc_reset() turns the power to the USB host connector off and isp1362_hc_start() turns it back on.  It normally blinks the power off for a fraction of a second, which usually causes the phone to beep once.  I added a call to msleep() at the end of isp1362_hc_reset() to delay isp1362_hc_start() getting called, which forces the power to stay off longer.  About 200mS of delay seems to do the trick in my case.  The phone beeps twice (once for the power going off, again for it coming back on) and everything else works.

QuoteReplyEditDelete

 

 

2009-09-29 16:55:19     Re: USB device doesn't reconnect after reboot like it does after cycling power

Mike Frysinger (UNITED STATES)

Message: 80656   

 

i wonder if this is goverened by any of the USB spec, or this is an undefined grey area where things "just work" so people never look into it.  i.e. what is the correct fix to push to mainline ...

QuoteReplyEditDelete

 

 

2009-09-30 11:32:12     Re: USB device doesn't reconnect after reboot like it does after cycling power

Robin Getz (UNITED STATES)

Message: 80717   

 

Steve:

 

Sounds like the phone is going into brown-out, and isn't resetting properly...

 

It might be intersesting to have a look with a scope - does the power actually go all the way down to zero?

 

It could be that the host is reset, but the pheripheral is not - causing problems.

 

-Robin

QuoteReplyEditDelete

 

 

2009-09-30 16:42:18     Re: USB device doesn't reconnect after reboot like it does after cycling power

Steve Strobel (UNITED STATES)

Message: 80727   

 

I don't have any idea if the USB spec covers this or not.  The phone I tested with is a strange device in that you can communicate with it via USB whether it is turned on or off.  I think what that really means is that when it is turned off but there is power supplied by the USB host that it at least partially powers up (it displays a battery charging message dimly on the screen and will respond to a toggle-power command sent to it via USB).  It doesn't run constantly while there is USB power, though.  When you toggle the power to the phone, the USB disconnects and reconnects a couple of times as it powers up or down.

 

I certainly wouldn't push my "fix" to mainline as I think it delays the boot process while it is sleeping.  I can tolerate the extra 300mS, but I am sure others would prefer that a different method be used to delay before turning the USB power back on.

QuoteReplyEditDelete

 

 

2009-09-30 16:56:16     Re: USB device doesn't reconnect after reboot like it does after cycling power

Steve Strobel (UNITED STATES)

Message: 80728   

 

I didn't check that the voltage went all the way to zero, but the LED I connected across the USB power pins went out even without the extra delay I added.  When testing different delay lengths I found that when turning the USB power off for 200mS or longer the phone always beeped twice and always reconnected.  I settled on 300mS to leave some margin.

 

When leaving the USB power off for only 100mS extra, the phone would beep only once about half of the time, and generally wouldn't reconnect in those cases.  That fact that it beeped at all suggests to me that it recognized either the loss or restoration of power but not both (although you would think it could figure that out).

 

I wondered if this could be addressed in such a way that it would add delay only if a phone with this problem was connected, such as with a USB_QUIRK_... but I can' t see how that would work when the problem prevents us from being able to tell that the phone is connected.

Attachments

    Outcomes