AVRDUDE: verification error; content mismatch

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I keep getting this error when I download using AVRDUDE:

> "make.exe" program
avrdude -p attiny85 -P com1     -c ponyser    -U flash:w:testpp.hex 

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e930b
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "testpp.hex"
avrdude: input file testpp.hex auto detected as Intel Hex
avrdude: writing flash (316 bytes):

Writing | ################################################## | 100% 0.44s

avrdude: 316 bytes of flash written
avrdude: verifying flash memory against testpp.hex:
avrdude: load data flash data from input file testpp.hex:
avrdude: input file testpp.hex auto detected as Intel Hex
avrdude: input file testpp.hex contains 316 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.41s

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

avrdude done.  Thank you.

make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:02

From reading other posts, it looks like it could be a bad programmer. I've tried two different chips (both on the same PCB though) and a couple power supplies.

Any ideas on what could be causing this? It was all working fine last time I worked on it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try to check your target's power supply voltage while programming. I've faced this kind of problem, usually caused of voltage drop or unclean power supply.
The programmer could read device signature correctly (Tiny85 -> 1E930B) but looks like couldn't burn the flash. Ever checked at another board?
Another try, use parallel port (LPT) instead serial (COM). Worst case, maybe your serial port were proned...

KISS - Keep It Simple Stupid!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try this GUI for AVRDude.
FreeISP GUI for AVRDude
http://deccanrobots.com/free%20r...

This will not solve your verification problem, but you will have option to use AVRDude in GUI Mode

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i am having this same problem

avrdude -p attiny2313 -P com3	        -c avr910               -E reset  -U flash:w:led.hex 
avrdude: WARNING: -E option not supported by this programmer type

Found programmer: Id = ""; type = S
    Software Version = 2.3; Hardware Version = 1.0
Programmer supports auto addr increment.

Programmer supports the following devices:
    Device code: 0x01 = (unknown)
    Device code: 0x56 = ATtiny15
    Device code: 0x76 = ATMEGA8
    Device code: 0x5e = ATtiny2313

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e910a
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "led.hex"
avrdude: input file led.hex auto detected as Intel Hex
avrdude: writing flash (84 bytes):

Writing | ################################################## | 100% 1.44s

avrdude: 84 bytes of flash written
avrdude: verifying flash memory against led.hex:
avrdude: load data flash data from input file led.hex:
avrdude: input file led.hex auto detected as Intel Hex
avrdude: input file led.hex contains 84 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.69s

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

avrdude done.  Thank you.

make.exe: *** [program] Error 1

> Process Exit Code: 2
> Time Taken: 00:45

thats what i get when i try to write a program to my attiny2313. has anyone found a solution?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know Avrdude says it is going to erase the device, but have you tried manually erasing the device first?

Jeff Dombach, JLD Systems
"We do the stuff behind the buttons!"
Your source for embedded solutions with a 100% Guarantee.
http://www.jldsystems.com
Phone 717.892.1100

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how would i go about doing that?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was facing the same issue while putting a program second time in Atmega16 with avrdude.

 

If anyone is still facing this issue and if you are using bootloader, try putting "-e" in avrdude command. It erases only the application part (not the bootloader part) in flash. 

Nikhil Mayaramka

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nmayaramka wrote:
try putting "-e" in avrdude command. It erases only the application part (not the bootloader part) in flash.
It does not.

 

The -e option tells avrdude to issue a chip erase command to the programmer and the target when writing flash.

 

           -e      Causes a chip erase to be executed.  This will reset the contents of the flash ROM and EEPROM to the
                   value ‘0xff’, and clear all lock bits.  Except for ATxmega devices which can use page erase, it is
                   basically a prerequisite command before the flash ROM can be reprogrammed again.  The only exception
                   would be if the new contents would exclusively cause bits to be programmed from the value ‘1’ to ‘0’.
                   Note that in order to reprogram EERPOM cells, no explicit prior chip erase is required since the MCU
                   provides an auto-erase cycle in that case before programming the cell.

It isn't normally necessary, since avrdude automatically issues a chip erase before programming flash:

           -D      Disable auto erase for flash.  When the -U option with flash memory is specified, avrdude will perform
                   a chip erase before starting any of the programming operations, since it generally is a mistake to
                   program the flash without performing an erase first.  This option disables that.  Auto erase is not
                   used for ATxmega devices as these devices can use page erase before writing each page so no explicit
                   chip erase is required.  Note however that any page not affected by the current operation will retain
                   its previous contents.

Most bootloaders actually ignore chip erase command completely.  It isn't supported by SPM anyway.  Page erase is the usual way for a bootloader to handle that.

 

Which bootloader are you using?

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is my fault. In another thread, I mentioned that Bootloaders tend to treat "-e" as application area erase rather than chip erase.
Yes, I agree that it is not universal behaviour. Some bootloaders ignore -e completely and erase each page individually.

Personally, I am happier with the area erase rather than the ignore.

Nmayaramka was using an avr109 style bootloader. I have no idea which particular incarnation. Avr109 is notorious for inconsistency in its various forms.

I prefer stk500v1 or stk500v2 protocol but bootloaders are often more concerned with size than consistency. One side effect of the Arduino popularity is that these two protocols are widely used. IMHO, this is a good thing (tm)

David.