avrdude: ser_open(): can't set com-state for "\\.\COM14"

Using Arduino 1.6.5
Atmel 32u4 with Leonardo boot loader

Directly after loading the boot loader, I can upload by USB, but this only works once, unless I connect the board to my surface then I don't have any problem uploading.

If I try to upload more than once from our other computers, I get:

avrdude: ser_open(): can't set com-state for "\.\COM14"
avrdude: ser_send(): write error: sorry no info avail

Any thoughts?

bootloader issue ?
maybe you did not have reset enabled while bootloading ?

would that cause it to work on the laptop but not the desktop

I suspect you have selected the wrong com port in the IDE. Double check in the ports menu that it's the correct one.

Hook up the Leonardo and open device manager on your PC. Under ports (on my PC), it will show as Arduino Leonardo (COM10). Disconnect and reconnect; it will immediately show the same info again.

That is the port that should be selected in the IDE. I did manage to get it wrong as well in the past (no idea how).

Now reset the Leonardo using the reset button and observe what happens in the device manager. It will first show (on my PC) Arduino Leonardo Bootloader (COM11) followed a few seconds later by Arduino Leonardo (COM10).

What does your device manager tell you after you connect the Leonardo? And what does it say after the reset?

As said, you may have selected the wrong com port on the PC. In the IDE, file->preferences; make sure that "show verbose output during upload" is checked.

Observe what happens when in the output window. After the compile output, you should see

...
...
Sketch uses 4,452 bytes (15%) of program storage space. Maximum is 28,672 bytes.
Global variables use 148 bytes (5%) of dynamic memory, leaving 2,412 bytes for local variables. Maximum is 2,560 bytes.
Forcing reset using 1200bps open/close on port COM10
PORTS {COM10, } / {COM11, } => {COM11, }
Found upload port: COM11
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM11 -b57600 -D -Uflash:w:C:\Users\sterretje\AppData\Local\Temp\build2ecfa637bcddbfb580bcddc6f266d6e2.tmp/sketch_sep01a.ino.hex:i

As you can see, the IDE forces a reset. You can again observe the device manager. It will show the same behaviour as described above when you press the reset button.

I suspect that in your IDE output window COM10 (in above) is COM13 and COM11 will show as COM14. The PORTS line is probably repeated a number of times. You can copy the content of the output window and post it here if needed.

So the IDE now tries, in your case, to open COM14 (one higher than the selected port) which does not exist. If the selected com port would have been COM12 (which I suspect it is supposed to be), the IDE will try to use COM13 and it will work.

You will probably have a similar problem when you try to open the serial monitor after you connected the Leonardo.

Hope this helps a little.

Note that this is purely based on experiences that I had.

You may also check the cable you are using try other one . it happened to me once

I am using atmega 8a with minicore bootloader from mcudude and I get the same error avrdudr ser_open() : can't set com state for com 13 and I have tried everything but can't succeed and when I replace the atmega 328p from arduino uno and place my atmega 8a then the program uploaded successfully so I think there is the driver issue for the fttdi chip can anybody please help me