Skip to content

Commit 368ec3a

Browse files
Merge pull request #456 from arduino/errors-when-uploading
Updated article for troubleshooting uploads [HC-1544]
2 parents 32a4926 + 0b39bcf commit 368ec3a

File tree

2 files changed

+134
-172
lines changed

2 files changed

+134
-172
lines changed

Diff for: content/Software Support/Upload/Errors-when-uploading-a-sketch.md

-172
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: "If your sketch doesn't upload"
3+
id: 4403365313810
4+
---
5+
6+
Learn what to do if you’re having issues uploading a sketch to your Arduino device.
7+
8+
---
9+
10+
## Try these steps in order {#top}
11+
12+
1. [Check your sketch for errors](#check-sketch-for-errors)
13+
2. [Select the correct board and port](#select-the-correct-board-and-port)
14+
3. [Check board connection](#check-board-connection)
15+
4. [Try a bootloader reset if your board supports it](#bootloader-reset)
16+
5. [Check for busy or blocked ports](#busy-port)
17+
6. [Delete corrupted files](#delete-corrupted-files)
18+
7. [Check the console output](#check-the-console-output)
19+
8. [Board-specific troubleshooting](#board-specific-troubleshooting)
20+
21+
### Check your sketch for errors {#check-sketch-for-errors}
22+
23+
Click the ![Verify button](img/symbol_verify2.png) **Verify** button to compile your sketch without uploading it. If you still get an error, see [If your sketch doesn't compile](https://support.arduino.cc/hc/en-us/articles/4402764401554-Compilation-errors-when-uploading).
24+
25+
[Back to top](#top)
26+
27+
### Select the correct board and port {#select-the-correct-board-and-port}
28+
29+
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](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port). Then, try uploading your sketch again.
30+
31+
> [!TIP]
32+
> 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.
33+
34+
* 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](https://support.arduino.cc/hc/en-us/articles/4412955149586-If-your-board-is-not-detected-by-Arduino-IDE).
35+
36+
[Back to top](#top)
37+
38+
### Check board connection {#check-board-connection}
39+
40+
Follow the instructions below to ensure a proper setup. After each step, try uploading your sketch again.
41+
42+
1. *Disconnect jumper cables*: Disconnect jumper cables, shields or other devices from the board’s pins, as they may interfere with upload.
43+
1. *Reconnect your board*: Disconnect and reconnect the board to reset its power. Confirm that the power LED (often labeled “ON”) is lit.
44+
1. *Use a data USB Cable*: Connect your board with a data USB cable, not a charging-only cable.
45+
1. *Test the USB cable*: Confirm the cable is working by testing it with another device or trying a different cable.
46+
1. *Connect directly*: Connect the board directly to your computer instead of through a USB hub.
47+
1. *Remove unneeded USB devices*: Disconnect any unnecessary USB devices that might be using the ports.
48+
1. *Try a different USB port*: If the board is still not detected, try a different USB port on your computer.
49+
50+
[Back to top](#top)
51+
52+
### Try a bootloader reset if your board supports it {#bootloader-reset}
53+
54+
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.
55+
56+
You can stop the sketch from running by activing the board's **bootloader**.
57+
58+
> [!NOTE]
59+
> 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.
60+
61+
1. Find the reset button on the board.
62+
1. Press the button two times in quick succession.
63+
64+
![The RESET button on Arduino Zero with an "x2" label graphic.](img/zero-reset-button-double.png)
65+
66+
1. An on-board LED will fade in and out, indicating that the board is in bootloader mode.
67+
1. 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.
68+
69+
[Back to top](#top)
70+
71+
### Check for busy or blocked ports {#busy-port}
72+
73+
After each step, try uploading your sketch again.
74+
75+
1. Ensure only one instance of the Arduino IDE and serial monitor is active, and close other applications that may be using the serial port.
76+
1. If the issue persists, restart your computer.
77+
1. If you are using Linux, see [Fix port access on Linux](https://support.arduino.cc/hc/en-us/articles/360016495679-Fix-port-access-on-Linux).
78+
1. If none of the above worked, see [Find and stop process blocking a port](https://support.arduino.cc/hc/en-us/articles/4407830972050-Find-and-stop-process-blocking-a-port) for advanced troubleshooting.
79+
80+
[Back to top](#top)
81+
82+
### Delete corrupted files {#delete-corrupted-files}
83+
84+
If your board is detected by Arduino IDE but uploads fail, corrupted files might be the cause. To solve this:
85+
86+
1. Delete the [Arduino15](https://support.arduino.cc/hc/en-us/articles/360018448279-Open-the-Arduino15-folder) folder.
87+
1. Restart Arduino IDE.
88+
1. [Reinstall the board package](https://support.arduino.cc/hc/en-us/articles/360016119519-Add-boards-to-Arduino-IDE).
89+
1. Try uploading your sketch again.
90+
91+
[Back to top](#top)
92+
93+
### Check the console output {#check-the-console-output}
94+
95+
> [!NOTE]
96+
> _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.
97+
98+
Common upload errors often involve **dfu-util** and **avrdude** utilities. Learn how to solve:
99+
100+
* [dfu-util errors during upload](https://support.arduino.cc/hc/en-us/articles/11011849739804-dfu-util-errors-when-uploading-exit-status-74){.link-chevron-right}
101+
* ['Error: avrdude' during upload](https://support.arduino.cc/hc/en-us/articles/4401874331410--Error-avrdude-when-uploading){.link-chevron-right}
102+
103+
[Back to top](#top)
104+
105+
### Board-specific troubleshooting {#board-specific-troubleshooting}
106+
107+
* **Arduino Nano**:
108+
109+
* Ensure the [correct processor is selected](https://support.arduino.cc/hc/en-us/articles/4401874304274-Select-the-right-processor-for-Arduino-Nano).
110+
* You might need to [install FTDI drivers manually](https://support.arduino.cc/hc/en-us/articles/4411305694610-Install-or-update-FTDI-drivers).
111+
112+
* **Boards with the [WCH CH340 USB chip](https://www.wch-ic.com/products/CH340.html)**: See [avrdude: ser_open(): can't set com-state for COMn](https://support.arduino.cc/hc/en-us/articles/13148652511260-avrdude-ser-open-can-t-set-com-state-for-COMn).
113+
114+
[Back to top](#top)
115+
116+
---
117+
118+
## Still need help?
119+
120+
* Visit the [Installation & Troubleshooting category](https://forum.arduino.cc/c/18) in the Arduino forum.
121+
122+
* [Contact us](https://www.arduino.cc/en/contact-us/):
123+
124+
> [!NOTE]
125+
> **Please include this information:**
126+
>
127+
> * A [verbose error output](https://support.arduino.cc/hc/en-us/articles/4407705216274)
128+
> * The name of your board
129+
> * Your operating system
130+
> * Your Arduino IDE version
131+
132+
<p style="display:none;">
133+
Tags: problem uploading to board, problema subiendo a la placa, https://www.arduino.cc/en/Guide/Troubleshooting, 360003198300, 上传失败, 上传出错, 업로드, problème de téléversement vers la carte, téléverser, проблема загрузки в плату, マイコンボードに書き込めない, マイコンボードに書き込もうとしましたが、エラーが発生しました, problem beim hochladen auf das board, problema di caricamento sulla scheda, 업로딩
134+
</p>

0 commit comments

Comments
 (0)