[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Interrupt vector defenition with avr-libc
From: |
Theodore A. Roth |
Subject: |
Re: [avr-gcc-list] Interrupt vector defenition with avr-libc |
Date: |
Wed, 11 Dec 2002 14:55:16 -0800 (PST) |
On Tue, 10 Dec 2002, Jeff Rose wrote:
:) Hi guys,
:) Does anyone know how the SIGNAL macro works in avr-libc? It
:) looks like the #define just outputs __vector_# where number is the number
:) for the vector. When I disassemble my final elf file the vector table is
:) still empty, (All entries point to __bad_interrupt) and the label before
:) my signal handler is __vector_11. (Its the timer0 overflow interrupt)
:) At what stage is the vector table supposed to be filled out? Has
:) anyone used the gcc and avr-libc with the atmega323?
It works fine for me. Here's some of the disassm from a uart test program
I wrote (compiled for m323 with today's binutils, gcc and avr-libc from
cvs):
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 28 00 jmp 0x50
4: 0c 94 43 00 jmp 0x86
8: 0c 94 43 00 jmp 0x86
c: 0c 94 43 00 jmp 0x86
10: 0c 94 43 00 jmp 0x86
14: 0c 94 43 00 jmp 0x86
18: 0c 94 43 00 jmp 0x86
1c: 0c 94 43 00 jmp 0x86
20: 0c 94 43 00 jmp 0x86
24: 0c 94 43 00 jmp 0x86
28: 0c 94 43 00 jmp 0x86
2c: 0c 94 60 01 jmp 0x2c0
30: 0c 94 43 00 jmp 0x86
34: 0c 94 aa 00 jmp 0x154
38: 0c 94 f4 00 jmp 0x1e8
3c: 0c 94 43 00 jmp 0x86
40: 0c 94 43 00 jmp 0x86
44: 0c 94 43 00 jmp 0x86
48: 0c 94 43 00 jmp 0x86
4c: 0c 94 43 00 jmp 0x86
00000050 <__ctors_end>:
<snip>
000002c0 <__vector_11>:
}
return(0);
}
SIGNAL (SIG_OVERFLOW0)
{
2c0: 1f 92 push r1
2c2: 0f 92 push r0
2c4: 0f b6 in r0, 0x3f ; 63
2c6: 0f 92 push r0
2c8: 11 24 eor r1, r1
}
2ca: 0f 90 pop r0
2cc: 0f be out 0x3f, r0 ; 63
2ce: 0f 90 pop r0
2d0: 1f 90 pop r1
2d2: 18 95 reti
My guess is that you mis-speeled SIG_OVERFLOW0. If I do that, here's what
the disassm looks like:
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 28 00 jmp 0x50
4: 0c 94 43 00 jmp 0x86
8: 0c 94 43 00 jmp 0x86
c: 0c 94 43 00 jmp 0x86
10: 0c 94 43 00 jmp 0x86
14: 0c 94 43 00 jmp 0x86
18: 0c 94 43 00 jmp 0x86
1c: 0c 94 43 00 jmp 0x86
20: 0c 94 43 00 jmp 0x86
24: 0c 94 43 00 jmp 0x86
28: 0c 94 43 00 jmp 0x86
2c: 0c 94 43 00 jmp 0x86
30: 0c 94 43 00 jmp 0x86
34: 0c 94 aa 00 jmp 0x154
38: 0c 94 f4 00 jmp 0x1e8
3c: 0c 94 43 00 jmp 0x86
40: 0c 94 43 00 jmp 0x86
44: 0c 94 43 00 jmp 0x86
48: 0c 94 43 00 jmp 0x86
4c: 0c 94 43 00 jmp 0x86
<snip>
000002c0 <SIG_a_speeling_err_OVERFLOW0>:
}
return(0);
}
SIGNAL (SIG_a_speeling_err_OVERFLOW0)
{
2c0: 1f 92 push r1
2c2: 0f 92 push r0
2c4: 0f b6 in r0, 0x3f ; 63
2c6: 0f 92 push r0
2c8: 11 24 eor r1, r1
}
2ca: 0f 90 pop r0
2cc: 0f be out 0x3f, r0 ; 63
2ce: 0f 90 pop r0
2d0: 1f 90 pop r1
2d2: 18 95 reti
Ted Roth
avr-gcc-list at http://avr1.org