So I decided it would be a good idea to flash a firmware onto my mega 2560 for a project. I ended up flashing the wrong side of the ICSP header (one near the usb plug/ M16U2) and killed my arduino for the most part. I'm a newb for the most part when it comes to this. I plug it in and the 'L' light is on with the 'ON' light as well. Wont show up in device manager, can't load sketches and can't get into DFU mode.(REV3 has DFU right?)

I have both a usbasp and USBtinyisp programmer and have tried 5 - 10 firmwares on both sides of the headers in hopes I can get it to work again.Literally almost tried everything I could find to get it to flash back. One guide I did find that got me somewhere was this though:


It appears to flash correctly with whatever firmware I use, but cannot pull the firmware off it to check or do the rest of what it says.My guess is that 1 or 2 of the firmware's are gone. Have erased the firmware/relfashed and tried to flash in the IDE with no luck in it working.

I did use this command to read the firmware(or lack of) on both sides of the header to get a better idea of what might be going on:


I don't know if I'm supposed to flash one side first then the other or flashing one will be able to do both at the same time. Here is an example of how I would flash from avrdude:

avrdude -C avrdude.conf -P usb -p m16u2 -b 1200 -c usbasp flash:w:Arduino-COMBINED-dfu-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

With each side I would set the correct the fuses from what that file pulled up. So if anyone knows what I'm doing wrong for why it is not working I'd appreciate the help. Just don't know if I can save this or it's gonna end up in the garbage.Thanks

  • 1
    this github.com/arduino/Arduino/blob/master/hardware/arduino/avr/… is the one you'd need for the 16u2. For the 2560 you'd need github.com/arduino/Arduino/blob/master/hardware/arduino/avr/… . First do the 16u2. After that you should see something in the device manager.
    – Gerben
    Sep 29, 2015 at 13:00
  • I tried it but didn't have any luck getting to work once plugging it back in to the laptop. Maybe i'm doing the wrong lock fuse or something. To me though it looks like it is flashing. pastebin.ca/3178364
    – Woolfy
    Sep 29, 2015 at 18:53
  • I got a board with the symptoms you described. I ended up removing the 16u2 as I found out it was faulty, the board works now (without any USB of course) so if you can make sure the mega2560 chip works and the 16u2 doesn't and you are not bothered by the lack of USB connection then you can do the same.
    – Avamander
    Sep 29, 2015 at 19:49
  • I think i could possibly live without it but i just can't seem to get a firmware to stay on either one of them. Starting to wonder if there are certain steps to flashing that i'm missing besides what i have been doing.(erasing/unlocking/flashing/locking of the firmware) When i look over everything, it seems like it should all be good. Gonna keep trying and see if i can get a firmware to stick.
    – Woolfy
    Sep 29, 2015 at 20:07
  • 1
    It looks like it's back to working :) I flashed both side's with the firmware 'Gerben' mentioned using the guide in the link above.(* Setup Fuses unlocking bootloader * Burn the bootloader * Setup Fuses locking bootloader) From what it looks like it was because i didn't unlock/lock in the firmwares correctly and or the right firmware. For whatever reason i'm on COM4 instead of COM3 now but i can upload sketches and seems to have no issues. Hopefully someone else will be able to use this if they end up messing up there firmware to fix it. Appreciate all the help.
    – Woolfy
    Sep 29, 2015 at 20:54

1 Answer 1



Change fuses/firmware depending on which side you are flashing (M2560/M16U2)

Firmwares: Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex / stk500boot_v2_mega2560.hex

1st command:

avrdude -C avrdude.conf -P usb -p m16U2 -b 57600 -c usbtiny -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

2nd command:

avrdude -c usbtiny -p m16U2 -P usb -b 115200 -V -U flash:w:Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex

3rd command:

avrdude -c usbtiny -p m16U2 -P usb -b 115200 -U lock:w:0x0F:m


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.