Random Ranting (150) · Gadgets & Tech (15) · Anime & Otaku (11) · Watches & Horology (43) · Movies & TV (6) · Photography (3)


Ads

Latest Posts Recent Comments Comrades


My blog is worth $4,516.32.
How much is your blog worth?


AVR Toolchain on OS X

UPDATE: Get the AVR MacPack instead of running the script below here.

AVR MacPack is a development environment for Atmel’s AVR microcontrollers running on Apple’s Mac OS X, similar to WinAVR for Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE uploader and several other useful tools.

Here is the important bit from the modified script,

#
#	13/11/2006
#	Michael de Silva
#	mike@bsodmike.com
#
#	This is a modified version of the script located at,
#	http://www.harbaum.org/till/macavr/index.html
#
#	Initially this script would download the files from the
#	two repositories and proceed to compile the toolchain.
#	However, I experienced problems with this script in its
#	original condition, hence this update.
#
#	This script now requires the user to download the source
#	packages as follows,
#
#	ftp://ftp.gnu.org/pub/gnu
#	-binutils
#	-gcc
#	-gdb
#
#	http://savannah.nongnu.org/download
#	-avr-libc
#	-uisp
#	-avrdude
#
#	...and place these in ~/src.  The script will halt if these
#	are not located.
#
#	The 'toolchain definitions' listed below should match the
#	versions of the downloaded files.

# 	updated for latest versions on 13 November 2006
BINUTILS=binutils-2.17
BINUTILS_PACKAGE=${BINUTILS}.tar.bz2

GCC=gcc-4.1.1
GCC_PACKAGE=${GCC}.tar.bz2

GDB=gdb-6.5
GDB_PACKAGE=${GDB}.tar.bz2

AVRLIBC=avr-libc-1.4.5
AVRLIBC_PACKAGE=${AVRLIBC}.tar.bz2

UISP=uisp-20050207
UISP_PACKAGE=${UISP}.tar.gz

AVRDUDE=avrdude-5.2
AVRDUDE_PACKAGE=${AVRDUDE}.tar.gz

#	Proceed to install,
#		-wget
#		-bison
#		-flex
#
#	...by utilising the following command-line,
#	$ sudo fink install wget bison flex

And after running this script I had this output confirming what was installed,

---------------------------------------------------------------------------
These are the current installed versions of the avr tool chain:

--binutils--
GNU ld version 2.17
GNU assembler 2.17

--gcc--
4.1.1

--gdb--
GNU gdb 6.5

--avrlibc--
4.1.1

--uisp--
uisp version 20050207

--avrdude--
avrdude: Version 5.2, compiled on Nov 13 2006 at 09:13:01
--------------------------------------------------------------------------------
Make sure to have /usr/local/avr/bin in your PATH
You can do this by adding the following
line to your /Users/michaeldesilva/.bashrc file:
    export PATH=$PATH:/usr/local/avr/bin

And for manpages, add the following line:
    export MANPATH=$MANPATH:/usr/local/avr/man

--------------------------------------------------------------------------------

This script maybe downloaded here.

3 Comments »

  1. bsodmike said,

    January 20, 2007 @ 17:50

    I received an email from John who found this article helpful, thanks for letting me know :)

    Mike: Just wanted to thank you for the AVR-MAC GCC install script. I’m new at GCC and easily upgraded the GDB and AVRDUDE to more recent versions.

    It all worked great and I’m up and learning! Now importing it into Eclipse and with my Dragon, I have a bitchin open-source free IDE/devel system on my old G3 ibook!!

    THANKS!!!

    John Cutler

  2. Bernie Walp said,

    April 4, 2007 @ 16:55

    Hi bsodmike,

    I wish I had seen your page a week ago. It succinctly presents what it took me a week to stumble through, reading other people’s experiences.

    What about assembler on MAC OS X ? when I say avr-as samplecode.asm I get a thousand complaints, starting with
    2313def.inc:38: Error: unknown pseudo-op: `.device’

    Thanks,
    Bernie

  3. bsodmike said,

    April 4, 2007 @ 17:11

    Hi Bernie,

    Glad you found this useful!

    Seems that it is not happy with your definition of the device in your samplecode.asm. Quite frankly I never tried the asm compiler as I tend to do as much in C and if I need asm I’d swap to ‘in-line’ asm.

    Cheers and please keep in touch. If you find that you have anything to contribute to helping others getting up to speed with AVR, please just drop me an email…

    Regards
    Mike

RSS feed for comments on this post · TrackBack URI

Leave a Comment


Google Search


RSS/Meta Articles