the latest: about a months ago - after days of frustration - I managed to upload a sketch to my leonardo board. among others, my fix included: downloading arduino IDE again, downloading drivers for usb ports again, trying various cables.
One month later, now, I try to upload a new sketch to the same leonardo board, with the same cable, using the same computer with the same win8 settings - and guess what, the COM option in tools is inactive again. I did not open the IDE in the meantime, so all settings are the same.
I know that I am not the firt one having such issues - but there is no solution found anywhere on the net or on the forum, only guessing.
I would like to ask the developers of this lamp of.... so the this Arduino IDE to make it somewhat less prone to failure... or at least make it easier to find the root of the issue.
Due to the USB stack running on the same chip as your sketch with this board, it is possible for code in your sketch to break the USB functionality. Fortunately, the upload code (bootloader) is stored in a separate section of memory and can not be broken by the sketch code. The only tricky thing is that the bootloader has to be activated at just the right time during the upload. Normally this is done by some special code that runs in the background of your sketch code recognizing a 1200 baud connection as the signal to reset the microcontroller and start the bootloader. However, in your current situation, that system wont work so you'll need to manually reset the board to activate the bootloader.
You need to get the timing right. If you press the reset button too early, the bootloader will have already timed out by the time the upload starts. The tricky thing is that when you press the "Upload" button in the Arduino IDE, it first compiles your sketch before starting the actual upload. So you need to wait until after the compilation finishes before pressing the reset button.
Do this:
Sketch > Upload
Watch the black console window at the bottom of the Arduino IDE window. As soon as you see something like this:
Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
press and release the reset button.
After that, the sketch should upload successfully. After that, if the problem persists, you know there is something in your sketch that is breaking the USB functionality. You can verify this by uploading the File > New sketch, after which the board should be recognized by your computer and you should be able to upload normally. If so, you will need to find out what it is in your sketch breaking the USB code. Now that you know how to recover your board, that should be manageable.
First thing to do is check Windows device manager.
Does it show there anywhere? Usually it should show as Arduino Leonardo. If it does not show in the ports section in Windows device manager, the IDE will never see it.
Next is to check in Windows device manager what happens when you preset and reset the Leonardo. The old entry should disappear and a new one ArduinoLeonardo bootloader should show. If not, you need to burn the bootloader;it's unlikely that this is the case (just preparing you for the worst case scenario)
Also, after you have reset the board, the on-board LED should fade in/out for a few seconds.
If you see the bootloader show after a reset you can try the following;
Upload blink or another innocent sketch. Once the IDE shows the memory usage, press and release the reset button on the Leonardo; upload should succeed.
About a year ago I had a similar problem with my Arduino MKRZero.
( using Windows 10 PC ).
I would plug in a brand new board and watch device manager . . . .
The brand new board would not show up.
After plugging that " previously " brand new board into a different PC,
it would not show up there in Device Manager either.
I checked cables, more / other / known good PCs etc. - no luck.
( I had purchased about 75 Arduinos from Digikey . . .
Previously I had already programmed 50 to 100 Arduinos of all sorts successfully.
Digikey product rep and Arduino engineer had previously been contacted and
had not been able to help . . . ( much ) . . . )
Eventually, I went to Device Manager and selected SHOW HIDDEN devices in the menu.
I could see that the last devices in the list were at some interesting limit like COM128 or COM256 devices.
I right clicked on the device list hidden items from about the last 10 or 20 devices and selected " DELETE "
the device ( s ) - - ( I did not " check " the " AND REMOVE DRIVERS " option. )
After doing that, I could successfully add " OTHER " MKRZeros to the PC as normal.
The Boot loader on the " Damaged " units had to be re-loaded with an external
Segger J-Link programmer / Atmel studio 7. All units were recovered.
The COM stack on windows does have a limit and in cases such as yours would need to be periodically reset.
The same routine may also be needed for people who FORCE a com port to a specific port too and such events can be found using the forum search including the fix linked to above.