MEGA 2560 port issue

I've recently bought my first Arduino (MEGA 2560) from RS and I'm having issues connecting to it.

I'm trying to connect on Linux Mint 20.2 Cinnamon but have also tried it on a windows 10 machines with similar issues.

When plugged in the MEGA is detected but doesn't assign a port. In the IDE the tools_Port menu is greyed out.

I get the following from terminal commands, can anybody help?

$ lsusb

Bus 001 Device 020: ID 03eb:2fef Atmel Corp. atmega16u2 DFU bootloader

$ dmesg

[ 490.794949] usb 1-6.2: new full-speed USB device number 20 using xhci_hcd
[ 490.897571] usb 1-6.2: New USB device found, idVendor=03eb, idProduct=2fef, bcdDevice= 0.00
[ 490.897577] usb 1-6.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 490.897581] usb 1-6.2: Product: ATmega16u2 DFU
[ 490.897584] usb 1-6.2: Manufacturer: ATMEL

$ usb-devices

T: Bus=01 Lev=02 Prnt=03 Port=01 Cnt=01 Dev#= 20 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=00 MxPS=32 #Cfgs= 1
P: Vendor=03eb ProdID=2fef Rev=00.00
S: Manufacturer=ATMEL
S: Product=ATmega16u2 DFU
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#=0x0 Alt= 0 #EPs= 0 Cls=00(>ifc ) Sub=00 Prot=00 Driver=(none)

$ lsusb -v

Bus 001 Device 019: ID 03eb:2fef Atmel Corp. atmega16u2 DFU bootloader
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 1
bDeviceProtocol 0
bMaxPacketSize0 32
idVendor 0x03eb Atmel Corp.
idProduct 0x2fef atmega16u2 DFU bootloader
bcdDevice 0.00
iManufacturer 1 ATMEL
iProduct 2 ATmega16u2 DFU
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0012
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 0
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0000
(Bus Powered)

$ sudo lshw

             *-usb:0 UNCLAIMED
                  description: Generic USB device
                  product: ATmega16u2 DFU
                  vendor: ATMEL
                  physical id: 2
                  bus info: usb@1:6.2
                  version: 0.00
                  capabilities: usb-2.00
                  configuration: maxpower=100mA speed=12Mbit/s

I think that means the 16u2 processor used for USB-to-Serial is waiting for a firmware upload. :frowning:

You should be able to use the Atmel FLIP program to upload new firmware. Here are instructions:

Thanks for the advice, after a little trial and error I managed to upload a firmware.

The issue I now have is timeouts when trying to program it.

if I try to upload blink with the web editor I get -

Upload started

Programming with: Serial

Flashing with command:/home/dave/.arduino-create/arduino/avrdude/6.3.0-arduino17/bin/avrdude -C/home/dave/.arduino-create/arduino/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega2560 -cwiring -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/arduino-create-agent918660697/Blink.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 "/home/dave/.arduino-create/arduino/avrdude/6.3.0-arduino17/etc/avrdude.conf"

User configuration file is "/home/dave/.avrduderc"

Using Port : /dev/ttyACM0

Using Programmer : wiring

Overriding Baud Rate : 115200

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you

I'm not sure If I made a mistake and selected the wrong hex when updating the firmware.

I get the following now

$ lsusb

Bus 003 Device 005: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM)

$ dmesg

[ 5322.852900] usb 3-2: new full-speed USB device number 5 using xhci_hcd
[ 5323.035892] usb 3-2: New USB device found, idVendor=2341, idProduct=0042, bcdDevice= 0.01
[ 5323.035899] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 5323.035902] usb 3-2: Manufacturer: Arduino (www.arduino.cc)
[ 5323.035904] usb 3-2: SerialNumber: 85036313230351900231
[ 5323.082963] cdc_acm 3-2:1.0: ttyACM0: USB ACM device

$ usb-devices

T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=02(commc) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=2341 ProdID=0042 Rev=00.01
S: Manufacturer=Arduino (www.arduino.cc)
S: SerialNumber=85036313230351900231
C: #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=100mA
I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I: If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

There seem to be three choices but I don't know which is the 'right' one:
Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex
Genuino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-R3.hex
MEGA-dfu_and_usbserial_combined.hex

Maybe try each one?

I used the first on on your list.

I used dfu-programmer to flash the hex file and it looked as though it worked because the com port was there in the IDE. I've tried to put the mega 2560 back into DFU mode by shorting the two pints closest to the USB port but nothing changes,

Do you or anyone else know of a different way to put the Arduino Mega 2560 into DFU mode?

If I cannot get the USB working is it easy enough to program the Mega with the serial port?

Is there an LED blinking about once per second on the Mega? If the atmega16u2 was not preprogrammed, its possible the bootloader was not put onto the atmega 2560 either.

Since I purchased the mega the green power LED has always been on and the orange LED (the one above the Tx/Rx LEDs) has always been on. I haven't had any blinking LEDs. When I tried programming it, the Rx LEDs has flashed.