Hello,
I am having an issue that won t allow me to upload code to my Arduino Leonardo. This board its new, i just bought it. I am using a pc, and when i try uploading, it gves me this message:
avrdude: ser_open(): can't open device "\.\COM16": Access is denied.
The Arduino Leonardo is new i don t think is fried, and the COM port works with the other arduinos. I checked my device manager and made sure I have my settings the same as every other port. I made sure I had the proper port selected in tools>port before uploading. I tried several times, so it isn't a one-time thing. Anyone know why this might be?
I moved your topic to an appropriate forum category @talosluca.
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
Which settings? Did you manually interfere with the port settings in Device Manager?
So you have never been able to upload?
==
How Leonardos (and other boards with native USB work):
The board runs your sketch. You will see a COM port in device manager indicating Arduino Leonardo (comX). When the actual upload starts, the IDE resets the board by opening and closing the serial port comX. The Leonardo will reboot and start the bootloader; in device manager, you will see something like Arduino Leonardo bootloader (comY). You will also see the board's L LED slowing fading in and out for approximately 8 seconds. comY is the port that is used for the upload.
==
I'm not sure if I can help with te "Access denied" message.
Which version of Windows?
Which version of the IDE?
Does the Leonardo disappear from the device manager when you disconnect it?
Does your board behave as described above? Do you see the change in device manager?
What happens when you double-tap the reset button? Does the L LED fade in and out? Do you see the change in device manager?
thank you for reply, i have windows 10, the IDE version is 2.1.1, the Leonardo does disapper from device manager when i disconnect it, when i upload a program i don t see the change in device manager and i don t see the board s LED slowing fading in and out, however when i double tap the reset button the LED fade in and out and in the device manager i see arduino leonardo bootloader.
I didnt interfer with the port settings in Device Manager, and i have never been able to upload.
Now it gives me another message:
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:\Users\luca talos smecheru\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM13
Using Programmer : avr109
Overriding Baud Rate : 57600
avrdude: ser_open(): can't open device ".\COM13": The system cannot find the file specified.
I don't know under which circumstances you got that.
So there is hope
Part of the code that you upload handles the USB serial communication; variables used by this can be corrupted by your part of the sketch in which case the Leonardo either does not identify itself and / or does not react on the software reset issued by the IDE.
The first requirement to solve it is that the IDE needs to use a valid port to issue the reset command. The options basically are:
If your Windows has a COM1 in device manager, select that port in the IDE.
If you have a board like an Uno, Mega or classic Nano, connect it and select its port in the IDE. Do not use another board that has native USB.
If you have a TTL-to-USB adapter, connect it to the PC and select its port.
Keep your board as Leonardo.
Next upload an innocent sketch like blink. When the IDE reports the memory usage, double tap the reset button on the Leonardo. The upload should now succeed.
After this, you should be able to perform uploads in the usual way.
Note:
There is a 4th way to get a port but I have not managed to get it working in IDE 2.x (I could in IDE 1.x).
Double tap the reset button and in the IDE select the Arduino Leonardo bootloader port. Start an upload and just before the IDE reports the memory usage double tap the reset button. It's always a bit tricky but if you enable verbose output during compilation in file → preferences you can basically find the right moment; that moment is when you see a line like "linking it all together".
i don t why but now everytime i try to upload it gives me this message:
avrdude: Version "C:\Users\luca talos smecheru\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\luca talos smecheru\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega32u4 -cavr109 "-PCOM6" -b57600 -D "-Uflash:w:C:\Users\luca talos smecheru\AppData\Local\Temp\arduino\sketches\027A870490436DAEC8F2337E3B1B36D6/project_test1.ino.hex:i"
6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
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
Nothing wrong with that as far as I can see. It might be displayed in red but that does not necessarily indicate an error.
If the notification area (right bottom of the IDE 2.x) indicates a successful upload, the upload was successful.
You can make the output less verbose by disabling verbose output during upload under file → preferences. From memory, you will only see this part of the above
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