Learn what to do if you’re having issues uploading a sketch to your Arduino device.
Try these steps in order
- Check your sketch for errors
- Select the correct board and port
- Check board connection
- Try a bootloader reset if your board supports it
- Check for busy or blocked ports
- Delete corrupted files
- Check the console output
- Board-specific troubleshooting
Check your sketch for errors
Click the Verify button to compile your sketch without uploading it. If you still get an error, see If your sketch doesn’t compile.
Select the correct board and port
Make sure the correct board and port are selected. You can do this using the board selector or the Tools > Board and Tools > Port menus. For detailed instructions, see Select the right port and board. Then, try uploading your sketch again.
Tip
If you’re unsure which port is being used, try disconnecting and reconnecting your board. Then, close and reopen the board selector or the Tools > Port menu to refresh the list.
- If your board does not appear in the list or if the Tools > Port option is disabled, see If your board is not detected by Arduino IDE.
Check board connection
Follow the instructions below to ensure a proper setup. After each step, try uploading your sketch again.
- Disconnect jumper cables: Disconnect jumper cables, shields or other devices from the board’s pins, as they may interfere with upload.
- Reconnect your board: Disconnect and reconnect the board to reset its power. Confirm that the power LED (often labeled “ON”) is lit.
- Use a data USB Cable: Connect your board with a data USB cable, not a charging-only cable.
- Test the USB cable: Confirm the cable is working by testing it with another device or trying a different cable.
- Connect directly: Connect the board directly to your computer instead of through a USB hub.
- Remove unneeded USB devices: Disconnect any unnecessary USB devices that might be using the ports.
- Try a different USB port: If the board is still not detected, try a different USB port on your computer.
Try a bootloader reset if your board supports it
Many Arduino boards have native USB functionality. On these boards, USB communication is handled by the same microcontroller that runs the sketch. This means that the sketch running on the board may interfere with the upload process, for example by causing the board to reset.
You can stop the sketch from running by activing the board’s bootloader.
Note
AVR-based boards like UNO R3, Mega, and the classic Nano have dedicated USB-to-serial chips, which allow sketches to be uploaded regardless of the sketch currently running on the main microcontroller. These boards do not have a bootloader mode.
-
Find the reset button on the board.
-
Press the button two times in quick succession.
-
An on-board LED will fade in and out, indicating that the board is in bootloader mode.
-
Select the correct port for your board from the Tools > Port menu or the board selector, as the port may change when the bootloader runs.
Check for busy or blocked ports
After each step, try uploading your sketch again.
- Ensure only one instance of the Arduino IDE and serial monitor is active, and close other applications that may be using the serial port.
- If the issue persists, restart your computer.
- If you are using Linux, see Fix port access on Linux.
- If none of the above worked, see Find and stop process blocking a port for advanced troubleshooting.
Delete corrupted files
If your board is detected by Arduino IDE but uploads fail, corrupted files might be the cause. To solve this:
- Delete the Arduino15 folder.
- Restart Arduino IDE.
- Reinstall the board package.
- Try uploading your sketch again.
Check the console output
Note
Exit status 1 only indicates that the upload process has failed. Look for the preceding lines in the error output for more specific information about the failure.
Common upload errors often involve dfu-util and avrdude utilities. Learn how to solve:
Board-specific troubleshooting
-
Arduino Nano:
- Ensure the correct processor is selected.
- You might need to install FTDI drivers manually.
-
Boards with the WCH CH340 USB chip: See avrdude: ser_open(): can’t set com-state for COMn.
Still need help?
-
Visit the Installation & Troubleshooting category in the Arduino forum.
Note
Please include this information:
- A verbose error output
- The name of your board
- Your operating system
- Your Arduino IDE version