Hello,
I have a problem compiling a sketch for Mega 2560. Message is:
++++++++++++++++++++++++
unknown MCU 'atmega2560' specified
Known MCU names:
avr2
at90s2313
at90s2323
...
+++++++++++++++++++++++++
Therefore I have updated my toolchain (I'm using Gentoo). The screen looks like this:
+++++++++++++++++++++++++
Yep, it sounds like your avr toolchain is too old to support the ATmega2560. Unfortunately, I don't know enough about Gentoo to provide good advice about how to get a more recent version.
Thank you for reply. "How to get" should not be the problem. I don't know which version of toolchain I need to support the atmega2560 and where to find the sources.
Note that all versions of avr-gcc currently have some bugs when dealing with C++ code exceeding 64k... I don't think that there is any reason to specifically avoid the latest versions (gcc 4.5.x, avr-libc 1.7), other than version-matching the other distributions...
Wonderful! I can now get the newer versions (1.6.2, 1.6.4, 1.6.8, 1.7.0 possible):
1.) layman -S
2.) emerge -p =cross-avr/avr-libc-1.6.4
3.) add following line to /etc/portage/package.keywords (amd64 keywords only if needed):
"cross-avr/avr-libc * ~* -amd64 -~amd64"
4.) emerge =cross-avr/avr-libc-1.6.4
I will post which version will deal with atmega2560.
Above solution don't work correctly, because the crossdev command overwrite the keywords. A working solution is to add following line to /etc/portage/package.keywords:
"=cross-avr/avr-libc-1.6.8 * ~* ~amd64"
With this I get the following error while compiling avr-libc:
"checking if avr-gcc has support for atmega2560... no"
Now I have solved all problems. The main thing was that the (actual or any last) crossdev has had or do manipulate these files:
-"/etc/portage/package.keywords" (some lines at the and of file)
-"/etc/portage/package.mask" (line: >cross-avr/gcc-Version)
This worked for me:
0.) clean all relevant entries in the files above
1.) emerge --unmerge cross-avr/gcc
2.) emerge --unmerge cross-avr/avr-libc
3.) add 3 lines to "/etc/portage/package.keywords"
=sys-devel/crossdev-20101011 ~amd64
=cross-avr/avr-libc-1.7.0 ~* ~amd64
=cross-avr/gcc-4.5.1 ~* ~amd64
4.) emerge crossdev
5.) USE="-openmp" crossdev -t avr -s4 -S --without-headers
6.) check the version with "avr-gcc --v"
At a problem following files have logged the complete build process:
"less /var/log/portage/cross-avr-avr-libc.log"
"less /var/log/portage/cross-avr-gcc-stage2.log"
"less /var/log/portage/cross-avr-gcc-stage2.log"