Sunday, January 2, 2011

New Toshiba Laptop USB Ports Unresponsive After Waking Up From Sleep

I prefer to just shut my laptop when I am finished working on it.  This allows for quick restore time.  However I noticed while working on Windows Phone 7 dev. that I was unable to detect my phone if I did this a lot.  The phone would recharge its battery just fine, but it would not show up as a connected device.

If I rebooted my PC, everything worked fine again.  But that defeats the time savings I was seeing with just doing a Sleep all the time.

I determined the problem could be remedied if I opened my Device Manager and disabled all of my USB devices and then re-enabled them.  This was a little tedious also, having to open a GUI, find my USB devices, and disable them one-by-one.  So, I looked for a more automated solution.

Microsoft has a tool called Devcon that ships with their Windows Driver ToolKit.  This tool allows you to access the devices you see in Device Manager, from a command-line.  Therefore, this is all I needed.  Unfortunately, you can’t just download the .exe; you have to download the whole WDK and dig around to find the tool.

Also, it should be noted that there was a version of Devcon for Windows XP.  Microsoft has that file available for download outside of the WDK.  But, that version did not work on my Windows 7 64-bit OS.  I had to download a newer version.

Obtaining Devcon

Download Windows Driver Kit Version 7.1.0.

Mount the ISO file or extract the files somehow.  Use a tool like Virtual CloneDrive or Universal Extractor.

You can install the WDK.  Or I just found the devcon.exe file inside the following .cab file:  .\WDK\setuptools_x64fre_cab001.cab.  Make sure to open the .cab file that is related to your CPU architecture.  Extract the file _devcon.exe_00000 and rename it to devcon.exe.

Now that you have devcon, these are the steps you’ll have to repeat each time you come out of sleep and have unresponsive USBs.

Resetting Your USB

Open a cmd.exe window as Administrator.

Run devcon listclass usb.  This will give you an idea of what devices you should expect to see restored as USB when you are all finished.

DEVCON-ListClassUSB

Now run devcon disable =usb.  I do this a number of times just to make sure everything got disabled.

DEVCON-DisableUSB

Once everything is disabled, run devcon enable =usb.  I have to do this at least 3 times.  Some devices need to be fully enabled before it will allow me to enable the other devices.  So that is why I run it at least 3 times.

DEVCON-EnableUSB

You’ll know you’re finished when you see as many items enabled as you initially saw when running your first listclass.

I found that I had to have everything unplugged from my USB ports, or I would get “Disable failed” when trying to disable them.  But I much prefer doing that, then having to reboot my laptop.

DEVCON-DisableUSB-Failed

No comments:

Post a Comment