arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.17k stars 7.02k forks source link

Error compilation for ATmega8 in IDE 1.5.6.-r2 #2137

Closed ghost closed 10 years ago

ghost commented 10 years ago

In the IDE 1.5.6.-r2 under Windows. Can not be compiled hex file for procesor ATmega8. Used by board is Arduino NG or Older.

I tested in the IDE 1.0.5 works there.

Error Message is:

Build options changed, rebuilding all

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Users\Jenda\Documents\Arduino\HEX\sketch_jun18a.cpp -o C:\Users\Jenda\Documents\Arduino\HEX\sketch_jun18a.cpp.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\avr-libc\malloc.c -o C:\Users\Jenda\Documents\Arduino\HEX\malloc.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\avr-libc\realloc.c -o C:\Users\Jenda\Documents\Arduino\HEX\realloc.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\hooks.c -o C:\Users\Jenda\Documents\Arduino\HEX\hooks.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\WInterrupts.c -o C:\Users\Jenda\Documents\Arduino\HEX\WInterrupts.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c -o C:\Users\Jenda\Documents\Arduino\HEX\wiring.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_analog.c -o C:\Users\Jenda\Documents\Arduino\HEX\wiring_analog.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_digital.c -o C:\Users\Jenda\Documents\Arduino\HEX\wiring_digital.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_pulse.c -o C:\Users\Jenda\Documents\Arduino\HEX\wiring_pulse.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_shift.c -o C:\Users\Jenda\Documents\Arduino\HEX\wiring_shift.c.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\CDC.cpp -o C:\Users\Jenda\Documents\Arduino\HEX\CDC.cpp.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_NG -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp -o C:\Users\Jenda\Documents\Arduino\HEX\HardwareSerial.cpp.o

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp:32: C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\/HardwareSerial_private.h: In member function 'void HardwareSerial::_rx_complete_irq()': C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\/HardwareSerial_private.h:98: error: 'UPE' was not declared in this scope

cmaglie commented 10 years ago

I confirm the bug compiling an empty sketch for Aruino NG w/ Atmega8 CPU. It seems that "UPE" bit is called "PE" on Atmega8.

@matthijskooijman may you have a look at this one?

matthijskooijman commented 10 years ago

@pichlik1980, I just created a pullrequest that should fix this. Could you see if that version runs correctly for you (either by checking it out of git, or just manually applying the patch to HardwareSerial_private.h)? I've compile-tested it, but I don't have any atmega8 here to really test it.

ghost commented 10 years ago

The fix is ​​ok. Thank you.

matthijskooijman commented 10 years ago

Thanks for testing!