Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
Downloaded source with "hg clone https://optiboot.googlecode.com/hg/ optiboot"
Made the following changes in the main() function of optiboot.c
Uncommented the following lines:
cli();
and
asm volatile ("clr __zero_reg__");
In order to have "cli()" defined, added the following after the #include
<avr/pgmspace.h>
#include <avr/interrupt.h>
The resulting file was too large when I compiled with avr-gcc version 4.3.4, so
I modified the LDFLAGS line in the Makefile to:
override LDFLAGS = -Wl,$(LDSECTION) -Wl,--relax -nostartfiles
-Wl,--gc-sections
Now the size is 0x7FFC bytes (508 decimal)
Tested on UNO and also on FTDI-interface '328 boards on Centos Linux 5.5 and
Windows XP workstations. None of the "UNO Breaker" sketches in the forum
thread linked by westfw give problems.
---davekw7x
Original comment by dave.eva...@gmail.com
on 7 Jan 2011 at 7:20
Is the cli() needed? I was pretty sure that all forms of reset correctly
disable interrupts...
Original comment by wes...@gmail.com
on 16 Jan 2011 at 12:26
It looks like R1 can be non-zero after power-on reset as well
http://www.adafruit.com/forums/viewtopic.php?f=25&t=19126&start=0
Original comment by wes...@gmail.com
on 17 Jan 2011 at 11:20
Potential patch attached. In light of the problems with power-up in more
recent arduinos, the comment may not be entirely accurate.
Original comment by wes...@gmail.com
on 17 Jan 2011 at 11:22
Attachments:
Has this fix been implemented in the latest .zip download? I noticed this same
issue on my custom 'duino clone and had to go back to ADABOOT.
Original comment by jeremy.v...@testcontrols.com
on 10 Feb 2011 at 10:32
This fix (enabling asm volatile ("clr __zero_reg__"); and cli(); ) and the make
file updates works only for atmega328p MCUs. But not for the atmega328
(ATMEGA328-PU Chip).
Bootloader flashed in to MCU correctly, but the Sketches would not be uploaded
from Arduino.
I recieve a protocol error.
Not sure if this chip is different from the atmega328p chips. I did change the
chip signature in avrdude.conf file. But that that did not work.
Note: The same works fine with the standard arduino boot loader or ADABOOT
versions.
Original comment by oa.r...@gmail.com
on 27 Apr 2011 at 8:11
It doesn't make sense that the patch would fail on 328 but work on 328p. Are
you using the exact same source and tool chain, and have you tried with and
without the patch? (and which source base are you using? Hg, zip, or Arduino
dist?)
Original comment by wes...@gmail.com
on 29 Apr 2011 at 11:26
I think the issue (as reported in comment #8) is now resolved for me. Works for
both 328 and 328p chips.
I think the problem may be with AVR compiler/tool chain. Uninstalled the latest
WinAVR and reinstalled with the older version of WinAVR(03122009). And it
worked fine.
I did see a considerable delta in HEX file size with both the compilers.
Occationally, I do get protocol error while uploading sketch from Arduino IDE,
but that gets resolved if i plug/unplug the USB and retrying.
Original comment by oa.r...@gmail.com
on 3 May 2011 at 9:23
Original comment by wes...@gmail.com
on 29 Oct 2011 at 5:27
Issue 40 has been merged into this issue.
Original comment by wes...@gmail.com
on 29 Oct 2011 at 5:39
Fixed as part of the great optiboot/Arduino sync-up
http://code.google.com/p/optiboot/source/detail?r=8559b64fd093d3976cae58778a1540
256cde5c8e
Original comment by wes...@gmail.com
on 30 Oct 2011 at 8:19
Original issue reported on code.google.com by
wes...@gmail.com
on 3 Jan 2011 at 8:13