"avrdude: ser_open(): can't open device" trying to program Arduino Pro Micro

Hi

When trying to program an Arduino Pro Micro I get the following error

Global variables use 1740 bytes (67%) of dynamic memory, leaving 820 bytes for local variables. Maximum is 2560 bytes.
Performing 1200-bps touch reset on serial port COM17
Waiting for upload port...
No upload port found, using COM17 as fallback

avrdude: Version 6.3-20190619
         Copyr"C:\Users\admin\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\admin\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega32u4 -cavr109 "-PCOM17" -b57600 -D "-Uflash:w:C:\Users\admin\AppData\Local\Temp\arduino\sketches\DCB952518EB74103CF3278AF4FBB85BA/epd1in54_V2.ino.hex:i"
ight (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\admin\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM17
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "\\.\COM17": The system cannot find the file specified.



avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

I am running on WIn11 and have tried both IDE 1.8.19 and IDE 2.3.2. I have tried to restart the computer and I have tried procedure with going into Device Manager and change the COM-port.
But nothing seems to work.

Any ideas what the problem might be and how to overcome it so I can program this unit?

If you haven't done so, connect a button between the reset pin of the Pro Micro and GND; open Windows device manager and double tap the reset button. Do you observe a change? The Pro Micro entry should change to something like "Pro Micro (bootloader" and the port should change.

Instead of a button, you can use a wire.

If yes, start an upload. When the IDE reports the memory usage, double tap the reset button and upload should succeed.

Explanation:
Part of the code that is uploaded contains functionality to identify the board and to react on the software reset that is issued by the IDE (the line Performing 1200-bps touch reset on serial port COM17).
Bugs in your sketch (including libraries used) can result in the described functionality being broken.

Worked like a charm

THANK YOU!

Well, it worked for a while, but now I get this and seems not be be able to get any connection.

I can occasionally see the device in device manager, but just for a short while, it pops up and disappears again after a few seconds.

No connection established

Compilation error: No connection established

The only change in the code when this happened, compared to before when it worked, was that I set D14 as output and toggled it once.

Now what do I do? :grimacing:

Hmm, after having restarted Arduino IDE it works again. Strange this. But right now it's working, so all good.

I'm not sure what to make from that. Which version of the IDE are you using? "No connection established" can indicate a networking problems (several processes in IDE 2.x communicate with each other over network sockets) or it refers to the connection with the Pro Micro.

Sounds like your board resets. Which more than likely indicates a bug.

Does your Pro Micro still go into bootloader mode when you double tap the reset?

If yes, does your PC have a COM1 (in device manager) or do you have another Arduino like Uno/Mega/Nano or a serial-to-usb converter? Do not use another board that has native USB (e.g. Leonardo) for this.

Next you can use the following steps

  1. If you have COM1, select that as the port. If you don't have COM1, connect the other board and select its COM port.
  2. Keep the Pro Micro selected as the target board.
  3. Start an upload of the blank sketch (file / new)
  4. When the IDE reports the memory usage, double-tap the reset.

Upload should succeed and your problem should be gone; try to upload some innocent example sketches (not your sketch) to make sure that uploads are successful.

Next you can start looking at hardware that is connected (it might draw too much power possibly overloading the onboard voltage regulator) and for bugs in your sketch.

I'm not sure what happened there, but after having restarted the IDE it worked again.Should've tried that before I posted.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.