Random upload failures

Hey all
I am having random upload fails with my Mega2560.
I will be programming away fine, tweaking code and uploading to my project and then all of a sudden...

avrdude: stk500v2_getsync(): timeout communicating with programmer

Nothing uploads. I mess around for an hour, changing USB ports, fiddling with drivers, rebooting the laptop half a dozen times etc.... nothing.
Then next day, I fire up the laptop and it connects first time.

Runs a few hours, and then all of a sudden... its back to comms issues.

Windows isn't updating or anything. I am stumped as to what changes to suddenly stop the code uploading.

Any ideas?

Windows is turning off the USB port?
Check settings in Power Management.

Well I thought something like that, but a laptop reboot is going to reset that.
Plus, the mouse would stop working wouldn't it?

Yesterday I messed about for nearly two hours trying to find the problem. Rebooted half a dozen times etc.
Finally came to the conclusion that the Mega was dead, so left it for the night.

Plan for this morning - rip out the Mega and install a new one.

But, just before I do.... I will try one more time. Connected straight away and worked for 3 hours - multiple uploads.

Then, comms failed again (yes - tried a new USB lead).... now its not working again.

Mad

Steve2018:
a laptop reboot is going to reset that.

Uh no.

Ok. This is something weird on the Mega I think.

I left it alone for an hour. Now it works again.

Something overheating?

A full reboot doesn't reset the USB's turning off (which they are not?). What would reset them then?

I don’t know.
I have never had that sort of problem with any of the Uno clones I have.
Don’t have a Mega.

Make sure you are using a USB 2.0 port all the time see if that helps.

If not then turn off any security you have on the computer for a while and see if that help.

Those are the two most common issues to give the effect you are seeing but by no means all of them.

Another computer to try in case its a local issue ?