You are not logged in.

#1 2013-03-17 02:52:15

Leandros
Member
Registered: 2012-12-01
Posts: 25

compiling with avr-gcc for atmel xmega doesn't work

I want to compile source for a Atmel xmega 128 (atxmega128a3u), but I can't get it working.

If I try to compile with avr-gcc 4.7.2-1 from community, I get a error message that -mmcu=atxmega128a3u isn't supported.

If I try to compile with avr-gcc-svn (with avr-libc-svn, obviously but with binutils from community) I get this error message:

avr-gcc -c -DBOARD=USER_BOARD -DIOPORT_XMEGA_COMPAT -mmcu=atxmega128a3u -Wall -std=gnu99 -O1 -I"." -I"./asf/common/boards" -I"./asf/common/boards/user_board" -I"./asf/common/services" -I"./asf/common/services/clock" -I"./asf/common/services/delay" -I"./asf/common/services/ioport" -I"./asf/common/services/sleepmgr" -I"./asf/common/services/twi" -I"./asf/common/services/usb" -I"./asf/common/services/usb/class/cdc" -I"./asf/common/services/usb/class/cdc/device" -I"./asf/common/services/usb/udc" -I"./asf/common/utils" -I"./asf/xmega/drivers/cpu" -I"./asf/xmega/drivers/nvm" -I"./asf/xmega/drivers/adc" -I"./asf/xmega/drivers/pmic" -I"./asf/xmega/drivers/sleep" -I"./asf/xmega/drivers/twi" -I"./asf/xmega/drivers/tc" -I"./asf/xmega/drivers/usb" -I"./asf/xmega/utils" -I"./asf/xmega/utils/preprocessor" -I"./config" -Ilibprintf_flt.a -Ilibm.a -o obj/init.o ./asf/common/boards/user_board/init.c
In file included from ./asf/xmega/utils/compiler.h:54:0,
                 from ./asf/common/boards/board.h:56,
                 from ./asf/common/boards/user_board/init.c:8:
/usr/avr/include/avr/io.h:428:6: warning: #warning "device type not defined" [-Wcpp]
 #    warning "device type not defined"
      ^
In file included from ./asf/common/utils/interrupt.h:47:0,
                 from ./asf/xmega/utils/compiler.h:1017,
                 from ./asf/common/boards/board.h:56,
                 from ./asf/common/boards/user_board/init.c:8:
./asf/common/utils/interrupt/interrupt_avr8.h: In function 'cpu_irq_is_enabled_flags':
./asf/common/utils/interrupt/interrupt_avr8.h:113:17: error: 'CPU_I_bm' undeclared (first use in this function)
  return flags & CPU_I_bm;
                 ^
./asf/common/utils/interrupt/interrupt_avr8.h:113:17: note: each undeclared identifier is reported only once for each function it appears in
make: *** [obj/init.o] Error 1

If I try to make avr-gcc-atmel / avr-libc-atmel or avr-binutils-atmel I get these errors:

gcc

../../gcc/doc/cppopts.texi:763: @itemx must follow @item
make[2]: *** [doc/cpp.info] Error 1
make[2]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-gcc-atmel/src/gcc-4.5.3/build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-gcc-atmel/src/gcc-4.5.3/build'
make: *** [all] Error 2

libc

IBC__ -mcall-prologues -Os  -MT dtostre.o -MD -MP -MF .deps/dtostre.Tpo -c -o dtostre.o ../../../libc/stdlib/dtostre.c
../../../libc/stdlib/dtostre.c: In function 'dtostre':
../../../libc/stdlib/dtostre.c:40:42: error: variable 'str_nan' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
     __attribute__((progmem)) static char str_nan[2][4] =
                                          ^
../../../libc/stdlib/dtostre.c:42:42: error: variable 'str_inf' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
     __attribute__((progmem)) static char str_inf[2][sizeof(str_nan[0])] =
                                          ^
make[5]: *** [dtostre.o] Error 1
make[5]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-libc-atmel/src/avr-libc-1.7.1/avr/lib/avr2'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-libc-atmel/src/avr-libc-1.7.1/avr/lib/avr2'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-libc-atmel/src/avr-libc-1.7.1/avr/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-libc-atmel/src/avr-libc-1.7.1/avr'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-libc-atmel/src/avr-libc-1.7.1'
make: *** [all] Error 2

binutils

config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing bfd_stdint.h commands
config.status: executing default commands
make[3]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-binutils-atmel/src/binutils-2.20.1/build/bfd/po'
make[3]: Entering directory `/tmp/yaourt-tmp-leandros/aur-avr-binutils-atmel/src/binutils-2.20.1/build/bfd/po'
make[3]: Nothing to be done for `info'.
make[3]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-binutils-atmel/src/binutils-2.20.1/build/bfd/po'
make[3]: Entering directory `/tmp/yaourt-tmp-leandros/aur-avr-binutils-atmel/src/binutils-2.20.1/build/bfd'
make[3]: Nothing to be done for `info-am'.
make[3]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-binutils-atmel/src/binutils-2.20.1/build/bfd'
make[2]: *** [info-recursive] Error 1
make[2]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-binutils-atmel/src/binutils-2.20.1/build/bfd'
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory `/tmp/yaourt-tmp-leandros/aur-avr-binutils-atmel/src/binutils-2.20.1/build'
make: *** [all] Error 2

Any idea how to fix?


Edit: Wait. I just saw, the header files are containing the error if I try to build with avr-gcc-svn.
Edit2: Nope. Compiler Error. Headers are fine.

Last edited by Leandros (2013-03-17 03:02:46)

Offline

#2 2013-03-17 04:11:13

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: compiling with avr-gcc for atmel xmega doesn't work

Solved. Use Atmels AVR Toolchain.

Offline

Board footer

Powered by FluxBB