Arduino DFU-programmer on Mac OS

by Bas van Straaten in Circuits > Arduino

16921 Views, 13 Favorites, 0 Comments

Arduino DFU-programmer on Mac OS

Uno-front-DFU-reset.png.jpeg

Did you ever needed to change firmware on the Arduino, for example to use it as a MIDI device? Here is a guide to upload new firmware onto your Arduino using an Apple computer.

If you ever uploaded new firmware on the Arduino using a Windows computer, you know this isn't to difficult: Using the application FLIP you're able to select the firmware file and FLIP will do the rest for you. However, on Apple computer, things are a little bit more complicated, because FLIP is Windows only. This guide will explain what steps are needed in order to successfully flash your Arduino to run a different software.


Before we start, there are some programs you need to download

1. First, download and the dfu-programmer file and unzip it.

2. Open the terminal application and navigate to the unzipped file by typing in the file path. If the file is saved in your download folder, the command will look like this:

cd Downloads/dfu-programmer-master

3. Type the following command:

./bootstrap.sh

(Press the enter key)


./configure

(Press the enter key)<br>

make

(Press the enter key)


make install

(Press the enter key)

4. The dfu-programmer is install now. Download a firmware (.hex) file you want to upload to your Arduino. Or if your Arduino appears to be dead and you want to restore it, the hex file can be found in the Arduino hardware folder.

Uploading the New Firmware

Uno-front-DFU-reset.png.jpeg

Now it's time to flash the new firmwarm onto your Arduino:

1. Connect your Arduino using a USB cable.

2. Open the Terminal application.

3. In Terminal, navigate to where you stored the hex file. Since I saved the firmware for my Arduino in the Download folder, I type:

cd Downloads/

4. Put your Arduino into DFU-mode by connecting the pins shown in the picture for 1 or 2 seconds.

5. Type in the Terminal window:

 sudo dfu-programmer atmega16u2 erase

If you are asked for a password, type in your master account password.

6. Type in the Terminal window:

dfu-programmer atmega16u2 flash [the name of your firmware file].hex

For example:

dfu-programmer atmega16u2 flash dualMoco.hex

7. Type in the Terminal window:

 dfu-progammer atmega16u2 reset

8. You are done! Reconnect your Arduino and you should be good to go!

___

___

Troubleshooting:

If you get an error 'no device present', it's likely you haven't put your Arduino into DFU the right way or that software is missing. May you encounter any other errors during the process, do not hesitate to ask in the comments for help. I will do my best to help you!