alps
alps

Reputation: 31

Leonardo: Gets detected in Device Manager but then gets disconnected

An Arduino Leonardo gets detected in Device Manager, but then it gets disconnected.

So, this is what I am doing. Connecting Arduino Leonardo to my laptop. It gets detected in Device Manager (I have updated the driver as well). However, I soon hear a beep and the Leonardo gets uninstalled. If I push the 'Reset' button it gets detected again. However, after a few seconds it gets disconnected again. The Device Manager displays the message

Currently, this hardware device is not connected to the computer. (Code 45)

Note: It was working fine a couple of weeks ago. I am using Windows 7.

Upvotes: 3

Views: 9198

Answers (4)

Jermaine Falken
Jermaine Falken

Reputation: 1

You may know about those ICSP "mystery" pins.

Take an Arduino Uno and add the needed "Arduino as Programmer" code to it, wire the Leonardo to the Arduino Uno and now you can program the Leonardo - but you'll nuke the Leonardo's bootloader.

In the IDE, go to "file" and move the mouse to "upload using Arduino as programmer" and have your fun. If you resort to this method, do not buy a LilyPad USB as it has the exact same 32U4 chip like a Leonardo and doesn't have the ICSP pins. That is, unless you can solder the pins into the six holes!

Upvotes: 0

Guy
Guy

Reputation: 41

I had exactly the same problem. After pushing Reset my Arduino Micro first got detected normally. Here's the corresponding excerpt from my /var/log/syslog (without the timestamps, etc.):

usb 6-1: new full-speed USB device number 56 using uhci_hcd
usb 6-1: New USB device found, idVendor=2341, idProduct=0037
usb 6-1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
usb 6-1: Product: Arduino Micro
usb 6-1: Manufacturer: Arduino LLC
cdc_acm 6-1:1.0: ttyACM3: USB ACM device

But only a few seconds later it got disconnected:

usb 6-1: USB disconnect, device number 56

After a long search I found how you can recover from this fatal situation:

  • Connect your Arduino via a USB cable.
  • Open the Arduino IDE and load the "Blink" example.
  • Open a shell and enter: tail -f /var/log/syslog. This is for observing which /dev/tty port the Arduino gets associated with.
  • Now you must be fast: Reset the Arduino, see what /dev/tty port it gets and choose that port in the IDE under menu ToolsSerial Port. You must do this before the Arduino disconnects again or else the correct menu point won't be accessible. You probably need one or two tries before you get it. That was the hard part.
  • Press "Reset" again on the Arduino, and immediately after, press the Upload button in the Arduino IDE.
  • Your Arduino should start the blink program shortly after the Upload and is "healed".

After some more investigation I found the reason for the whole misery: In some forgotten source code of some forgotten file there was a main() function (I had written that one for some tests under Linux/g++ some weeks before). The compiler now preferred to use that main() instead of the standard main() from the IDE environment.

The result is that the USB gets disconnected, probably because the original main() does some initialisation which now was missing.

Upvotes: 4

JDKardona
JDKardona

Reputation: 41

It looks like a problem with the soft-reset of the Arduino Leonardo, normally when you connect the Arduino Leonardo, it appears in Device Manager like Ard...bootloader (COMX), for a few seconds and then the Arduino Leonardo appears on a different COM port.

I know, in your case, after that it just disappears. Try to select that port in the Arduino IDE, and then you have to try to load some sketch, like blink.ino. Press the reset button at the same time, and then when the sketch is beginning to be uploaded, release the reset button. That works for me.

Upvotes: 4

FeliceM
FeliceM

Reputation: 4209

Make sure that nothing, rather than the USB cable, is connected to the Arduino and try again. If the problem persist, try to replace the cable and test it on a different USB port.

Try also to read the post Windows Not recognizing Uno. If you can see the Arduino in the Device Manager for few seconds, try to reinstall the drivers. The drivers are in the Arduino IDE folder.

Upvotes: 2

Related Questions