Strange problem uploading a sketch after flashing bootloader

Hi all,

I’ve run into a rather strange problem. If I re-flash the bootloader on my UNO R3 board (using the stock Optiboot that comes with IDE version 1.0.2), then try to upload a sketch, it fails with this message:

Binary sketch size: 6,268 bytes (of a 32,256 byte maximum)
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0xff
avrdude: verification error; content mismatch

A hex dump of the flash memory shows the difference:

root@michael:~/Documents# diff fail.hex good.hex


It seems as though the first 128 bytes are not being programmed.

However, clicking “Upload” again succeeds.

I tried it on three different UNO boards and they all do the same thing.

By the way, if it matters, I reflash the bootloader with an AVRISP MKII programmer.

Also, here are the fuse settings that I use:


Anyone have any ideas - I would appreciate it.

– Roger