[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problem with interrupt handler?
From: |
Clemens Gerlach |
Subject: |
Re: [avr-gcc-list] Problem with interrupt handler? |
Date: |
Fri, 19 Oct 2001 11:21:14 +0200 |
User-agent: |
Mutt/1.2.5i |
On Fri, Oct 19, 2001 at 02:54:19AM -0500, Chris Baugher wrote:
> > 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?
you do not link the startup code (crts2313.o). the interrupt jump table and
other setup code (e.g stack initialisation) is located there.
simply use avr-gcc to link your object files (e.g.):
avr-gcc -mmcu=at90s4433 -Wall -O9 -o flow.o -c flow.c # no -S here
avr-gcc -mmcu=at90s4433 -Wall -O9 -o main.elf flow.o # use to call linker
# also links runtime
code
avr-objcopy -O srec main.elf main.srec # maybe change to ihex
your milage may vary.
clemens