Leonardo suddenly won't upload

I'm trying to upload a sketch to an arduino Leonardo that I haven't used in a while and can't get the IDE or the web editor to upload to it. At this point I'm just trying to get it to work for any bit of code, so my code I'm trying to upload is literally just a blank sketch.

void setup() {

}

void loop() {
  // put your main code here, to run repeatedly:

}

Any time I try to upload anything to the board it gives me this:
(with "show verbose output during upload" checked)

Sketch uses 3462 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port COM3
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
Uploading using selected port: COM3
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM3 -b57600 -D -Uflash:w:C:\Users\Plerfy\AppData\Local\Temp\arduino_build_551098/throttleVR.ino.hex:i 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .

and then hangs. The same thing happens with my off-brand wemos D1 board too. (I'd try with my uno but I can't find the old school usb cable for it.)

Everything I can find online shows people getting an error message about the programmer not responding or not working, but mine hangs just before it gets to that point so I don't even get an error code to reference.

After it gets to that point if I click the upload button again I get this:

Sketch uses 3462 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port COM3
processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2061)
	at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port 'COM3'.
	at processing.app.Serial.touchForCDCReset(Serial.java:107)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
	... 5 more
Caused by: jssc.SerialPortException: Port name - COM3; Method name - openPort(); Exception type - Port busy.
	at jssc.SerialPort.openPort(SerialPort.java:164)
	at processing.app.Serial.touchForCDCReset(Serial.java:101)
	... 6 more
An error occurred while uploading the sketch

Which I think is just a basic failure message.

It seems to me that it is getting to the point of trying to access the programmer but not being able to, but I can't tell what is happening and what I should do to try to correct it. Any help would be appreciated as I can't seem to do anything with any of my boards until I figure this out.

Edit: Forgot to mention I'm running Windows 10 64 bit
Also the usb port the board is plugged into is a 3.0 port

Thanks

If it worked before with a USB3 port, it should still work with a USB3 port. If you have access to a USB2 port, you can give that a shot.

On the Leonardo, you can press and release the reset button when the line "Forcing reset using 1200bps open/close on port COM3" shows. You have all the time in the world while it is showing those PORTS lines.

To play it safe, you can select COM1 in the IDE when uploading using the manual reset.

You can check the Leonardo's behaviour in Windows device manager. It should change from Arduino Leonardo (COMx) to Arduino Leonardo Bootloader (COMy) and after a few seconds fall back to Arduino Leonardo (COMx).

That is the relevant error for the attempt to upload again after a failed upload.

"Port is busy" might be solved by disconnecting and connecting again; else the only way I know is to reboot the PC.

Manually resetting during the 1200bps line didn't seem to have any effect.
Changing to COM1 made it so that it at least tries every time I press upload now, but it still hangs at exactly the same place.
In the device manager it shows up as a keyboard probably because the last program uploaded to it was imitating a keyboard with the Keyboard.h library. Also the entries in the device manager never seem to change no matter what I do with the arduino. Even unplugging it doesn't seem to do anything. I suppose this means that it's not actually connected? but if that's the case then why does the upload routine get as far as it does? I guess not since attempting an upload without the arduino plugged in gives the same result. So it seems that my arduino is not actually connected. I'll try a different cable tomorrow since I know I've had that problem before, but I don't have another micro usb cable to try until I go and buy one tomorrow.

Edit:
So after a total of about 3 hours troubleshooting (including almost giving up and going to bed) I remembered that the other people in my household still have microUSB devices and I stole one of their cables to try it. I'VE BEEN CAUGHT BY THIS TWICE NOW
I keep forgetting that not all micro USB cables can transmit data, some are only for power and charging. I'M NOT EVEN SURE WHERE I KEEP GETTING THESE USELESS ONES FROM
Anyway that was my entire problem. I can now fully use my devices and have uploaded multiple programs to the boards. Thank's for the help, sometimes it just helps to talk it out and describe the problem. (The rubber duck and whatnot.) It was when I was double checking the device manager behaviors you mentioned that I realized I should really check that cable. I was planning on getting a new one tomorrow anyway, so I'm glad the problem was solved sooner rather than later.

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