avrdude: stk500_getsync(): not in sync: resp=0x00

Hey all
I have been trying to load code onto a Arduino MEGA 2560 using the command line rather than the ino. I keep getting the error message "avrdude: stk500_getsync(): not in sync: resp=0x00". I have seen this error message on the forums quite frequently and nothing I seem to try works. I attached a picture of the error also.

  • I have tried unplugging and plugging the USB.
  • I have tried a new board
  • I have made sure that I have the right syntax for selecting the board
  • I have checked the COM port on the devices manager (even after changing boards)
  • I have tried hitting the reset button at the correct time
  • I have tired loading different exampls
  • I have tried different baud rates

If I try to lead the examples through the Arduino IDE then everything works perfectly. Not sure really what else to try. I just wanted to be able to program the Arduino from the command line using the binary file. Also, does the compiler produce a binary file that can be located? or is there a temp folder that the binary file is loaded into once compiled?

Thanks!

Not sure really what else to try.

You could try to posting the text in the window, rather than a picture of it.

Also, does the compiler produce a binary file that can be located?

Of course it does, and it is the full path to that hex file the you should be specifying.

Use File + Preferences and enable verbose mode for compiling and linking to find where the hex file is created.