Arduino Leonardo disconnecting from Windows when uploading sketch

Hey guys! Sorry if this is in the wrong section.

I recently purchased some Arduino Pro Micro Atmega32U4's. I have returned the first set and got a replacement because they wouldn't work. Each time I attempt to send a (Blink pin 13) test sketch, it makes the disconnecting Windows sound and then makes the sound again when it is "uploaded".

I have attempted to hold down the RST button before the "Uploading..." appears but that doesn't work. I have attempted to press RST twice before uploading. That doesn't work.

I don't know what else to try. If these are bricked/faulty I can return them, but which should I purchase? I am fine with overpaying on Amazon for faster shipping.

I'd prefer to be able to use my current ones and not return these, so if any of you guys have any suggestions, I'd be happy to hear them.

Here is a video of what is happening: Arduino Leonardo sketch not uploading. - YouTube

This is normal behavior.

How can you say this is normal behavior? The disconnecting and disconnecting again is normal?

I uploaded a Blink LED Pin 13 sketch and I didn't see anything blink on it. Perhaps it does not have one? I will go and test it.

The SAMD21-based chips (and several other chips used in various Arduinos and compatibles) implement their connection to the PC via a USB peripheral on the chip that needs software running on the chip to be "active."
When the chip is reset, the software stops running, and the USB connection goes away.

The normal "upload" procedure goes like:

  1. PC sends a "I want to upload a new sketch" message to the Arduino over the existing USB connection.
  2. The Arduino resets, causing the USB connection to go down.
  3. The Arduino runs the bootloader code, which brings the USB connection back up.
  4. The sketch is uploaded to the Arduino over the bootloader USB connection.
  5. The bootloader resets so that the sketch will run. This causes the USB connection to go down again.
  6. The user sketch starts running and brings the USB connection back up.

USUALLY, this all happens "transparently", and the sketch uploads successfully despite all the alarming noises from Windows. Sometimes there are problems:

  1. It's confusing.
  2. Sometimes, on some PCs, the timing is such that the PC becomes confused and misses one of the transitions.
  3. Sometimes, on some PCs, one of the "USB comes back up" transitions causes the Arduino to appear on a different COM port than where it was before.

There is a work-around, known as the "double-tap reset hack." If your board has a reset button, you can push it twice, rapidly, and the board will go into the bootloader "permanently" until it sees a sketch upload attempt. This avoids some of the problems associated with the timing.

Are you using a Leonardo or a ProMicro; there is a significant difference.

There is no LED on pin 13 of a ProMicro; it also does not have a pin called 13 on the board.

ProMicro schematic: https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Pro_Micro_v13b.pdf

SparkFun has great hookup guides; read Pro Micro & Fio V3 Hookup Guide - SparkFun Learn, it contains blink examples.

Yes it is, because the 32u4 processer connects as different device to the PC during uploading and normal running. You can see that in device manager of your PC.
While the sketch is running it is connected as 'Arduino Micro', and while uploading it is connected as 'Arduino Micro bootloader'

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