This tutorial is for Linux users. It will cover step by step how to flash an Arduino with miscellaneous firmwares (it’s for absolute beginners, you should know Linux quite good to perform this). I use cheap cloned board called Mega Keyes model Mega 2560 R3 with Atmega 2560 16AU. You can also use this method to unbrick your faulty Arduino.
If your using Debian or any of it’s derivatives install the dfu-programmer:
sudo apt-get update && sudo apt-get install dfu-programmer
Download latest firmware:
Or find any other one needed here.
Now connect your device to PC and enter DFU mode. To do that join two pins near USB connector:
It should turn on orange led or simply blink when it’s done.
Now input this commands:
sudo dfu-programmer atmega16u2 erase
To erase previous firmware.
sudo dfu-programmer atmega16u2 flash --debug 1 Arduino-usbserial-mega.hex
To flash new one. It should output:
Validating... 4070 bytes used (33.12%)
And last command:
sudo dfu-programmer atmega16u2 reset
Reset your Arduino.
And this is it 🙂
- If you get: dfu-programmer: no device present using any of dfu-programmer commands you’re not in the DFU mode. Reset your device and short circuit DFU pins mentioned above.
You can turn your Arduino into keyboard or joystick board. Check this amazing project. I’ll cover that in next Arduino episode.
2 thoughts on “How to restore or update Arduino Mega 2560 firmware?”
i’m using ch340 chip,. how to do with this my arduino?