http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47696

           Summary: [AVR] Compilation for atmega2560 produces incomplete
                    interrupt vector table (USART2,3)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jlace...@curvesystems.com


avr-gcc -v
Using built-in specs.
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/home/joseph/local/avr/libexec/gcc/avr/4.5.2/lto-wrapper
Target: avr
Configured with: ../configure --prefix=/home/joseph/local/avr --target=avr
--enable-languages=c --disable-nls --disable-libssp --with-dwarf2
Thread model: single
gcc version 4.5.2 (GCC)


Produced vector table (dump by stk500v2 bootloader):

[...]
49 - 0060 = 94 0C 00 87 jmp 000087 >00010E TIMER5 COMPB
50 - 0062 = 94 0C 00 87 jmp 000087 >00010E TIMER5 COMPC
51 - 0064 = 94 0C 00 87 jmp 000087 >00010E TIMER5 OVF
52 - 0066 = 24 11 BE 1F  USART2 RX
53 - 0068 = EF CF E2 D1 rjmp  2FCF >00606E USART2 UDRE
54 - 006A = BF DE BF CD  USART2 TX
55 - 006C = E0 00 BF 0C rjmp  2000 >0040D8 USART3 RX
56 - 006E = E0 12 E0 A0 rjmp  2012 >004100 USART3 UDRE
57 - 0070 = E0 B2 EF E4 rjmp  20B2 >004244 USART3 TX
Bootloader>


changing file gcc/config/avr/avr-devices.c line #190 from:
 { "atmega2560",           ARCH_AVR6, "__AVR_ATmega2560__",        0, 0x0200,
"m2561" },

To:
 { "atmega2560",           ARCH_AVR6, "__AVR_ATmega2560__",        0, 0x0200,
"m2560" },

seems to solve the problem:

[...]
49 - 0060 = 94 0C 00 93 jmp 000093 >000126 TIMER5 COMPB
50 - 0062 = 94 0C 00 93 jmp 000093 >000126 TIMER5 COMPC
51 - 0064 = 94 0C 00 93 jmp 000093 >000126 TIMER5 OVF
52 - 0066 = 94 0C 02 4D jmp 00024D >00049A USART2 RX
53 - 0068 = 94 0C 00 93 jmp 000093 >000126 USART2 UDRE
54 - 006A = 94 0C 00 93 jmp 000093 >000126 USART2 TX
55 - 006C = 94 0C 00 93 jmp 000093 >000126 USART3 RX
56 - 006E = 94 0C 00 93 jmp 000093 >000126 USART3 UDRE
57 - 0070 = 94 0C 00 93 jmp 000093 >000126 USART3 TX
Bootloader>


Please review this section, I have limited understanding of the
compilation/linking mechanism.

Thanks,

JL

Reply via email to