0
votes

I am trying to upload a sketch into Arduino Mega 2560, but it's not uploading. It's showing an error message-

avrdude: verification error, first mismatch at byte 0x0000
         0xbf != 0x06
avrdude: verification error; content mismatch

Error message while uploading sketch into Arduino Mega 2560

It was just working fine since I used it last time. Suddenly it has just stopped working.

1
You could take a look at this arduino.stackexchange.com/questions/17762/…Ouss4
I tried that, but still facing this problem.Rana Depto

1 Answers

1
votes

i would check that avrdude was able to write any bytes of the flash section:

  • read current flash:

    avrdude  -c arduino -p atmega2560 -P /dev/arduino -b 57600 -U flash:r:flash.0.bin:r
    
  • write something(different) into it

    avrdude  -c arduino -p atmega2560 -P /dev/arduino -b 57600 -U flash:w:something.hex:i
    
  • read it back

    avrdude  -c arduino -p atmega2560 -P /dev/arduino -b 57600 -U flash:r:flash.2.bin:r
    
  • check if anything have changed:

    md5sum flash*
    
    • if the 2 sums are the same...avrdude can't change the fw inside the device...there are lockbits which may prevent it...because lockbits can't be turned back on: in this case you should write a new bootloader into the device using another arduino or a stock avrisp...(dont worry...it's easy)
    • if the sums are different...and the board is apparently running the firmware you have loaded...something inside the arduino ide is messed up

hope this helps ;)