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
(In reply to comment #0) > 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: The fix is correct. The last column points to corresponding library. I presume this is a typo. Thanks for the analysis!
Created attachment 23337 [details] Patch based on the proposed solution. Seems to fix the problem. Just a patch based on the solution described.
Author: aesok Date: Mon Feb 14 15:49:35 2011 New Revision: 170137 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170137 Log: PR target/47696 * config/avr/avr-devices.c (avr_mcu_types): Fix ATmega2560 device description. Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr-devices.c
Fixed.