Upload fails only when a part is connected to pins 0 and 1

  • Arduino Uno
  • HC-05 / HC-06
  • 7-segment display

You may see

avrdude: stk500_getsync() attempt 1 of 10: not in sync

Why it happens

  • The board receives new code on pin 0 (RX) and answers on pin 1 (TX).
  • Anything wired there can hold the line high or low.

How to fix it

  1. Unplug the wires on pins 0 and 1.
  2. Upload the code.
  3. Plug the wires back in.
  4. Better: move the part to other pins and change the code (SoftwareSerial for Bluetooth).

It worked if: Upload succeeds with the two wires out, and the project still works after you put them back.

From the official documentation. From Arduino Support (remove connections to pins 0 and 1). Sources: Arduino Support: 'Error: avrdude' when uploading.

Didn't help? Search another error or ask us.