The latest version is always at the SourceForge.net WinAVR download page.SourceForge.net WinAVR download page. To program AVRs in Mac OS X, you will need the free avr-gcc compiler, avr-libc, AVRDUDE, and other associated tools. Download the CrossPack for AVR Development, which is packaged as a.dmg file. Open the.dmg file, and double-click on CrossPack-AVR.pkg.
AVRDUDEis a utility todownload/upload/manipulate the ROM and EEPROM contents of AVRmicrocontrollers using the in-system programming technique (ISP).
Documentation
Documentation can be downloaded from thedownload area,or read online here.
History
AVRDUDE has once been started by Brian S. Dean as a private projectof an in-system programmer for the Atmel AVR microcontroller series,as part of the Opensource and free software tools collection available forthese controllers. Originally, the software was written for the FreeBSD operating system,maintained in a private CVS repository, and distributed under the nameavrprog.
Due to the growing interest in porting the software to otheroperating systems, Briandecided to make the project publically accessible onsavannah.nongnu.org. The name change to AVRDUDE has been chosen toresolve the ambiguity with the avrprog utility as distributedby Atmel together with their AVRstudio software.
Main features
The major features of AVRDUDE include:
|
How to get help or report bugs
To get support for AVRDUDE, or get in contact with other users ofthis tool, see the avr-chatmailing list.
Avr Gcc Linux
People who want to contribute in some way to the project cansubscribe to the avrdude-devmailing list, and get in contact with the developer teamthere.
If you are certain you found a bug in AVRDUDE, you can open a bugreport.
There is not much developers' documentation for AVRDUDE so far.There is a Developers' Corner withsome random articles.Some more information is available at Brian's private site.
Last modified: Fri Jan 8 09:14:46 CET 2010 This document contains instructions to build AVR and ARM cross compilers on Mac OS X from source packages. Note, that precompiled binaries are available in our download area.
So far, only the ARM toolchain had been tested on Leopard, running on a PPC. Be warned, that building on other OS X releases or building the AVR toolchain may not work as described.
Installing Xcode
Apple's Xcode package contains all the tools we need to build the cross toolchain. Open Terminal and enter
If the response is similar to
then GCC is already available and probably there is no need to install it again. However, if the response is
then you need to download Xcode from
developer.apple.com/tools/xcode/
developer.apple.com/tools/xcode/
A registration is required, but this is free of charge.
Leave the Terminal window open. We'll need it later on.
Download Toolchain Sources
In the Terminal window create a new directory and change to it. Feel free to use any name and create it at any place.
Now use the following commands to download the sources.
Additionally we need the C libraries, avr-libc for the AVR or newlib for the ARM platform. Get the newlib sources with
The avr-libc sources can be downloaded with
Next we unpack the sources, using
and
for the AVR library or
for the ARM library. Note the different option -xzf for the gzipped newlib. Each command takes at least several seconds to execute.
We will finally end up with 3 new subdirectories in our toolcahin folder. You may remove the downloaded archives or keep them in case you want to start all over again later on.
Build Environment Setup
The toolchain will be built in 5 steps:
- Building the binary utilities
- Building the compiler
- Building the libraries
- Rebuilding the compiler (ARM)
- Building the debugger
In the second step we get different results while building for AVR or ARM. For ARM targets we are building an intermediate compiler first, which is rebuilt in step 4.
The last step, building GDB, is optional and needed for in-circuit debugging only. This requires some additional tools, which are not discussed in this document.
In all steps we are going to use the same environment. Thus, once set in the Terminal window, you need to keep the window open to preserve these settings.
First we specify the target platform:
for the AVR or
for the ARM toolchain. For both targets we set
which defines the directory where the final binaries will be installed. If you prefer any different location, go ahead. Within this folder we need to create a bin directory in advance and add that to our PATH variable.
Note, that we need root authorization to access the path /usr/local, which had been stored in the variable $prefix. Thus the prepended sudo command, which will prompt you for your user password. If you chose a different location, this may not be required.
Building the Binary Utilities
GNU binutils is a collection of binary tools, which needs to be build first. As with all parts of the toolchain, we create a specific build directory inside the package's directory.
The next command, which configures the build, differs slightly among targets. For the AVR we simply use
while the ARM requires
When this went through without errors, we can start building and installing the binaries.
This will take several minutes. When done, try
Avr Gcc Tutorial
to check the AVR build or
to check the ARM variant.
This should display the GNU assembler version information. If the command can't be found, check your PATH and prefix settings.
Building the Compiler
Building the ARM compiler requires a readily built library. Building the newlib library, however, requires a compiler. To solve this chicken and egg problem, we build an intermediate bootstrap compiler first, which requires the library's header files only. For the AVR, however, the final compiler is built in this step.
For both targets, create a build directory and change to it.
As expected, the configure options differ among our targets. For the AVR use
The intermediate ARM compiler is configured as follows.
Note, that we may need the sudo command to gain access to the installation directory, where the newlib header files will be copied to.
Building and installing the AVR compiler is done using the standard commands.
To build and install the intermediate ARM compiler use
Again, this will take several minutes. When done, we can use
to test the AVR compiler or
for the ARM compiler. This should display the compiler version information.
If the build fails, you may try to exclude the C++ compiler by simply removing ,c++ from the --enable-languages option.
Building the Libraries
As stated earlier, we use avr-libc for the AVR and newlib for the ARM.
To configure the AVR build, use
Note the grave accents, acute accents will not work.
The following commands are used to configure the ARM library.
Both libraries are built with
Rebuilding the Compiler
As explained above, this step is only required when building for the ARM target.
Building the Debugger
Even if we do not have all tools available for in-circuit debugging, it is a good idea to build the GNU debugger now, so it will be available later. Here are the related commands, valid for both targets:
Stripping the Binaries
In an additional step we may strip the installed binaries to save disk space and decrease load times.
What's Next?
Now we have all tools available on our OS X machine to create firmware binaries for AVR and/or ARM target boards, either from C, C++ or assembler source code.
If you want to compile applications running on Nut/OS, you may now download the Ethernut package from the local download page.
Avr Gcc Compiler
Selecting a tool for uploading firmware binaries to your target board highly depends on the specific CPU and the programming adapter being used. For AVR targets, AVRDUDE is a good choice, while we recommend OpenOCD for ARM targets.
The document OpenOCD and Ethernut 3 contains additional information about installing and running OpenOCD on a Mac.
Finally you may want to set up an integrated development environment, which includes a source code editor, compiler, linker, debugger and more. If you are already familiar with Xcode, this might be the right way to go. If you are, like me, working on several different platforms, then Eclipse is probably a good choice.
External Links
dirkraffel.wordpress.com/2008/02/22/building-a-gnu-arm-cross-compiler-toolchain-on-mac-os-x/
Building a GNU ARM cross-compiler toolchain on Mac OS X.
Building a GNU ARM cross-compiler toolchain on Mac OS X.
www.nslu2-linux.org/wiki/HowTo/SetUpAToolChainOnAMac
Describes another way to set up an ARM toolchain on Mac OS X.
Describes another way to set up an ARM toolchain on Mac OS X.
www.cocoamachine.com/blog/
Blog about setting up a cross development for the iPhone, which is based on an ARM CPU.
Blog about setting up a cross development for the iPhone, which is based on an ARM CPU.
developer.apple.com/tools/xcode/
Xcode is Apple's premiere development environment for Mac OS X.
Xcode is Apple's premiere development environment for Mac OS X.
gcc.gnu.org/
Homepage of the GNU Compiler Collection.
Homepage of the GNU Compiler Collection.
www.gnu.org/software/binutils/
GNU Binutils' homepage.
GNU Binutils' homepage.
sourceware.org/gdb/
GDB, the GNU Project Debugger.
GDB, the GNU Project Debugger.
Avr Gcc Download Mac Software
www.eclipse.org/
An open development platform based on Java.
An open development platform based on Java.
savannah.nongnu.org/projects/avrdude/
AVRDUDE is software for programming Atmel AVR Microcontrollers.
AVRDUDE is software for programming Atmel AVR Microcontrollers.
Gcc Download Windows
openocd.sourceforge.net
The Open On-Chip Debugger aims to provide debugging, in-system programming and boundary-scan testing for ARM based target devices.
The Open On-Chip Debugger aims to provide debugging, in-system programming and boundary-scan testing for ARM based target devices.