avrdude: stk500v2_getsync(): timeout communicating with programmer error
I get this problem sometimes with some of my boards. I usually solve the problem following these steps:


Set the compiler on debug/verbose mode to see what's happening
Launch compilation/upload
When the compile phase is done, and the upload process is about to start, press the reset button on the board


Usually that takes care of the problem.