In one our product based on ATMega1280, on a new batch, the bootloader failed to work. After extensive investigation we concluded that there may be a bug in the rev.B silicon of ATMega1280 (detailed description below). Before submitting a report to Atmel, I'd like to ask those who have ATMega1280-based hardware at hand to help to exclude influence of our particular hardware.
In attachment there is a simple assembler program which should reveal the problem. The program sits in the bootloader area and it reprograms one sector in FLASH repeatedly. The only hardware requirement is to have a LED to "display" the status - it blinks cca 3-4 times per second while everything is OK and starts to blink much more rapidly when the error occurs (usually, there are 1-20 "normal" blinks until the rapid blinking starts). Our hardware has a 14.756MHz crystal, but I believe it's not important and it would work with any other relevant crystal frequency (with LED blinking faster or slower accordingly). I am ready to adopt the program to any particular hardware.
Details on the error:
- it appears, that while the programming is in progress (i.e. HV/pump is on), a relative jump (in a loop) sometimes jumps to a different then expected address, one word before the target. In the given source, it's the rjmp Wait_spm, which at times jumps to the rjmp Fault before Wait_spm
- it appears, that this happens only for jumps located in a certain part of the program memory - see a commented-out nop before rjmp Fault
- supply voltage does not appear to have impact
- the error occurs only on the rev.B silicon (last letter in the second line on the bottom of chip). All rev.A chips we have (hundreds) don't exhibit the problem; all rev.B chips we have (two different timestamps) do exhibit the problem. I don't know when did the transition from rev.A to rev.B happen - the newest rev.A I have is timecode 07xx, the oldest rev.B I have is 11xx
Thanks to all who are willing to help.
[EDIT] removed the errorneously added unrelated an*.* files from the zipfile [/EDIT]