Failed to open COM27. Error 0x2


I have the Pololu AVR USB Programmer and I am trying to program an Atmega328p MCU sitting on the Arduino Uno board. My goal is to bypass/remove the Arduino bootloader in order to program the MCU as if it were a standalone, non-Arduino application. The board is being powered via a 12V plug.

All of my drivers are installed correctly, and I’m trying to upload code using Atmel Studio 6. I’ve followed all of the instructions in the user guide to program with Atmel Studio 6, but I cannot get the hex file on to the MCU. Uploading code with the Arduino IDE using the programmer works fine.

Previously, after connecting everything and adding the STK500 in atmel studio, I could open the programmer window to read voltages/device id/fuse bits/etc. but now all I see is an error when trying to open the window. “Unable to connect to tool STK500 (COM27)” and under details:

ModuleName: TCF (TCF command: Tool:connect failed.)
Failed to open COM27. Error 0x2.

I’ve tried disconnecting everything, restarting my computer (Running Windows 7 basic), reinstalling all the Pololu drivers, nothing has worked. I’ve tried looking at topics with similar problems, but could not find anything that helps my situation.

Thank you in advance

Well then.

I read somewhere on a distant forum post that Atmel studio 6 does not like COM ports above a certain value.

I changed the programmer’s port to COM1, and it can now properly upload code to the MCU!

Thanks, I guess. LoL.


We have warnings about this in our documentation, but I am glad you were able to find the solution elsewhere. Atmel Studio can only connect to COM1-9. I reported this to them and they recorded it as Issue #AVRSV-3454. You can read about it here: … readme.pdf

They said they would consider fixing it in Atmel Studio 6.1.