Programming USB to Serial Converter

I have two Arduinos, one Mega 2560 and another Mega ADK.

The “programming port” on either of them is not working. The chip is fine, I am able to communicate (program) them via the ICSP header through a external AVRISP MKII.

Reading online, it instruct me to use a jumper to put the USB to Serial chip in “DFU” mode, however neither arduino is responsive.

Is there a way for me to program those chips (USB to Serial converter) with the AVR ISP?

Please show a photo of your boards

I will get those later, but those are 16U2s. As opposed to CH340s(?)

The USB cables work. I have tested the cable on the AVR programmer, is working. Also the whole setup with a working Mega

By the way - are you sure your USB cable is a data one rather than a charge only one?

Did I understood correct - you have another Mega board that works with the same setup on the same PC?

Yes. I verified it with other devices (The AVR programmer, and another working Mega).

I noted that the AVRISP do not power the target. Very useful in the case of In Circuit Serial Programming

Yes, correct.

Looks like the atmega16u2 on the board lost its firmware...

Correct. That, or the chip is dead.

I wouldnt mind just using the Mega without a USB, but it would be nice to get it back. I have ISPs, so I thought I'd give that a go .. if possible.

the procedure of restoring atmega16u2 firmware should be described somewhere in Arduino docs.
Note that atmega16u2 has its separate ICSP header

Correct. However I have noted in my first post that said instructions are to put the device in DFU mode, while that is impossible to do.

Specifically it's this article:

Flash the USB-to-serial firmware for UNO (Rev3 and earlier) and Mega boards

Which does allow me to get the hex file, even though the instructions are for DFU mode.
Perhaps I will have to manually flash it with the terminal.

xavier@LAPTOP-3010014:~$ avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:'/content/arduino-1.8.19-linux64/hardware/arduino/avr/firmwares/atmegaxxu2/arduino-usbserial/Arduino-usbserial-atmega16u2-MegaADK-Rev3.hex' -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

avrdude error: command failed
avrdude error: bad AVRISPmkII connection status: SDO fail, SCK fail
avrdude error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 125kHz
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000
avrdude error: Yikes!  Invalid device signature.
avrdude warning: expected signature for AT90USB82 is 1E 93 82
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
         To disable this feature, specify the -D option.

Dead chip. Cool. Can confirm this is working on the working Mega:

xavier@LAPTOP-3010014:~$ avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:'/content/arduino-1.8.19-linux64/hardware/arduino/avr/firmwares/atmegaxxu2/arduino-usbserial/Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex' -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9489 (probably m16u2)
avrdude warning: expected signature for AT90USB82 is 1E 93 82
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file /content/arduino-1.8.19-linux64/hardware/arduino/avr/firmwares/atmegaxxu2/arduino-usbserial/Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex for flash
         with 4034 bytes in 1 section within [0, 0xfc1]
         using 32 pages and 62 pad bytes
avrdude: writing 4034 bytes flash ...

Writing | ################################################## | 100% 1.28 s 


...
...
...

avrdude: 1 byte of lock verified

avrdude done.  Thank you.