Problem with Arduino Leonardo

Im getting a
"\.\COM3": Access is denied.
error while uploading my sketch to my Arduino Leonardo trough IDE.

{CFFB5629-9EB7-4F1F-B0FA-C2C2DD6407AA}

When first downloading IDE i accidentally clicked not to install some drivers but i reinstalled IDE and it seemed to work until it didnt work again.
Not sure why this is happening but now my device manager isnt showing Arduino Leonardo anymore only COM3/5.

Hi @knownaswoolf. This error might be caused by having the wrong port selected from the Tools > Port menu in Arduino IDE.

Please perform this experiment to verify that the port you have selected is your Arduino board:

  1. Disconnect the USB cable of the Arduino board from your computer.
  2. Select Tools > Port from the Arduino IDE menus.
  3. Take note of the ports (if any) listed in the menu.
  4. Close the Tools menu.
    :red_exclamation_mark: The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  5. Connect the Arduino board to your computer with a USB cable.
  6. Select Tools > Port from the Arduino IDE menus. - If a new port is listed in the menu, that is the port of your Arduino board.

If you saw a new port appear at the last step, select that port from the Tools > Port menu and try uploading again.

If this doesn't solve the problem, please reply here on this forum topic with the answers to the following questions:

  • While following those instructions, did you see a port in the Tools > Port menu at step (6) that was not present at step (3)?
  • If you did see a new port, was the upload successful after you selected that port?

Your board was recognised in the past and now is no longer recognised.

  • If you tap the reset button, does the L-LED fade in and out for approximately 8 seconds?
  • If it fades in-and out, does Windows device manager recognise the board as a Leonardo bootloader?
  • If not, I would suspect the cable. Make sure that you're using a data/sync cable and not a charge-only cable; the latter are often supplied with powerbanks and Bluetooth speakers.
  • If it is recognised as a Leonardo bootloader, you can follow the instructions below.
  1. Upload the blink sketch or any other innocent sketch.
  2. When the IDE reports the memory usage, tap the reset button to invoke the bootloader.
  3. Upload should now succeed.

Nothing connected:

New port:

Didnt work but i got a different error msg this time:

  1. Yeah bootloader works and the L LED pulses/fades in and out
  2. No, this one doesnt show as Arduino Leonardo in the Device Manager. I got a new board as my other board had a hardware issue and that board showed as Leonardo.
    Heres how it looks:
    {37D63780-488D-47AC-8DCF-B109F15A51AD}

While in bootloader:
{90F140EC-D3DE-4FD4-86D1-AB71BB07BBA5}

I'm using the supplied blue data cable that came with the Leonardo but i will try a different port and cable maybe.

And Ive tried the bootloader upload before and got an error similar to this:

@ptillisch @sterretje
Heres the verbose output on the upload hope this helps:

avrdude: Versio"C:\Users\Aron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Aron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega32u4 -cavr109 "-PCOM7" -b57600 -D "-Uflash:w:C:\Users\Aron\AppData\Local\arduino\sketches\A825DE41D8D9B3F97EC31809C8282B56/ARDUINO_nextion_dashboard.ino.hex:i"
n 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:\Users\Aron\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM7
         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: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: reading input file "C:\Users\Aron\AppData\Local\arduino\sketches\A825DE41D8D9B3F97EC31809C8282B56/ARDUINO_nextion_dashboard.ino.hex"
avrdude: writing flash (9108 bytes):

Writing | ################################################## | 100% 0.95s

avrdude: 9108 bytes of flash written

avrdude done.  Thank you.

First a question: did the faulty board ever work?

The last screenshot in post #5 does not show an error but usual output if verbose output during upload is not enabled. I know that it's confusing that it's in red.

The screenshot in post #6 shows normal output as well.

You can enable the below so the uploaded code is verified


I do not know for sure what to make from the fact that one board shows as a USB Serial device (as show in the first two screenshots in post #5) and the other one as a Leonardo. First thought would be the driver but in that case both boards would be identified in the same way. Second thought would be if you did burn the correct bootloader?

When you upload a code to boards with native USB (like the Leonardo) part of that code is responsible for the board detection by the computer as well as reaction on the software reset that is issued by the IDE just before the actual upload starts. The variables used by this functionality can be damaged by bugs in your code. Usually your board is either not recognised or does not react on the software reset.

That problem is usually solved by uploading an innocent sketch (e.g. blink) and tapping the reset button when the IDE reports the memory usage.

Ah i see I thought it would give more insight into what was wrong but the old board worked, when I got home and used it on my own computer it didnt work i tried drivers and it still wasnt working so I went to try it on the original PC that it worked on and still nothing. Then I reinstalled IDE and clicked all the installs correctly. And still nothing now were here.

Im getting this error now:

I clicked the verify code after upload

Please post the full verbose output as text, not an image.

Is that the full verbose output of the upload? Does the IDE indicate that the upload failed (notification area right bottom) or does it hang forever uploading?

Well it always looked like it didnt work but i tried it just now and even with what i thought was an error it worked. Its been successfully uploading just the code/serial port wasnt responding and i thought it wasnt uploading properly. I feel dumb now :man_facepalming: