[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] atmega128 support
From: |
Peter Jansen |
Subject: |
Re: [avr-gcc-list] atmega128 support |
Date: |
Fri, 09 Nov 2001 10:28:31 +1100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 |
is anybody using an atmega128l with gcc successfully yet? we would
really like to benefit from the second uart, but are unsure if we can
port our code from 103 to 128....
Yes I have gcc and binutils working for the mega128, attached are some
patches for the compiler and binutils that you need to rebuild.
You also need a new library for the defines for the mega128, I'm still
working out the best library for that newlib or avr-lib, avr-lib has its
problems, new-lib makes larger code.
Have a look at this message about building gcc etc,
http://avr.jpk.co.nz/pipermail/avr-gcc-list/2001-November/001020.html
and
http://avr.jpk.co.nz/pipermail/avr-gcc-list/2001-October/001000.html
Regards,
--
Peter Jansen
Smart Container
Level 1, NIC Building
Eveleigh
NSW 1430
AUSTRALIA
diff -rc3P binutils-2.11.2/gas/config/tc-avr.c
binutils-2.11.2-patch-0.1/gas/config/tc-avr.c
*** binutils-2.11.2/gas/config/tc-avr.c Thu Jun 7 13:15:28 2001
--- binutils-2.11.2-patch-0.1/gas/config/tc-avr.c Tue Nov 6 18:58:48 2001
***************
*** 87,92 ****
--- 87,93 ----
{"atmega163", AVR_ISA_M161, bfd_mach_avr5},
{"atmega32", AVR_ISA_M161, bfd_mach_avr5},
{"at94k", AVR_ISA_94K, bfd_mach_avr5},
+ {"atmega128", AVR_ISA_M128, bfd_mach_avr5},
{NULL, 0, 0}
};
***************
*** 258,264 ****
" avr2 - AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22\n"
" avr3 - ATmega103, ATmega603\n"
" avr4 - ATmega83, ATmega85\n"
! " avr5 - ATmega161, ATmega163, ATmega32, AT94K\n"
" or immediate microcontroller name.\n"));
fprintf (stream,
_(" -mall-opcodes accept all AVR opcodes, even if not supported by
MCU\n"
--- 259,265 ----
" avr2 - AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22\n"
" avr3 - ATmega103, ATmega603\n"
" avr4 - ATmega83, ATmega85\n"
! " avr5 - ATmega161, ATmega163, ATmega32, AT94K,
ATmega128\n"
" or immediate microcontroller name.\n"));
fprintf (stream,
_(" -mall-opcodes accept all AVR opcodes, even if not supported by
MCU\n"
diff -rc3P binutils-2.11.2/include/opcode/avr.h
binutils-2.11.2-patch-0.1/include/opcode/avr.h
*** binutils-2.11.2/include/opcode/avr.h Mon Aug 7 00:09:14 2000
--- binutils-2.11.2-patch-0.1/include/opcode/avr.h Wed Nov 7 12:26:47 2001
***************
*** 34,39 ****
--- 34,40 ----
#define AVR_ISA_M83 (AVR_ISA_2xxx | AVR_ISA_MUL | AVR_ISA_LPMX | AVR_ISA_SPM)
#define AVR_ISA_M603 (AVR_ISA_2xxx | AVR_ISA_MEGA)
#define AVR_ISA_M103 (AVR_ISA_M603 | AVR_ISA_ELPM)
+ #define AVR_ISA_M128 (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_LPMX |
AVR_ISA_ELPMX )
#define AVR_ISA_M161 (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_LPMX | AVR_ISA_SPM)
#define AVR_ISA_94K (AVR_ISA_M603 | AVR_ISA_MUL | AVR_ISA_LPMX)
diff -rc3P binutils-2.11.2/ld/Makefile.am
binutils-2.11.2-patch-0.1/ld/Makefile.am
*** binutils-2.11.2/ld/Makefile.am Mon Jun 11 20:05:07 2001
--- binutils-2.11.2-patch-0.1/ld/Makefile.am Wed Nov 7 13:43:15 2001
***************
*** 119,124 ****
--- 119,125 ----
eavr44x4.o \
eavr85xx.o \
eavrmega103.o \
+ eavrmega128.o \
eavrmega161.o \
eavrmega603.o \
ecoff_sparc.o \
***************
*** 380,385 ****
--- 381,390 ----
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
${GEN_DEPENDS}
${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)"
+ eavrmega128.c: $(srcdir)/emulparams/avrmega128.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} avrmega128 "$(tdir_avr85xx)"
eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
${GEN_DEPENDS}
diff -rc3P binutils-2.11.2/ld/Makefile.in
binutils-2.11.2-patch-0.1/ld/Makefile.in
*** binutils-2.11.2/ld/Makefile.in Mon Jun 11 20:05:07 2001
--- binutils-2.11.2-patch-0.1/ld/Makefile.in Wed Nov 7 13:43:48 2001
***************
*** 227,232 ****
--- 227,233 ----
eavr44x4.o \
eavr85xx.o \
eavrmega103.o \
+ eavrmega128.o \
eavrmega161.o \
eavrmega603.o \
ecoff_sparc.o \
***************
*** 1094,1099 ****
--- 1095,1104 ----
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
${GEN_DEPENDS}
${GENSCRIPTS} avrmega103 "$(tdir_avr85xx)"
+ eavrmega128.c: $(srcdir)/emulparams/avrmega128.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
+ ${GEN_DEPENDS}
+ ${GENSCRIPTS} avrmega128 "$(tdir_avr85xx)"
eavrmega161.c: $(srcdir)/emulparams/avrmega161.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf32avr.sc \
${GEN_DEPENDS}
diff -rc3P binutils-2.11.2/ld/configure.tgt
binutils-2.11.2-patch-0.1/ld/configure.tgt
*** binutils-2.11.2/ld/configure.tgt Mon Jun 11 20:05:08 2001
--- binutils-2.11.2-patch-0.1/ld/configure.tgt Wed Nov 7 13:44:17 2001
***************
*** 22,28 ****
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arc-*-elf*) targ_emul=arcelf ;;
avr-*-*) targ_emul=avr85xx
! targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433
avrmega603 avrmega103 avrmega161" ;;
cris-*-*aout*) targ_emul=crisaout
targ_extra_emuls="criself crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
--- 22,28 ----
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arc-*-elf*) targ_emul=arcelf ;;
avr-*-*) targ_emul=avr85xx
! targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433
avrmega603 avrmega103 avrmega128 avrmega161" ;;
cris-*-*aout*) targ_emul=crisaout
targ_extra_emuls="criself crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
diff -rc3P binutils-2.11.2/ld/emulparams/avrmega128.sh
binutils-2.11.2-patch-0.1/ld/emulparams/avrmega128.sh
*** binutils-2.11.2/ld/emulparams/avrmega128.sh Thu Jan 1 10:00:00 1970
--- binutils-2.11.2-patch-0.1/ld/emulparams/avrmega128.sh Wed Nov 7
13:39:33 2001
***************
*** 0 ****
--- 1,12 ----
+ ARCH=avr:5
+ MACHINE=
+ SCRIPT_NAME=elf32avr
+ OUTPUT_FORMAT="elf32-avr"
+ MAXPAGESIZE=1
+ EMBEDDED=yes
+ TEMPLATE_NAME=generic
+
+ TEXT_LENGTH=128K
+ DATA_LENGTH=4096
+ EEPROM_LENGTH=4K
+ STACK=0x0FFF
diff -rc3P gcc-3.0.2/gcc/ChangeLog gcc-3.0.2-patch-0.1/gcc/ChangeLog
*** gcc-3.0.2/gcc/ChangeLog Wed Oct 24 03:19:18 2001
--- gcc-3.0.2-patch-0.1/gcc/ChangeLog Wed Nov 7 14:57:55 2001
***************
*** 1,3 ****
--- 1,9 ----
+ 2001-11-07 Peter Jansen <address@hidden>
+
+ * gcc/config/avr/avr.c - added mega128 to list of avr5 types
+ * gcc/config/avr/avr/h - Ditto
+
+
2001-10-23 Release Manager
* GCC 3.0.2 Released.
diff -rc3P gcc-3.0.2/gcc/config/avr/avr.c
gcc-3.0.2-patch-0.1/gcc/config/avr/avr.c
*** gcc-3.0.2/gcc/config/avr/avr.c Thu Jun 28 07:35:37 2001
--- gcc-3.0.2-patch-0.1/gcc/config/avr/avr.c Tue Nov 6 18:35:24 2001
***************
*** 153,158 ****
--- 153,159 ----
{ "atmega163", AVR5 },
{ "atmega32", AVR5 },
{ "at94k", AVR5 },
+ { "atmega128", AVR5 },
/* Assembler only. */
{ "avr1", AVR1 },
{ "at90s1200", AVR1 },
***************
*** 1164,1170 ****
/* Choose mode for jump insn:
1 - relative jump in range -63 <= x <= 62 ;
2 - relative jump in range -2046 <= x <= 2045 ;
! 3 - absolute jump (only for ATmega[16]03). */
int
avr_jump_mode (x, insn)
--- 1165,1171 ----
/* Choose mode for jump insn:
1 - relative jump in range -63 <= x <= 62 ;
2 - relative jump in range -2046 <= x <= 2045 ;
! 3 - absolute jump (only for ATmega1[6][03][28]). */
int
avr_jump_mode (x, insn)
diff -rc3P gcc-3.0.2/gcc/config/avr/avr.h
gcc-3.0.2-patch-0.1/gcc/config/avr/avr.h
*** gcc-3.0.2/gcc/config/avr/avr.h Tue Apr 17 04:25:42 2001
--- gcc-3.0.2-patch-0.1/gcc/config/avr/avr.h Tue Nov 6 17:59:26 2001
***************
*** 2973,2978 ****
--- 2973,2979 ----
%{mmcu=avr3:%(cpp_avr3)} \
%{mmcu=atmega603:%(cpp_avr3) -D__AVR_ATmega603__} \
%{mmcu=atmega103:%(cpp_avr3) -D__AVR_ATmega103__} \
+ %{mmcu=atmega128:%(cpp_avr5) -D__AVR_ATmega128__} \
%{mmcu=avr4:%(cpp_avr4)} \
%{mmcu=atmega83: %(cpp_avr4) -D__AVR_ATmega83__} \
%{mmcu=atmega85: %(cpp_avr4) -D__AVR_ATmega85__} \
***************
*** 3051,3056 ****
--- 3052,3058 ----
%{!mmcu*:-m avr85xx} \
%{mmcu=atmega603:-m avrmega603} \
%{mmcu=atmega103:-m avrmega103} \
+ %{mmcu=atmega128:-m avrmega128} \
%{mmcu=atmega161:-m avrmega161} \
%{mmcu=atmega163:-m avrmega161} \
%{mmcu=atmega32:-m avr5} \
***************
*** 3130,3135 ****
--- 3132,3138 ----
%{mmcu=at90c8534:crtc8534.o%s} \
%{mmcu=at90s8535:crts8535.o%s} \
%{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \
+ %{mmcu=atmega128|mmcu=avr5:crtm128.o%s} \
%{mmcu=atmega603:crtm603.o%s} \
%{mmcu=atmega83|mmcu=avr4:crtm83.o%s} \
%{mmcu=atmega85:crtm85.o%s} \
diff -rc3P gcc-3.0.2/gcc/config/avr/t-avr
gcc-3.0.2-patch-0.1/gcc/config/avr/t-avr
*** gcc-3.0.2/gcc/config/avr/t-avr Sun Jan 21 03:49:01 2001
--- gcc-3.0.2-patch-0.1/gcc/config/avr/t-avr Tue Nov 6 18:02:33 2001
***************
*** 49,55 ****
mmcu?avr3=mmcu?atmega103 mmcu?avr3=mmcu?atmega603 \
mmcu?avr4=mmcu?atmega83 mmcu?avr4=mmcu?atmega85 \
mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega163 \
! mmcu?avr5=mmcu?atmega32 mmcu?avr5=mmcu?at94k
MULTILIB_EXCEPTIONS =
--- 49,56 ----
mmcu?avr3=mmcu?atmega103 mmcu?avr3=mmcu?atmega603 \
mmcu?avr4=mmcu?atmega83 mmcu?avr4=mmcu?atmega85 \
mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega163 \
! mmcu?avr5=mmcu?atmega32 mmcu?avr5=mmcu?at94k \
! mmcu?avr5=mmcu?atmega128
MULTILIB_EXCEPTIONS =
Only in gcc-3.0.2: libstdc++-v3