Resetting the Arduino Uno R3 Atmega16U2

I got the dfu-programmer to build on OSX Lion 10.7.3 with the following steps:

  • Install Xcode 4.3 from the Appstore
  • Install Xcode command line tools from Xcode preferences (see Documentation Archive).
  • Tell Xcode where Xcode is installed: sudo xcode-select -switch /Applications/Xcode.app
  • Set up a link for the missing clang executable: cd /Applications/Xcode.app/Contents/Developer/usr/bin; sudo ln -s clang llvm-gcc; cd -
  • Install macports from http://www.macports.org/
  • Install autoconf tools via macports: sudo port install pkgconfig automake
  • Install libusb via macports: sudo port install libusb-devel
  • Configure and build dfu-programmer: cd dfu-programmer-0.5.4; ./bootstrap.sh; ./configure; ./make; ./sudo make install

After this you should be pretty much set for building other packages and tools too. You can also search for available packages using the macports search command.

For example:

port search libusb
libusb @1.0.8 (devel)
    library for USB device access

libusb-compat @0.1.3 (devel)
    library for USB device access

libusb-devel @1.0.8.20101017 (devel)
    library for USB device access

libusb-legacy @0.1.12 (devel)
    Library providing access to USB devices