unknown MCU 'atmega2560' specified

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: +++++++++++++++++++++++++

USE="-openmp" crossdev -t avr -s4 -S --without-headers

  • crossdev version: 20100814
  • Host Portage ARCH: amd64
  • Target Portage ARCH: *
  • Target System: avr
  • Stage: 4 (C/C++ compiler)

  • binutils: binutils-[stable]

  • gcc: gcc-[stable]

  • libc: avr-libc-[stable]

  • PORTDIR_OVERLAY: /usr/local/portage/layman/java-overlay

  • PORT_LOGDIR: /var/log/portage

  • PKGDIR: /usr/portage/packages/cross/avr

  • PORTAGE_TMPDIR: /var/tmp/cross/avr _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ !!! WARNING - Cannot auto-configure CHOST avr !!! You should edit /usr/avr/etc/make.conf !!! by hand to complete your configuration

  • Forcing the latest versions of {binutils,gcc}-config/gnuconfig ... [ ok ]

  • Log: /var/log/portage/cross-avr-binutils.log

  • Emerging cross-binutils ... [ ok ]

  • Log: /var/log/portage/cross-avr-gcc-stage1.log

  • Emerging cross-gcc-stage1 ... [ ok ]

  • Log: /var/log/portage/cross-avr-avr-libc.log

  • Emerging cross-avr-libc ... [ ok ]

  • Log: /var/log/portage/cross-avr-gcc-stage2.log

  • Emerging cross-gcc-stage2 ... +++++++++++++++++++++++++++++++++

What's going wrong? Is the version of crossdev to old? What I have to do?

Thanks in advance, Thomas

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.

I don't know which version of toolchain I need to support the atmega2560 and where to find the sources.

the version included with the Mac in gcc 4.3.2, and avr-libc 1.6.4 avr-gcc is part of the standard gcc distribution, http://gcc.gnu.org/releases.html avr-libs is hosted http://savannah.nongnu.org/projects/avr-libc/

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"

avr-gcc --v give: "cross-avr/gcc-4.3.2-r4"

I have installed the newest crossdev-20101011.

Any idea?

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"

Good luck, Thomas

Wow. I'd have given up and compiled from manually download source...