Skip to content

Commit 73e06ca

Browse files
HC-954 'Error: avrdude' when uploading (#28)
* Updates * Added id to heading * Various improvements, cleaned up comments. * Escape < and > * Update content/Software and Downloads/Upload/Error-avrdude-when-uploading.md Co-authored-by: Renat0Ribeir0 <86349945+Renat0Ribeir0@users.noreply.github.com> Co-authored-by: Renat0Ribeir0 <86349945+Renat0Ribeir0@users.noreply.github.com>
1 parent c489c7d commit 73e06ca

File tree

3 files changed

+164
-47
lines changed

3 files changed

+164
-47
lines changed

content/Software and Downloads/IDE Settings/COM-port-number-changes-when-connecting-board-on-different-ports-or-in-bootloader-mode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Of course, the COM port number will be reflected on Arduino IDE but this is not
1616

1717
![](img/COM_port_changes_1.png)
1818

19+
<h2 id="set-COM-port">Manually set a COM port for the board</h2>
20+
1921
It is possible to force the COM port to remain with the same number if that is what is required. All that needs to be done is:
2022

2123
1. In the `Device manager`, right click on the specific COM port and select `port properties`.

content/Software and Downloads/Upload/Error-avrdude-when-uploading.md

Lines changed: 162 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,64 @@
22
title: "'Error: avrdude' when uploading"
33
---
44

5-
The tool **avrdude** is used to upload sketches to the Arduino boards which use microcontrollers of the AVR architecture. When uploading code to your board in the IDE, avrdude may give an error. Some of the most common errors are listed below.
5+
When uploading a sketch to your board you may get an error from the **avrdude** utlity:
6+
7+
* **stk500:**
8+
* [avrdude: stk500_recv(): programmer is not responding
9+
avrdude: stk500_getsync() attempt X of 10: not in sync](#avrdude-stk500_recv-and-stk500_getsync)
10+
* [avrdude: stk500v2_ReceiveMessage(): timeout
11+
avrdude: stk500v2_getsync(): timeout communicating with programmer](#avrdude-stk500_recv-and-stk500_getsync)
12+
* **ser_open():**
13+
* [avrdude: ser_open(): can't open device \<port\>: no such file or directory](#avrdude-ser_open-cant-open-device-no-such-file-or-directory)
14+
* [avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy](#ser_open-device-or-resource-busy)
15+
* [avrdude: ser_open(): can't open device \<port\>: Resource busy](#ser_open-resource-busy)
16+
* [avrdude: ser_open(): can't open device \<port\>: permission denied](#ser_open-permission-denied)
17+
* [avrdude: ser_open(): can't open device \<port\>: access is denied](#ser_open-access-is-denied)
18+
* [avrdude: butterfly_recv(): programmer is not responding](#avrdude-butterfly_recv)
19+
* [avrdude: usbhid_open(): No device found
20+
avrdude: jtag3_open_common()](#usbhid_open_jtag3_open_common)
21+
* [avrdude: jtagmkII_getsync(): sign-on command: status -1](#jtagmkII_getsync)
22+
* **[Other avrdude errors (general troubleshooting)](#check-the-following)**
23+
24+
> **Note:** The error text may be different depending on your system language.
625
7-
* [`avrdude: stk500_recv(): programmer is not responding`](#avrdude-stk500_recv-and-stk500_getsync)
8-
* [`avrdude: stk500_getsync() attempt X of 10: not in sync`](#avrdude-stk500_recv-and-stk500_getsync)
9-
* [`avrdude: stk500v2_getsync(): timeout communicating with programmer`](#avrdude-stk500_recv-and-stk500_getsync)
10-
* [`avrdude: butterfly_recv(): programmer is not responding`](#avrdude-butterfly_recv)
11-
* [`avrdude: ser_open(): can't open device "portName": no such file or directory`](#avrdude-ser_open-cant-open-device-no-such-file-or-directory)
12-
* [`avrdude: ser_open(): can't open device "portName": the system cannot find the file specified.`](#check-the-following)
13-
* [`avrdude: ser_open(): can't open device "portName": access is denied.`](#check-the-following)
14-
* [`avrdude: ser_open(): can't open device "portName": permission denied`](#check-the-following)
15-
* [`avrdude: ser_open(): can't open device "portName": the semaphore timeout period has expired.`](#check-the-following)
16-
* [`avrdude: ser_open(): can't set com-state for "portName"`](#check-the-following)
17-
18-
> Text following `avrdude: ser_open():` can appear in a different language if your system language is not set to English.
26+
---
1927

20-
While these errors can be somewhat ambiguous, they are most often caused by failing or incorrectly configured hardware. It is likely that the error can be solved by following this troubleshooting procedure.
28+
<a id="check-the-following"></a>
2129

22-
---
30+
## General troubleshooting checklist
2331

24-
<h2 id="check-the-following">Check the following</h2>
32+
Most errors can be solved by following these steps. After each step, try uploading your sketch again.
2533

26-
1. Make sure you have selected the correct board under `Tools > Board`.
34+
1. Make sure you have [selected the right board and port](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE) correct board under _Tools > Board_ and _Tools > Port_.
2735

28-
2. Make sure to select the correct port under `Tools > Port`.
36+
* For instructions, see [Select board and port in Arduino IDE](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE)
2937

30-
3. Make sure the board is powered. Try disconnecting and reconnecting the board to the computer, and confirm that the power LED (usually labeled on the board "ON") is lit. On most boards, an orange LED will also blink when the board is plugged in.
38+
* If your board is missing, see [If your board does not appear in the port menu](https://support.arduino.cc/hc/en-us/articles/4412955149586-If-your-board-does-not-appear-in-the-port-menu)
3139

32-
4. Make sure that you are using a USB data cable (a charge-only cable will not work). Also, check the cable for physical damage.
40+
2. Close other instances of Arduino IDE, serial monitors, and other software that may be blocking the port. If this doesn't work, try restarting your computer.
3341

34-
5. Remove any connections to digital pins **0(RX)** and **1(TX)**. These pins are used for communication with your computer. Connecting anything to these pins can interfere with uploading. You can attach the components back to these pins once the program has been successfully uploaded.
42+
3. Reset your board by pressing the RESET button (a white or blue push button).
3543

36-
6. Make sure that you have closed the serial monitor.
44+
![The reset button on Arduino UNO.](img/uno-reset-button.png)
3745

38-
7. Press the reset button and see if the LED blinks. If the LED doesn't blink there is a high chance that the bootloader of your board is corrupted.
46+
4. Check port and cable connections:
3947

40-
8. Make sure you have updated and installed all the necessary drivers for the board. If you already have the drivers, try reinstalling them.
48+
* Try disconnecting and reconnecting the board to the computer, and confirm that the power LED (often labeled "ON") is lit.
4149

42-
9. Try a complete uninstall (including deleting the [Arduino15 folder](https://support.arduino.cc/hc/en-us/articles/360018448279) of the Arduino IDE. Then reinstall the IDE using the latest version.
50+
* If possible, connect the board directly to a USB port. Avoid using a USB hub if possible, or try a different hub.
4351

44-
10. If your board is an Uno, Mega, or Nano board, you can do a [loopback test](https://support.arduino.cc/hc/en-us/articles/360020366520). This will rule out faulty hardware.
52+
* Make sure you are using a data transfer USB cable (charge-only cables will not work). Try connecting your board with a different cable, or testing your cable with a different device.
4553

46-
11. If the loopback test passes, the problem may be due to a corrupted bootloader. In this case, burning a fresh bootloader may solve the issue. Keep in mind that this is an advanced procedure. Use the links below to get started.
54+
* Remove any unneeded USB devices that may be using the ports.
4755

48-
* [General overview on bootloader burning](https://www.arduino.cc/en/Tutorial/BuiltInExamples/ArduinoISP)
49-
* [Using two Arduino Mega boards](https://support.arduino.cc/hc/en-us/articles/360012048060)
50-
* [Using two Arduino UNO boards](https://support.arduino.cc/hc/en-us/articles/360012048080)
56+
5. Remove any connections to digital pins **0(RX)** and **1(TX)**. Anything connected to these pins can interfere with the upload transfer.
5157

5258
---
5359

54-
## Learn more about specific errors
60+
<a id="avrdude-stk500_recv-and-stk500_getsync"></a>
5561

56-
<h3 id="avrdude-stk500_recv-and-stk500_getsync">avrdude: stk500_recv() and stk500_getsync()</h3>
62+
## avrdude: stk500_recv(): programmer is not responding<br>avrdude: stk500_getsync() attempt \<n> of 10: not in sync
5763

5864
```
5965
avrdude: stk500_recv(): programmer is not responding
@@ -63,17 +69,111 @@ avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
6369
...
6470
```
6571

66-
This error can occur when the selected port has no board. For example, the Bluetooth<sup>®</sup> port might be selected instead of the USB port where the Arduino board is connected.
72+
1. Make sure you have [selected the right board and port](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE) correct board under _Tools > Board_ and _Tools > Port_.
73+
74+
* For instructions, see [Select board and port in Arduino IDE](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE)
75+
76+
* If your board is missing, see [If your board does not appear in the port menu](https://support.arduino.cc/hc/en-us/articles/4412955149586-If-your-board-does-not-appear-in-the-port-menu)
77+
78+
2. If using the classic Nano, try selecting a different processor in _Tools > Processor_.
79+
80+
3. For some boards, a _loopback test_ can be performed, which will rule out problems with the serial chip. It can be done with the following boards:
81+
82+
* Arduino Uno (classic)
83+
* Arduino Uno Rev3
84+
* Arduino Uno Rev3 SMD
85+
* Arduino Mega (classic)
86+
* Arduino Mega2560 Rev3
87+
* Arduino Mega ADK Rev3
88+
* Arduino Nano (classic)
89+
90+
If the loopback test passes, or if you can't do a loopback test, reprogramming the bootloader may resolve the issue. [ArduinoISP](https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP) can be used for boards with AtMega chips. You can also search for [articles in the Help Center](https://support.arduino.cc/hc/en-us/search?utf8=%E2%9C%93&query=bootloader).
91+
92+
---
93+
94+
<a id="stk500v2_ReceiveMessage_getsync"></a>
95+
96+
## avrdude: stk500v2_ReceiveMessage(): timeout<br>avrdude: stk500v2_getsync(): timeout communicating with programmer
97+
98+
Make sure you have [selected the right board and port](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE) correct board under _Tools > Board_ and _Tools > Port_.
99+
100+
---
101+
102+
<a id="avrdude-ser_open-cant-open-device-no-such-file-or-directory"></a>
103+
104+
## avrdude: ser_open(): can't open device: No such file or directory
105+
106+
```
107+
avrdude: ser_open(): can't open device "/dev/cu.usbmodem14101": No such file or directory
108+
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
109+
```
110+
111+
This error can happen if the board on the selected port has been disconnected from the computer, or reassigned to a different port.
112+
113+
1. Make sure the correct port is selected in _Tools > Port_.
114+
115+
* For step-by-step instructions, see [Select board and port in Arduino IDE](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE).
116+
* If you can't find the port, see [If your board does not appear in the port menu](https://support.arduino.cc/hc/en-us/articles/4412955149586-If-your-board-does-not-appear-in-the-port-menu).
117+
118+
2. If using the classic Nano, try selecting a different processor in _Tools > Processor_.
119+
120+
> On Windows, you can [manually set a port for the board](https://support.arduino.cc/hc/en-us/articles/360016420140#set-COM-port) to stop it from being reassigned.
121+
122+
---
123+
124+
<a id="ser_open-device-or-resource-busy"></a>
125+
126+
## avrdude: ser_open(): can't open device \<port\>: Device or resource busy
127+
128+
1. Make sure the correct port is selected in _Tools > Port_.
129+
130+
2. Close other instances of Arduino IDE, serial monitors, and other software that may be blocking the port.
131+
132+
3. Restart your computer.
67133

68-
You can select your port in `Tools > Port: "..." > Serial Ports`. The correct port may be labeled with the board name, but not always. If you are unsure which port your board is connected to, try disconnecting it. Then reconnect it, and take note if a new port appears.
134+
4. See [Find and stop process blocking a port](https://support.arduino.cc/hc/en-us/articles/4407830972050-Find-and-stop-process-blocking-a-port).
69135

70-
> If you're using an Arduino Nano you also need to [select the correct processor](https://support.arduino.cc/hc/en-us/articles/4401874304274-Select-the-right-processor-for-Arduino-Nano).
136+
---
137+
138+
<a id="ser_open-resource-busy"></a>
139+
140+
## avrdude: ser_open(): can't open device \<port\>: Resource busy
141+
142+
1. Make sure the correct port is selected in _Tools > Port_.
143+
144+
2. Close other instances of Arduino IDE, serial monitors, and other software that may be blocking the port.
145+
146+
3. Restart your computer.
147+
148+
4. See [Find and stop process blocking a port](https://support.arduino.cc/hc/en-us/articles/4407830972050-Find-and-stop-process-blocking-a-port).
149+
150+
---
71151

72-
<!-- TODO: Update when dedicated article is deployed -->
152+
<a id="ser_open-permission-denied"></a>
73153

74-
If the issue persists, [check these steps](#check-the-following).
154+
## avrdude: ser_open(): can't open device \<port\>: Permission denied
75155

76-
<h3 id="avrdude-butterfly_recv">avrdude: butterfly_recv()</h2>
156+
This error can occur on Linux if your user account is part of the `dialout` group. See [Fix port access on Linux](https://support.arduino.cc/hc/en-us/articles/360016495679-Fix-port-access-on-Linux) to resolve the issue.
157+
158+
---
159+
160+
<a id="ser_open-access-is-denied"></a>
161+
162+
## avrdude: ser_open(): can't open device \<port\>: access is denied
163+
164+
1. Make sure the correct port is selected in _Tools > Port_.
165+
166+
2. Close other instances of Arduino IDE, serial monitors, and other software that may be blocking the port.
167+
168+
3. Restart your computer.
169+
170+
4. See [Find and stop process blocking a port](https://support.arduino.cc/hc/en-us/articles/4407830972050-Find-and-stop-process-blocking-a-port).
171+
172+
---
173+
174+
<a id="avrdude-butterfly_recv"></a>
175+
176+
## avrdude: butterfly_recv()
77177

78178
```
79179
avrdude: butterfly_recv(): programmer is not responding
@@ -89,29 +189,44 @@ avrdude: butterfly_recv(): programmer is not responding
89189
avrdude: error: programmer did not respond to command: exit bootloader
90190
```
91191

92-
Check that you have selected the correct board in `Tools > Board`.
192+
Make sure you have [selected the right board and port](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE) correct board under _Tools > Board_ and _Tools > Port_.
93193

94-
If the issue persists, [check these steps](#check-the-following).
194+
For instructions, see [Select board and port in Arduino IDE](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE).
195+
196+
---
95197

96-
<h3 id="avrdude-ser_open-cant-open-device-no-such-file-or-directory">avrdude: ser_open(): can't open device: No such file or directory</h3>
198+
<a id="usbhid_open_jtag3_open_common"></a>
199+
200+
## avrdude: usbhid_open(): No device found<br>avrdude: jtag3_open_common()
97201

98202
```
99-
avrdude: ser_open(): can't open device "/dev/cu.usbmodem14101": No such file or directory
100-
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
203+
avrdude: usbhid_open(): No device found
204+
avrdude: jtag3_open_common(): Did not find any device matching VID 0x03eb and PID list: 0x2145
205+
An error occurred while uploading the sketch
101206
```
102207

103-
This error can occur when the board has been disconnected from a selected port. Make sure that the board is connected, and that the correct port is selected from the `Tools > Port` menu.
208+
Make sure you have [selected the right board and port](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE) correct board under _Tools > Board_ and _Tools > Port_. In particular, this error can occur when uploading to an Arduino Uno Rev3 or classic, when having _megaAVR Boards > Arduino Uno WiFi Rev2_ as the selected board.
104209

105-
If the issue persists, [check these steps](#check-the-following).
210+
---
106211

107-
## Still need help?
212+
<a id="jtagmkII_getsync"></a>
213+
214+
## avrdude: jtagmkII_getsync(): sign-on command: status -1
215+
216+
Make sure you have [selected the right board and port](https://support.arduino.cc/hc/en-us/articles/4406856349970-Select-board-and-port-in-Arduino-IDE) correct board under _Tools > Board_ and _Tools > Port_.
217+
218+
---
108219

109-
You're welcome to ask in the forum, or contact us. Please include this information: Board name, Operation System, IDE or Create Agent version, and error output.
220+
## Still need help?
110221

111222
* Visit the [Avrdude, stk500, Bootloader issues category](https://forum.arduino.cc/c/using-arduino/avrdude-stk500-bootloader-issues/81) in the Arduino forum.
112223

113224
* [Contact us](https://www.arduino.cc/en/contact-us/).
114225

226+
> **Please include this information:** A [verbose error output](https://support.arduino.cc/hc/en-us/articles/4407705216274), the name of your board, your operating system, and your Arduino IDE version.
227+
115228
<p style="display:none;">
116229
Tags: \\.\com1, \\.\com2, \\.\com3, \\.\com4, \\.\com5, \\.\com6, \\.\com7, \\.\com8, \\.\com9
117230
</p>
231+
232+
<!-- markdownlint-disable-file HC001 -->
16.7 KB
Loading

0 commit comments

Comments
 (0)