arduino - avrdude: stk500v2_ReceiveMessage(): timeout

arduino – avrdude: stk500v2_ReceiveMessage(): timeout

arduino – avrdude: stk500v2_ReceiveMessage(): timeout

Another possible reason for this error for the Mega 2560 is if your code has three exclamation marks in a row. Perhaps in a recently added string.

3 bang marks in a row causes the Mega 2560 bootloader to go into Monitor mode from which it can not finish programming.

!!! <— breaks Mega 2560 bootloader.

To fix, unplug the Arduino USB to reset the COM port and then recompile with only two exclamation points or with spaces between or whatever. Then reconnect the Arduino and program as usual.

Yes, this bit me yesterday and today I tracked down the culprit. Here is a link with more information: http://forum.arduino.cc/index.php?topic=132595.0

The error message basically means that the programmer is unable to contact the bootloader on the device; the code youre trying to upload has no bearing on the problem.

What causes this can be numerous and varied, some possible issues:

  1. UART communications
    • Blinking is happening, so hopefully you arent using the wrong port. It might be worth checking again though, sometimes USB COM devices install on strange port numbers.
    • Connect TX to RX (and disconnect them from the AVR if possible) then open a terminal on the COM port, you should see characters echoed if you type them. If you dont, something is wrong up-stream of the chip, it could be the communications chip (I think the Arduino 2560 uses a secondary AVR instead of an FTDI for some reason, so that could be broken, either its software or hardware)
  2. ATmega* bootloader
    • The AVR is not executing the bootloader for some reason. If the programmer is not resetting the micro before attempting to connect, this might be the reason. Try to reset the AVR (press and release the button) while the programmer is attempting to connect. Sometimes software that runs in a tight loop will prevent the bootloader from connecting.
    • Barring that, the fuses might have gotten messed up or the code erased. You would need to reflash the bootloader and proper fuses, again, see the appropriate info page for your device.
  3. Arduino Mega 2560 only: ATmega8U/16U software
    • Might not be working and would need reprogramming. See the Programming section on the info page, you will need the firmware and Atmel-compatible DFU (device firmware update) software on your computer to reflash the target.
  4. Hardware damage to the board, AVR(s), or FTDI chip
    • Youre hosed; need a new chip.

Check this forum post for some more ideas.

arduino – avrdude: stk500v2_ReceiveMessage(): timeout

I got this error because I didnt specify the correct programmer in the avrdude command line. You have to specify -c arduino if you are using an Arduino board.

This example command reads the status of the hfuse:

avrdude -c arduino -P /dev/ttyACM0 -p atmega328p -U hfuse:r:-:h

Related posts on arduino :

Leave a Reply

Your email address will not be published.