COM-port issue: Device detected on one COM port, but program on another

Hey.

I have just started using an Arduino Yun.

I have written my code in Atmel Studio since I need some of the drivers for a different Atmel processor, so I have been working with AVRDUDE but I am unable to ‘reach’ the programmer.

I get this output from the Arduino IDE (the IDE can program the board)
PORTS {COM1, } / {} => {}
PORTS {} / {COM5, } => {COM5, }
Found upload port: COM5
D:\Programmer\Arduino\hardware\tools\avr/bin/avrdude -CD:\Programmer\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM5 -b57600 -D -Uflash:w:C:\Users\steph\AppData\Local\Temp\build821963fd217da1370951c490bf15d7c9.tmp/Blink.ino.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is “D:\Programmer\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

I left the rest out since this is the important part.

But I can’t find any way to make AVRDUDE do this:

PORTS {COM1, } / {} => {}
PORTS {} / {COM5, } => {COM5, }
Found upload port: COM5

in Atmel Studio. Anybody have a solution?

What is your development system? Window/Mac/Linux/Other?
It looks like Windows, but it is good to make that obvious.
And of course, which version of windows - if you are using windows.

Jesse

The Yun’s USB interface does indeed show up as two different COM ports: there is one port for serial communications from the sketch, and a different COM port for use by the bootloader. When uploading a sketch over the USB port, the IDE first resets the processor to make it enter bootloader mode, then waits for the Yun’s current port to go away and the bootloader to appear. Then it runs avrdude to do the actual upload (avrdude, of course, needs to be talking to the bootloader.)

You included the IDE output, but missed a critical line, the one just above the lines you posted. For example, on my computer, I get:

Forcing reset using 1200bps open/close on port COM11
PORTS {COM5, COM11, } / {COM5, } => {}
PORTS {COM5, } / {COM5, COM12, } => {COM12, }
Found upload port: COM12
D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CD:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM12 -b57600 -D -Uflash:w:C:\TEMP/Blink.ino.hex:i

The IDE forces the processor into bootloader mode by opening the USB serial port at 1200 baud, and then quickly closing it. This causes the regular serial port to go away (COM11 in my case above) and the bootloader port to appear (COM12 in my case.)

I can think of three options for you:

  • Write a little program that runs on your PC just before you run avrdude. This program opens the Yun’s serial port at 1200 baud, and then immediately closes it and exits.
  • Manually reset the processor with a double tap on the Yun’s 32U4 RST button. While a single tap resets the sketch, a double tap makes it enter the bootloader for a few seconds (you can see the red LED “breathing” while in bootloader mode. Quickly start avrdude while the LED is breathing.
  • Use the Yun’s Linux processor to load the sketch. You can do this using the “Upload Sketch” section of the Yun’s opening configuration web page, or you can copy the hex file to the Linux side (probably using WinSCP?) and then at the SSH command line run /usr/bin/merge-sketch-with-bootloader <sketch.hex> followed by /usr/bin/run-avrdude<sketch.hex>.

@Shapeshifter,
are we assuming Windows or the Windows VM?

Jesse

jessemonroy650:
@Shapeshifter,
are we assuming Windows or the Windows VM?

My example is Windows, and from the looks of the device names in the OP's captured output, he's also running Windows. But the recommendations I make should be platform agnostic as they are based on attributes of the Yun's Catarina bootloader, and not on any attributes of the host operating system.

Okay. I don't own any windows systems any more.

Jesse