Avrdude: verification error, first mismatch at byte 0xnnn

Hi.:raised_hand_with_fingers_splayed::smiling_face_with_three_hearts:
I Have Arduino Nanno V3 and when I want to Upload the program to the chip it gives me this error when uploading::disappointed_relieved::confused:

Sketch uses 936 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\Javad\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/bin/avrdude" "-CC:\Users\Javad\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/etc/avrdude.conf" -v -patmega328p -carduino -PCOM6 -b57600 -D "-Uflash:w:C:\Users\Javad\AppData\Local\Temp\arduino\sketches\5A53F1FFF1F5FE4D4EE2B48D5DAFF517/sketch_jun23a.ino.hex:i"

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\Javad\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/etc/avrdude.conf"

         Using Port                    : COM6
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.16
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "C:\Users\Javad\AppData\Local\Temp\arduino\sketches\5A53F1FFF1F5FE4D4EE2B48D5DAFF517/sketch_jun23a.ino.hex"
avrdude: writing flash (936 bytes):

Writing | ################################################## | 100% 0.51s

avrdude: 936 bytes of flash written
avrdude: verifying flash memory against C:\Users\Javad\AppData\Local\Temp\arduino\sketches\5A53F1FFF1F5FE4D4EE2B48D5DAFF517/sketch_jun23a.ino.hex:
avrdude: load data flash data from input file C:\Users\Javad\AppData\Local\Temp\arduino\sketches\5A53F1FFF1F5FE4D4EE2B48D5DAFF517/sketch_jun23a.ino.hex:
avrdude: input file C:\Users\Javad\AppData\Local\Temp\arduino\sketches\5A53F1FFF1F5FE4D4EE2B48D5DAFF517/sketch_jun23a.ino.hex contains 936 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.43s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0040
         0x00 != 0x0c
avrdude: verification error; content mismatch

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

I upload the blink sample then when Upload finished (with Error), the program successfully works on board...
I don't know why I get this error.
is this cause a problem later?
how can I get rid of it?
I try to Install Arduino AVR Boards Package Version 1.8.6 which is the latest version.
does not detect the Arduino Nano on USB Port COM6...
I Don't know why ????
I cannot Burn the Bootloader and it gives me this error...
but when I install the 1.6.10 Version, it recognizes the board...
also, I have Arduino Mega but no Problem with Uploading and working with...
this problem is only for Arduino Nano...
but still, this Error was caused.
also, I see something strange on the board behavior, I Program another code (Blink) earlier that blinks the LED at 5000 milliseconds. after causing this Error, seems like this Program still runs at the beginning of the operation and then operates as a new sketch that I program blink 100 milliseconds...
seems the Previous program is still on the chip and I can't change it from the board...
this is just a guess
this is the picture of my board:

and this is the cable that I use:

IDE Version: 2.1.0
Processor: ATmega 328
Programmer: Arduino as ISP
OS: Windows 10

Looks like problem with connections (check your cable, usb connector, quality of soldering it on the board...)
If all looks OK, its seems that your board is faulty

This exact problem is here on the forum many times. I didn't read about definitive reason or solution. Never happen to me.
There is something with the connection probably, but I would not say it is HW. Interesting thing is that issue is always during verification. Maybe something with the bootloader, it's just guess. There is "old" one because 57600 baud speed. Maybe just replacing the bootloader would help.

I would go through more verbose output at first. You can switch it on in IDE preferences of just simple run this avrdude command from your output with -vvvv switch. Lot of patience.

The second, I would try to read out the flash memory to analyze. You have to use avrdude CLI here. Little study of avrdude's guide, how to. However, you will need ISP programmer (HW) or another Arduino (Arduino as ISP) but you have Mega2560.

I understand you are beginner and the easiest way is probably to get another new Nano but anyway...

Really? :rofl:

Check port in your OS, driver etc.

If previous upload failed there is no reason to expect correct behavior.

Also bottom side could help.

Ahhh Jesus men, Im Sorry... :rofl:

  • I checked the USB Port (Right this time...) driver is Successfully installed.
  • I remember the first time when I want to upload a program to the board, I disconnect the
    board accidentally and after that, this problem shows up...
  • Yeah, but the strange thing is, the IDE on Uploading, shows me an Error, but the program runs, and works fine...
    I'm worried that it will be a problem in much larger programs...
    Considering that at the beginning of turning on the module, the previous program is executed and then the new program is executed...

I highly doubt. Program have to be written at specific address to be started and so each next instruction.
As I wrote, maybe the problem could be fixed by uploading the new bootloader.

At this moment, I cannot imagine how this could cause the problem. Normally, the bootloader is protected by fuse settings to be overwritten or changed. The bootloader is a small program in specific memory region which ensure uploading process on MCU side.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.