How to upload firmware to reprap printer? When trying to upload firmware I get the following errors:


timeout - cannot sync, or
port is in use


What can be the possible sources of these errors?
There are mainly three reasons for that:


Arduino studio settings should be: 


Board: Mega 2560 and
Programmer: AVR ISP 
and valid COM port, please see below:






Please close all slicer's instances (Cura, Slic3r, Repetiter)  and host servers and other software that communicate with the printer as they lock the COM port;
Please check that the appropriate usb2serial drivers are installed and working - the best way is to start the serial monitor from the Arduino Studio Tools menu and see if there are any.