This problem has been bugging me for ages and I can\'t seem to fix it or fully localize the source of the problem (although at times I can force it by allowing the phone to Stan
Changing the usb port worked out for me, also check if you are using usb hubs for connecting the devices. front usb port and back usb ports also make a difference. preferably use back usb port.