AVR/Adruino dev with a MAC OSX

Earlier this year I replaced my trusty old Samsung laptop with a (wonderful) MacBook Air. The Samsung had all the tools on it that I had been using for AVR/Arduino (etc) development, but with it being spring & then summer, my focus was elsewhere and I had not ventured into installing the development tools on the Mac yet.

So, I've now been trying to get the same Eclipse/AVR-gcc development stack running running on my new MacBook Air.

It took a while but is now working reasonably well. There was a few problems, solved by lots of googling and trying things, so the notes below may help others (or just help remind me if I have to set it up again).

Arduino IDE
Version: 1.0.5 -- latest stable version at the time
This was easy - download the installation package (dmg) from the arduino website, install and it worked 'out of the box'

Somewhere along the way since I got the MacBook I have had to install XCode and macports -- it may have been related to Arduino/GCC tools or may have been related to some unrelated Python dev dev work. but this seemed to have installed older versions of AVRDude that tripped me up later... (beware!)

Eclipse/AVR-gcc
The Arduino website has a pretty good write-up at http://playground.arduino.cc/Code/Eclipse . Note that there is now a paragraph at the top mentioning the "Arduino Eclipse plugin" -- apparently a very very easy way to use Eclipse as an IDE for Arduino development. This is new since I first installed this dev stack on my old Windows laptop but I opted to stick with the AVR tools route as ultimately I aim to reduce (or eliminate) dependancy on the stock Arduino libraries and some of the 'walled garden' of the Arduino environment - which I figured would be harder to do using the Arduino Eclipse plugin. If you take the Arduino plugin route then the rest of this page probably wont apply.

The Eclipse install was straight-forward -- I selected Eclipse Kepler, CDT version -- I have no interest in Java development so getting the C tools included seemed easier than adding them myself later. Click & run install -- all was fine

I think I added the following:
- AVR Eclipse Plugin
- Subversive SVN (back on my Windows laptop I had had more luck with Subversive than Subclipse, so stuck with it on that basis)
Problems encountered (I should elaborate....)
- Eclipse would not compile the C/C++ code, yet paths configured in Eclipse (Eclipse/Preferences/AVR/Paths) to AVR-GCC looked right. It turned out they were pointing to macports list of available ports, not actual installs.
- Also AVRDUDE turned out to be wrong
- Installed CrossPack (http://www.obdev.at/products/crosspack/index.html), noted the paths (/usr/local/CrossPack-AVR/) and put these in Eclipse as Custom paths (not System ones - which were pointing to macports)
- AVRDUDE would not communicate over USB with my Arduino Uno
- OSX was grabbing the FTDI serial and trying to open some sort of network over it (remember SLIP/PPP?), meaning it was reported as 'busy' to the Arduino IDE. This was stopped by going to the OSX network pane (System Preference / Networks) and then removing (- at bottom of window) all Arduino & FTDI references
- Not knowing correct config, tried a load of guesses till found that "avrdude -P /dev/cu.usbmodem1421 -c arduino -p m328p -n" would work

Actual setting in Eclipse that works:
AVR/AVRDude:
- Create new Programmer Configuration, set Programmer Hardware to "Arduino", set Override default port to /dev/cu.usbmodem1421; leave baudrate blank