Arduino: Upload timeout and !!! in a string

If you ever see the following when uploading your sketch to an Arduino board (using the Arduino IDE, PlatformIO or any other):

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
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

Look for !!! (3 exclamation points characters  aka bang) in your code and remove them.

Why ? These 3 exclamation point characters are actually used to tell the Arduino bootloader to switch to 'monitor' mode and when that happens the upload process stops. Simply remove these '!!!' and replace them with something else and your code will compile and upload just fine.

Reference: https://forum.arduino.cc/index.php?topic=83079.120

Comments

Popular Posts