Arduino DFU-programmer on Mac OS

About: Design student, wantrepeneur, lifelong learner. Oh, also running a small 3D printing business.

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.

Step 1: Uploading the New Firmware

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!

Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • PCB Contest

      PCB Contest
    • First Time Author

      First Time Author

    9 Discussions

    0
    None
    VikT1

    9 months ago

    Got stocked at step 3:

    ./bootstrap.sh

    ./bootstrap.sh: line 2: aclocal: command not found

    ./bootstrap.sh: line 3: autoheader: command not found

    ./bootstrap.sh: line 4: automake: command not found

    ./bootstrap.sh: line 5: autoconf: command not found

    This instructable seems to be outdated a bit or IDK... but it's just not working

    0
    None
    hmarcotte

    1 year ago

    Hi,

    I'm using an Atmega32u4 and I'm getting the 'no device present' message. from what I read, the Atmega32u4 doesn't have a DFU mode. What do you think I should do? I've been researching the subject for a while now. Thanks.

    0
    None
    EDD43

    1 year ago

    muchas gracias desde bcn!
    muy útil!

    0
    None
    BálintB13

    1 year ago

    What can I do if I get that no device present? (I checked the wiring of the reset pin too, and it's ok)

    0
    None
    desayuno

    1 year ago

    Im having a problem at the make step: fatal error: 'libusb.h' file not found

    anyone has found a solution for this issue?

    0
    None
    Yaeltex

    2 years ago

    Hi! Thanks for this instructable.

    However, i'm getting this when executing "./bootstrap.sh" command

    "sh: autom4te: command not found

    aclocal: error: echo failed with exit status: 127

    ./bootstrap.sh: line 3: autoheader: command not found

    sh: autoconf: command not found

    automake: error: autoconf failed with exit status: 127

    ./bootstrap.sh: line 5: autoconf: command not found"

    Any idea what's missing and how to solve it?

    3 replies
    0
    None
    Bas van StraatenYaeltex

    Reply 2 years ago

    I might have found a solution, you need to install homebrew. To do so, run this command in the terminal:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/instal...

    Please let me know if it worked!

    0
    None
    YaeltexBas van Straaten

    Reply 2 years ago

    It didin't.

    I've copy pasted that line into my terminal, but seems incomplete

    0
    None
    Bas van StraatenYaeltex

    Reply 2 years ago

    hmm, it looks like Instructables cut off my link, here's the source:

    http://stackoverflow.com/questions/37867376/dfu-programmer-0-6-2-error-message-during-bootstrap-sh