Dukebats / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Bootloader doesn't build for 328p #1095

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cd hardware/arduino/bootloaders/atmega
2. make clean
3. make atmega328

What is the expected output? What do you see instead?
expected successful compile...
received :-
avr-gcc -g -Wall -O2 -mmcu=atmega328p -DF_CPU=16000000L   
'-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600   -c -o 
ATmegaBOOT_168.o ATmegaBOOT_168.c
ATmegaBOOT_168.c: In function ‘main’:
ATmegaBOOT_168.c:586:11: error: ‘EEWE’ undeclared (first use in this 
function)
ATmegaBOOT_168.c:586:11: note: each undeclared identifier is reported only once 
for each function it appears in
make: *** [ATmegaBOOT_168.o] Error 1

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?
HEAD from github or 1.0.1

Please provide any additional information below.

pull requests made as iMartyn on github that fix this

Original issue reported on code.google.com by martyn@theendofhistether.org.uk on 2 Nov 2012 at 10:07

GoogleCodeExporter commented 9 years ago
What OS and gcc version are you using?
The bootloaders should generally be compiled using the same gcc that is 
included with the Arduino package (4.3.x, I think.)

Original comment by wes...@gmail.com on 3 Nov 2012 at 12:35

GoogleCodeExporter commented 9 years ago
$ avr-gcc --version
avr-gcc (GCC) 4.5.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

running on ubuntu oineric.

The fix I think is better code and compiles fine with 4.3.2 as well as 4.5.3, 
so imho should be pulled, but then I would say that as I made the pull request.

Original comment by martyn@theendofhistether.org.uk on 3 Nov 2012 at 3:07

GoogleCodeExporter commented 9 years ago
https://github.com/iMartyn/Arduino/commit/ba95cb77432eced298b11d7fb85345a1245838
49#hardware/arduino/bootloaders/atmega/ATmegaBOOT_168.c are the changes btw, if 
it's easier to see them direct.

Original comment by martyn@theendofhistether.org.uk on 3 Nov 2012 at 3:09

GoogleCodeExporter commented 9 years ago
With the avr-gcc contained inside the IDE it will compile perfectly.
Looks like that in the newer avr-libc toolchains the EEPROM write bit is 
changed from EEWE to EEPE as described above and in this forum topic: 
http://arduino.cc/forum/index.php/topic,37338.0.html

If you want to compile with the your system avr-gcc, you should modify the 
ATmegaBOOT_168.c file in line 586 to use the EEPE bit instead the EEWE.

Otherwhise in the makefile in the environment variable called "CC" add the path 
to the avr-gcc contained inside the IDE: 
CC = PATH_TO_ARDUINO_IDE/hardware/tools/avr/bin/avr-gcc

Original comment by f.vanz...@gmail.com on 17 Apr 2013 at 4:50