avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] ATmega32/ATmega323


From: Ron Kreymborg
Subject: RE: [avr-gcc-list] ATmega32/ATmega323
Date: Thu, 7 Feb 2002 22:47:13 +1100

Well I can get avrgcc going for an ATmega323 so that it uses the correct
crtm32.o startup file by using atmega32 as the mmcu parameter in the
makefile, changing the text, data, and eeprom values in copies of the
avrmega161.* scripts, and changing the entry in the specs file at line 36
from %{mmcu=atmega32:-m avrmega32} to %{mmcu=atmega32:-m avrmega161}. This
is my cleanest solution so far.

What I don't understand is that I can make copies of the avrmega161 files,
call them avrmega32, change the text, data and eeprom values to match the
'323, and leave the specs entry at %{mmcu=atmega32:-m avrmega32}, and I get
the unrecognised emulation: avrmega32 error??

Ron

-------------------------------------------
Ron Kreymborg
Jennaron Research
Melbourne, Australia

> -----Original Message-----
> From: address@hidden [mailto:address@hidden
> Behalf Of Peter Jansen
> Sent: Thursday, 7 February 2002 10:07 AM
> To: Ron Kreymborg
> Cc: Avr Gcc-List; David Breeze
> Subject: RE: [avr-gcc-list] ATmega32/ATmega323
>
>
> Hi,
>
> instead of patching the linker script, or modifying the ones for another
> processor, I would suggest the following approch,
>
> Tell the compiler (gcc) which instruction set to use, ie use
> -mmcu=avr5 to the
> compiler.
>
> Copy the linker script from avr/lib/ldscripts for the closest
> processor for you
> project to your project, and modify it to your needs.
>
> Tell the linker to use your new linker script, ie -T
> my-linker-script, or if you
> compile and link on one line use -Wl,-T,my-linker-script.
>
> Copy the startup file for the correct processor also to your
> project and tell
> the linker to link to this use the -nostartfiles option to the
> compiler to tell
> it not to use the default.
>
> The compiler options --verbose and -t tell you a lot about what
> it is doing.
>
> Hope this helps.
>
>
> > I see what you mean David. However, as the linker fails (using
> > atmega32)
> > with the message:
> >
> > Unrecognised emulation mode: avr5
> > Supported emulations: avr85xx avr1200 avr23xx avr44x4 avr4433
> > avrmega603
> > avrmega103 avrmega161
> >
> > and there is an avr5 linker script, I would have thought this would be
> > the
> > one it used.
> >
> > Your idea of patching the avrmega161 script files for the bigger
> > memory
> > works for me also. But there is obviously a bug here somewhere. Can
> > anybody
> > suggest where to look?
> >
> > In passing, I upgraded to the version from avrfreaks about a month ago.
> > It
> > seems you no longer get the library source code! Is this available
> > from
> > somewhere else on avrfreaks? Or from some other site?
> >
> > Ron
> >
> > -------------------------------------------
> > Ron Kreymborg
> > Jennaron Research
> > Melbourne, Australia
> >
> > > -----Original Message-----
> > > From: David Breeze [mailto:address@hidden
> > > Sent: Tuesday, 5 February 2002 11:58 PM
> > > To: address@hidden
> > > Subject: Re: [avr-gcc-list] ATmega32/ATmega323
> > >
> > >
> > > Partially correct.
> > > I am currently using the ATmega323 on the windows based system.
> > > avr-gcc compiles ok with ATmega32 selected but the linker fails.
> > > The current get around I am using is to specify the linker
> > > separately and within the linker portion of the makefile use the
> > > ATmega161 as the device.  This as far as I can tell has the same
> > > mapping as the 161 BUT the memory is half the size of the 323.
> > > To overcome this it is necessary to modify the linker script files:
> > > avrmega161.x, avrmega161.xn,  avrmega161.r, avrmega161.xu and
> > > avrmega161.xbn.  Within these files you will find the text, data
> > > and eprom sizes and at the end of the file the initial stack
> > location.
> > > Remember to save the original files under a different name, DO
> > > NOT change the name of the script files in use i.e. the ones you
> > > modify as the file names appear to be expilcitly check in the
> > > linker.  You can find the script files under
> > C:\.....\avr\lib\ldscripts\
> > > If you find a better way to compile for this processor I would
> > > like to know about it.
> > >
> > > Regards
> > >
> > > David Breeze
> > >
> > >
> > > >>> "Ron Kreymborg" <address@hidden> 05 February 2002 11:38:39
> > >>>
> > > Hi Folks
> > >
> > > Just a quick one: is the "ATmega32" in the list of processors
> > supported by
> > > gcc-avr the same as the ATmega323 ?
> > >
> > > Thanks
> > > Ron Kreymborg
> > >
> > > avr-gcc-list at http://avr1.org
> > >
> > > This e-mail is intended only for the person(s)
> > > to whom it is addressed.
> > > If an addressing or transmission error has misdirected
> > > this e-mail,
> > > please notify the author by replying to this e-mail.
> > >
> > > If you are not the intended recipient
> > > you must not use, disclose, copy, print
> > > or rely on this e-mail.
> > >
> > > Joy Mining Machinery Ltd may monitor
> > > outgoing and incoming e-mails and other telecommunications
> > > on its e-mail and telecommunication systems.
> > >
> > >
> >
> > avr-gcc-list at http://avr1.org
> >
> avr-gcc-list at http://avr1.org
>

avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]