Fix "avrdude: stk500_getsync(): not in sync" on Arduino
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
- avrdude: stk500_recv(): programmer is not responding
- avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1c
- avrdude: stk500_getsync(): not in sync: resp=0x00
- avrdude: stk500v2_ReceiveMessage(): timeout
- Failed uploading: uploading error: exit status 1
avrdude cannot talk to the board's bootloader, so the upload fails before anything is written. Most of the time, selecting the right board and port, choosing "ATmega328P (Old Bootloader)" for a Nano clone, or disconnecting whatever is wired to pins 0 and 1 fixes it.
What this error means
To upload a sketch, the IDE runs avrdude, which opens the serial port, resets the board (DTR signal) and sends STK500 commands to the bootloader during the short window when it listens after a reset. If no valid reply arrives, avrdude retries ten times and gives up. resp=0x00 means it only received a null byte or nothing usable. So the problem is not your code: it is the communication between the PC and the bootloader (wrong port, wrong speed, no reset, busy serial pins or missing bootloader).
Common causes
- Wrong board or port: the IDE sends data to another COM or
/dev/tty*port, or at the speed meant for another board. - Nano clone with the old bootloader: many CH340-based Nanos use the old bootloader at 57600 baud, while the IDE talks at 115200 baud by default.
- Pins 0 (RX) and 1 (TX) in use: a Bluetooth or GPS module, a shield or a wire on these pins disturbs the serial link used for uploading.
- Cable, driver or busy port: charge-only USB cable, missing CH340 driver, or Serial Monitor open in another program.
- Missing or damaged bootloader: a new ATmega chip sold without a bootloader, or a bootloader overwritten by a programmer upload.
Step-by-step fix
-
Check the board and port
In the IDE, check "Tools > Board" and "Tools > Port". Unplug the board: the port that disappears from the list is the right one. With arduino-cli, list the detected boards and upload with an explicit port.
arduino-cli board list arduino-cli compile --fqbn arduino:avr:uno MySketch # Linux: /dev/ttyACM0 or /dev/ttyUSB0, macOS: /dev/cu.usbmodem*, Windows: COM3... arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:uno MySketch -
Try the old bootloader (Nano)
For an Arduino Nano, choose "Tools > Processor > ATmega328P (Old Bootloader)" and upload again. If it still fails, switch back to "ATmega328P": some recent boards have the new bootloader.
arduino-cli upload -p /dev/ttyUSB0 --fqbn arduino:avr:nano:cpu=atmega328old MySketch -
Free pins 0 and 1 and the port
Disconnect everything wired to RX/TX (pins 0 and 1) and remove shields. Close the Serial Monitor, other IDEs and any program reading the port (screen, Processing, Python scripts).
-
Change the cable and check the driver
Use a USB data cable known to work, plugged directly into the PC. On Windows, if the board shows up as "USB2.0-Serial" with a yellow triangle in Device Manager, install the CH340 driver from the manufacturer WCH.
-
Try a manual reset
If the automatic reset does not work, hold the RESET button, click Upload, and release the button as soon as the IDE shows "Uploading...". Also enable "File > Preferences > Show verbose output during: upload" to see where it stops.
-
Burn the bootloader again
If nothing works, the bootloader may be missing. With a second board: upload the ArduinoISP example to it, wire D10 to RESET and D11, D12, D13 to the same pins on the target board, then choose "Tools > Programmer > Arduino as ISP" and "Tools > Burn Bootloader".
Did this fix work for you?
Confirm it in one click: it will rise for the next developers stuck on the same error.
Keep it from coming back
- Avoid wiring modules to pins 0 and 1: use
SoftwareSerialon other pins, or a board with a second hardware serial port (Mega, Leonardo). - Label your USB data cables and note the working settings for each board (board, processor, bootloader).
- Always close the Serial Monitor in other tools before uploading.
Frequently asked questions
What does resp=0x00 mean in avrdude?
avrdude only received a null byte or nothing valid from the bootloader. It means the bootloader is not answering: wrong port, wrong speed, no reset or disturbed serial pins.
Is my Arduino dead if I get "not in sync"?
Rarely. If the L LED blinks briefly when you press RESET, the bootloader is usually alive and the problem is the configuration, the cable or the driver.
How do I upload without a bootloader?
Use an ISP programmer (USBasp or another board as "Arduino as ISP") and "Sketch > Upload Using Programmer". This erases the bootloader, which you must burn again to go back to USB uploads.
Useful tools for this error
More Electronics & Arduino errors
- Fix "Failed to connect to ESP32" (Wrong boot mode, No serial data received)
- Fix "Brownout detector was triggered" on ESP32
- Fix "can't open device /dev/ttyUSB0: Permission denied" (Arduino, ESP32)
- Fix "Guru Meditation Error: Core 1 panic'ed (LoadProhibited)" on ESP32
- Fix "error: 'x' was not declared in this scope" (Arduino, C++)
- Fix "Sketch too big" on Arduino and ESP32 (flash memory full)
- Fix "OSError: [Errno 121] Remote I/O error" with I2C on Raspberry Pi