Welcome! Log In Create A New Profile

Advanced

Verification failure after upload?

Posted by jamesshuang 
Verification failure after upload?
July 07, 2013 02:05AM
Hey everyone, I built up a Sanguinololu completely from scratch. It seems that almost everything is working. I can compile a small test program and upload it with avrdude. Everything works correctly until the last step:

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

If I download the full flash contents using avrdude, everything returns as 0xFF. Based on the verbose logs, it looks like the FTDI chip is talking correctly with the ATmega1284p. All the handshake messages seem to work fine. The sent data all looks good. It seems that only issue is the flash fails to be written. Is my chip dead? Could there be any other possibilities?
Re: Verification failure after upload?
July 07, 2013 02:32AM
The error means that you have the wrong bootloader. The firmware is not actually uploading (hence the error).

You need to burn the correct bootloader onto the atmega using the ISP port.
Re: Verification failure after upload?
July 07, 2013 07:30AM
Well, do you have a bootloader at all? Factory fresh ATmegas don't. You'd need a programming device to upload one.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Verification failure after upload?
July 07, 2013 12:07PM
Ok, I did mess with the bootloader earlier. It seems pretty likely that I messed it up. I'll have to try burning it again.
Re: Verification failure after upload?
July 07, 2013 10:51PM
So I had a usb245r chip lying around, and I tried to flash the bootloader with the "ft245r" programmer. Unlocking the chip with the following command seems to work:

avrdude -patmega1284p -cft245r -Pft0 -b57600 -U lock:w:0x3F:m

It tells me that it even passed validation. With the sanguino bootloader as found in [code.google.com] , I flashed with the following command:

avrdude -pATmega1284p -cft245r -Pft0 -b 4800 -u -U flash:w:bootloader-1284P-16MHz.hex -v


It gave me a validation error:

avrdude: verification error, first mismatch at byte 0x1f000
         0xff != 0x0c
avrdude: verification error; content mismatch


With the Gen7 bootloader, I get the same error, but at a different memory location:

avrdude: verification error, first mismatch at byte 0x1f800
         0xff != 0x8f
avrdude: verification error; content mismatch


I tried at a variety of baudrates, 4800, 9600, 57600, 115200. None made any difference. Am I correct in assuming that this chip is toast?
Re: Verification failure after upload?
July 08, 2013 04:35AM
Quote

Am I correct in assuming that this chip is toast?

No. As long as you get any results at all, the chip runs. Also, ATmegas are pretty hard to destroy, even attaching 12V to an I/O pin destroys only that pin.


avrdude: verification error, first mismatch at byte 0x1f800

0x1f800 = 126k = 128k - 2k, right? That's the first byte of the bootlader its self, so a failure to write this byte is expected. The Sanguino bootloader is 4k in size, so only 124k are available for the firmware.

You firmware is simply too big for this chip.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Verification failure after upload?
July 08, 2013 10:45AM
Wait, that was an attempt to load the bootloader, not a firmware. So it seems to be failing validation of the first bit of the bootloader? Am I doing something wrong for loading a bootloader somehow?
Re: Verification failure after upload?
July 08, 2013 04:58PM
Well, it seems that my usb245r chip is broken. I found a computer with a parallel port, reflashed the bootloader (which worked fine), and tried flashing a firmware (which also worked fine). Before, I was getting the dreaded stk500_recv() programmer not responding error, but now I have a brand new Sprinter firmware connected to pronterface. All is well...

For reference in case anyone stumbles onto this thread: parallel ports are your friend. If you get the stk500_recv error, try burning a gen7 bootloader.
  1. Install Arduino 1.0.4 from [arduino.cc]
  2. Download the file from here: [github.com],
  3. extract it to your arduino/hardware directory
  4. Burn bootloader from the arduino tools menu

Firmwares should upload fine after this.

Edited 1 time(s). Last edit at 07/08/2013 06:33PM by jamesshuang.
Re: Verification failure after upload?
July 09, 2013 12:56AM
Some ISP programmers can't handle 128k chips like the atmega1284p.
Re: Verification failure after upload?
July 09, 2013 07:44AM
Glad you got it working!


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Verification failure after upload?
July 07, 2015 03:52AM
Hi.
I am having a similar problem.

