Stubborn error message with Arduino Pro-Mini upload: avrdude: ser_open(): can't open device "\\.\COM2": The system cannot find the file specified

Hi, although I've been building a variety of Arduino projects, with different types of Arduino boards for a few years now, I've never posted anything to the forum before. Hopefully I've picked the right community, etc...
For the last 6 months or so, whenever I try uploading code to a Pro-Mini board, and even a Pro-Micro, I struggle with the following error message (not always the same port number):

"avrdude: ser_open(): can't open device "\.\COM2": The system cannot find the file specified."

Prior to getting this error, I am often able to upload the code, but once this error shows up, nothing much seems to work to eliminate it (other than one thing - see below).

Let me say that I know this topic has been discussed before over the last few years, and I've read all the posts and replies I can get my hands on, and I've tried all of the "fixes", but so far NOTHING seems to work reliably.
I am running Windows 11, and Arduino IDE Ver2.2.1.

I have spent days trying all of the following, without any luck:

  • Restarting the computer (until I'm blue in the face). This is a huge time waster.
  • Different computer
  • Restarting the IDE
  • Multiple different USB cables, all of which work fine for anything else - and for this sometimes
  • Two different Sparkfun FTD boards (when using the Pro-Mini)
  • Different USB outlets
  • Different Arduino boards
  • Different Arduino sketches
  • Selecting different ports
  • Adding a capacitor from the DTR pin to the RST pin. It turns out my Pro-Mini boards already have a cap between those pins, and a 10k pullup on RST, so adding one does nothing.

Yes, I've selected the correct board and the correct port in the IDE. I've tried suggestions such as uploading the code without the board plugged in, deleting the error message first (I don't know why this would ever work), and selecting a different port - making sure it's not already in use.

The ONLY thing the has seemed to help get around this error is to go into the device manager, select the port being used, and change some of the Advanced settings, such as Latency Timer. After changing a setting and saving it, I am often able to upload a program once or twice, and then the error returns! The point is that there is no setting I've found the reliably eliminates the error.

Interestingly, I don't remember EVER having this problem a year or two ago, which makes me think this problem may be related to a newer version of the IDE.

Any help would be much appreciated.
Thanks!

Check the loopback test on the FTDI to confirm the port is communicating.

You could just have IDE 1.8.19 installed as well and see if that solves anything.

Thanks. I can't remember if I tried that. Can you have two different versions loaded at once, or do I have to uninstall the newer one first?

Thanks, this is new to me. I'll give it a try. Thanks for the link.

Do you know if this will work with the Pro-Mini board? It isn't listed there.

Actually, if I read that web page correctly, it seems that Loopback test is for boards that already have a USB-Serial converter on them. If that's true, then it wouldn't apply to the Pro-Mini board I'm having issues with. It might work on the Pro-Micro, since that has one.

  • For your Pro Mini, simply jumper TX to RX right on the FTDI converter itself.

  • The Pro Mini does not need to be involved in this case.

Gotcha

The Loopback test worked fine, but I still get the error message when trying to upload a sketch. This is really becoming a huge pain! I have to keep diddling with the port settings just to upload a simple edit.

All that’s happening here is, when you select the appropriate COM port then open the serial monitor, whatever is typed in the serial monitor will get echoed back.

I noticed that sometimes the end of the error message says "Access is denied", rather than "cannot find the file specified". Ugh.

Well, I use Windows 10 with the Arduino IDE 1.8.19

Yes you can, board packages will be shared. Even open at the same time.

For port availability you should prevent having more than 1 instance of any IDE open, just windows of the same instance. Having the Serial monitor open in an instance holds the port. Same goes for any other program like putty.

OK, good to know, thanks.

I just downloaded and installed version 1.8.19 and tried uploading the same program, using the same board and cables. This time it worked! I suspect there's some sort of bug in the latest version of the IDE that affects using these boards, but time will tell.
Thanks again for the suggestions.

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