Yesterday I was able to do some prototyping on my Arduino (Mega 2560). Part of the code involves communicating the with computer across the usb serial line and sending and receiving messages from the computer. With my old program, I have no problem - I can communicate across from the computer to the arduino and get the appropraite messages.
However, I am unable to reprogram the board! (and I know that I am using the correct Board, Processor, and Port to program it) Even with a completely blank program :
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
I get the following error messages:
Arduino: 1.8.1 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)
Sketch uses 656 bytes (0%) of program storage space. Maximum is 253952 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes. avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
An error occurred while uploading the sketch
This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
I think I may messed up the bootloader - perhaps I need to reupload the bootloader. But I have no idea how to check what's really wrong.