I tried uploading the Boot-loader for Gen7 @ 16Mhz.

I got the following error,

avrdude: verification error, first mist match at byte 0x1f800
0x8f != 0xff


I am using Atmega1284p as the MCU and Usbtiny programmer.

i have attached a picture regarding the same.

What is the problem, cause, and solution?

Thank you.

Yashu
Attachments:
open | download - bootloader_error_pic.png (24.3 KB)
Re: Verification failure after upload?
July 07, 2015 05:56AM
USBtiny isn't capable to program Flash above 64k: [reprap.org]

Either get a better programmer or go without bootloader. Uploading a firmware of up to 64k with the programmer directly should work.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Verification failure after upload?
July 07, 2015 06:31AM
Okay.

I want to clear a few things here. First, I am trying to upload the firmware. Which is a 4kb HEX file. So, according to me it should not be a problem uploading the bootloader as it is less that 64 kb.
I am aware that Usbtiny cannot upload above 64kb but then again, my device is programming the boot loader into the flash of the 1284 but there is a verification error.
I checked the size of the bootloader using "Avr-size". It comes out to be 1220 bytes.
So, i dont think that uploading the bootloader via USBtiny should be a problem.


Also, i would like to know the cause of the "Verification error"

Thanks.
Yashu
Re: Verification failure after upload?
July 07, 2015 06:15PM
you didnt read the link

Ill re phrase, you cant use a USBtiny to upload a boot loader, as the boot loader sits at the end of eeprom.

This issue is that the USB tiny only attempts to control 16 bit address not the full 24 bit address, so the chip nevers gets full addreses from your programmer. As far as the atmeg 1284 is concerned, your sending it garbage

You have no choice but to use a different programmer.

Edited 2 time(s). Last edit at 07/07/2015 07:24PM by Dust.
Re: Verification failure after upload?
July 08, 2015 01:29AM
Okay. Now i understood the meaning of "Cannot program flash above 64kb". Thanks 'DUST' and 'Traumflug '.

Quote
Traumflug
Uploading a firmware of up to 64k with the programmer directly should work.

Ill try to upload Marlin firmware directly.

Thanks a lot guys.

Yashu.
Re: Verification failure after upload?
March 11, 2020 01:03PM
Hi folks!
I have the same issue here. I have a Sanguino gen6 delux board with an ATmegs644p 16Mhz on it. I downloaded the running FW 1.0.0 as hex file and put is aside. Then compiled a 1.1.8 version and tried to upload the hex file with AVRDUDE. It fails to varify. If I chose to upload the original FW 1.1.0 hex file all works well and the printer is working again.

I am using Arduino IDE 1.8.12

Any ideas on that?

Many thanks, because my printer (Orcabot 0.43) needed an new thermistor that called for a FW update/modification. Unfortuantely I do not have the original version as editable filesad smiley

Thanks for your thoughts
Re: Verification failure after upload?
March 12, 2020 04:18AM
Hello again!
I just looked up the file sizes:
working hex-file 154KB
verification error hex-file 164KB

What realy bother me is that one file is working with avrdude and the other is not.

Would it be worth a try to transfer the code with an ISP? I have a Arduino Nano on my desk, so not big trouble testing that?

The ATmega644p has a cache of 64KB rigth? I looked on the chip and it sais 20AU 1048
Re: Verification failure after upload?
March 12, 2020 07:33AM
644p has a flash size of 64KB total, minus any bootloaders you may have.

Flash is where your firmware gets saved.

You cant determine very much from the hex file, you need the size of the binary file.

Edited 2 time(s). Last edit at 03/12/2020 07:48AM by Dust.
Re: Verification failure after upload?
March 12, 2020 01:05PM
YES! Thank you! It was a size issue. Now it is working. I removed ARC support and it fits on the 644p!!
Sorry, only registered users may post in this forum.

Click here to login