Problems with uploading over avrdude in Atmel Studio 7

Hello All

I am new on programming Arduino and work at the moment with a brand new Arduino Beetle Leonardo from DFRobot with the ATMega32U4 on it.
I have average knowledge on c-programming and the board runs with Arduino IDE and some sample programs without problems.

At the moment i stuck on some point:
If i want to use the Atmel Studio 7 and configure the "External Tool" with the specific Command and Arguments, or i want to use the avrdude over command line,
i have problems to program the device. The
The thing what makes me confuse is, that the Arduino Leonardo is recognize at COM-Port Nr.5 and also the Serial Monitor works on this COM-Port Nr.5.
But as you can see in the beginning of the verbose output of the Arduino IDE while programming, it changes somehow to Com-Port Nr. 6.
I can not find any information about that, and also nothing about this syntaxes "PORTS {COM5, } / {} => {}" and "PORTS {} / {COM6, } => {COM6, }".


Arduino IDE Verbose Output:

Sketch uses 3560 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 COM5
PORTS {COM5, } / {} => {}
PORTS {} / {COM6, } => {COM6, }
Found upload port: COM6
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM6 -b57600 -D -Uflash:w:C:\Users\xxxx\AppData\Local\Temp\arduino_build_486853/Blink.ino.hex:i

avrdude: Version 6.3-20190619
[...]

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

Using Port : COM6
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\xxxx\AppData\Local\Temp\arduino_build_486853/Blink.ino.hex"
avrdude: writing flash (3560 bytes):

Writing | ################################################## | 100% 0.28s

avrdude: 3560 bytes of flash written
avrdude: verifying flash memory against C:\Users\xxxx\AppData\Local\Temp\arduino_build_486853/Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\xxxx\AppData\Local\Temp\arduino_build_486853/Blink.ino.hex:
avrdude: input file C:\Users\xxxx\AppData\Local\Temp\arduino_build_486853/Blink.ino.hex contains 3560 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.04s

avrdude: verifying ...
avrdude: 3560 bytes of flash verified

avrdude done. Thank you.


The following message i get in Atmel Studio 7 with the Command and Arguments from Arduino IDE.


Atmel Studio 7 Output:
avrdude.exe: Version 6.3-20190619
[...]

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

Using Port : COM6
Using Programmer : avr109
Overriding Baud Rate : 57600
avrdude.exe: ser_open(): can't open device "\.\COM6": Das System kann die angegebene Datei nicht finden.

avrdude.exe done. Thank you.


And when i change the Argument from COM-Port Nr.6 to COM-Port Nr.5 as the Computer recognize the Arduino in the Device Manager,
it gives the following Error message in the Output:


Atmel Studio 7 Output:

avrdude.exe: Version 6.3-20190619
[...]

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

Using Port : COM5
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: .avrdude.exe: butterfly_recv(): programmer is not responding

avrdude.exe: butterfly_recv(): programmer is not responding


Anyone somehow an idea why the Arduino IDE makes this kind of "switch" of the COM-Port while uploading the program? And why i can not use the avrdude in Atmel Studio 7?

Thanks for your help!

Kind
Regards

Hello All!

I could now program my Arduino Leonardo Beetle with Atmel Studio 7 with the following Arguments in the External Tools settings:
-C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega32u4 -cavr109 -PCOM6 -b57600 -D -Uflash:w:"$(ProjectDir)Debug$(TargetName).hex":i

I found help in this Forum:
https://www.avrfreaks.net/forum/solved- ... do-avrdude
So, this explain also, why the Arduino IDE changes to another COM while uploading a sketch.

So for me it helps to force the reset over the !RESET input pin 13 of the ATMega32U4 to GND with a switch button.

Kind
Regards