AVR tool chain on MacOSX

Andreas Höschler <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
Hi Jan and all,

> That's strange as by 4.3.3 the avr6 (subfamily/group where both ATMega256x
> belong) support was certainly already established. I use 4.2.2 for my
> daily work with ATMega2560.
> 
> But it is known to be tricky to build a working package. Your "free" way is
> too suspicious.

I googled a lot on this problem and this time tried to build the chain on MacOSX (recipe below). I still hit the same problem. It simply won't build code for the atmega2560 chip! :-(

	avr-gcc -v

Using built-in specs.
Target: avr
Configured with: ../gcc-4.2.4/configure --target=avr --prefix=/usr/local/avr --enable-languages=c --disable-libssp : (reconfigured) ../gcc-4.2.4/configure --target=avr --prefix=/usr/local/avr --enable-languages=c --disable-libssp
Thread model: single
gcc version 4.2.4


	avr-gcc -mmcu=atmega2560 main.c

	unknown MCU 'atmega2560' specified
	Known MCU names:
	...
	main.c:1: error: MCU ‘atmega2560’ supported for assembler only

When configuring avr-libc (as shown below) I get 

checking if avr-gcc has support for atmega2560... no
checking if avr-gcc has support for atmega2561... no

No wonder it does not work. But gcc-4.2.4 is supposed to have atmega2560 support, isn't it?

I am clueless! :-( Any hints are greatly appreciated. See below for my tool chain cook recipe. I also tried avrfreaks but no response so far!

Thanks,

 Andreas

**************************************************************************************
	PREFIX=/usr/local/avr
	export PREFIX
	PATH=$PATH:$PREFIX/bin
	export PATH

	su -
	cd /usr/src
	mkdir avr
	cd avr
	gunzip binutils-2.24.tar.gz
	gnutar xvf binutils-2.24.tar
	cd binutils-2.24
	./configure --target=avr --program-prefix="avr-" --prefix=$PREFIX
	make
	make install

We download https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 from https://gmplib.org/#DOWNLOAD

	cd /usr/src
	bunzip2 gmp-6.0.0a.tar.bz2
	tar xvf gmp-6.0.0a.tar
	cd gmp-6.0.0
	./configure
	make
	make check
	make install 

We downlaod mpfr from http://www.mpfr.org:

	cd /usr/src/
	bunzip2 mpfr-3.1.2.tar.bz2
	tar xvf mpfr-3.1.2.tar
	cd mpfr-3.1.2
	./configure
	make
	make check
	make install 

We download http://gcc.cybermirror.org/releases/gcc-4.2.0/gcc-4.2.0.tar.bz2:

	cd /usr/src/avr
	mkdir avrgcc
	bunzip2 gcc-4.2.4.tar.bz2
	tar xvf gcc-4.2.4.tar
	cd avrgcc
	../gcc-4.2.4/configure --target=avr --prefix=$PREFIX --enable-languages=c --disable-libssp
	make 
	make install 

We download http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.8.1.tar.bz2:

	cd /usr/src/avr
	bunzip2 avr-libc-1.8.1.tar.bz2
	gtar xvf avr-libc-1.8.1.tar
	cd avr-libc-1.8.1
	./configure --host=avr --prefix=$PREFIX
	make
	make install
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.