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

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

Re: [avr-gcc-list] Problem with interrupt handler?


From: Chris Baugher
Subject: Re: [avr-gcc-list] Problem with interrupt handler?
Date: Fri, 19 Oct 2001 02:54:19 -0500 (CDT)

On Fri, 19 Oct 2001, Kujala Matti wrote:
> > 
> > Hi everyone,
> > 
> > I recently decided to try building some projects using the AVR chips and
> > have been trying to get some simple test code to run on an at90s2313. I'm
> > using avr-gcc 3.0.1 and binutils 2.11.2. The problem comes when I try to
> > compile a program that has an interrupt routine declared. When I try to
> > run the code on the chip I get all kinds of eratic behaviour, meaning it
> > doesn't do what it's supposed to.
> > So after poking around here is what I think.
> 
> <clip>
>  
> > Looking at this list file it sure looks like the program starts at line 19
> > which is a push instruction. Isn't the first instruction supposed to be a
> > jump to the main routine? Am I missing something? I can give more info if
> > needed.
> 
> It looks like for some reason your code is not linked with c-runtime code 
> (something like crt2313.o). Interrupt vector initializations and jump to 
> main is done there.

A few minutes after writing that mail I started thinking along those
lines. This is the sequence of commands I use for compiling etc..


fluke:~/dro$ make
avr-gcc  -mmcu=at90s2313 -O2 -Wall -S -Wstrict-prototypes \
-I/usr/local/avr/include -c dro.c
dro.c:55: warning: return type of `main' is not `int'
avr-as -gstabs -mmcu=at90s2313 -ahlms=dro.lst dro.s -o dro.o \
-I/usr/local/avr/lib/
avr-ld  -Map dro.map -o dro dro.o
avr-objcopy -g --output-target=ihex dro dro.ihex
fluke:~/dro$


Does this look reasonable?

C|

> 
> --
> What sorcery, what spells, have brought thee here?
> 




reply via email to

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