Pages: [1]   Go Down
Author Topic: Arduino on breadboard avrdude: verification error; content mismatch  (Read 5804 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
  I've been trying to build up arduino on a breadboard by following this tutorial http://www.arduino.cc/en/Main/Standalone .. i also burnt the bootloader onto an atmega8 using this tutrial http://www.arduino.cc/playground/Learning/Burn168 .. in the arduino(version 21) folder under hardware/arduino/bootloaders/ .. i went into the atmega8 folder and burnt the hex file present in that folder .. and after putting it in the breadboard with a 16mhz crystal( with the right fuse settings ).. the LED on 13th pin blinked every 10 seconds ( hoping thats right) .. then i connected a rs232 board ( with max232 IC ) to the breadboard and got a serial connection..
   In the arduino software , under Board when i choose boards like duemilanove or arduino pro or arduino BT  , it used to give me an error saying wrong microcontroller detected.change by choosing the right one under tools->board ..Then i selected the last option Arduino NG ( older w/ ATmega8 ).. This time it looked like it uploaded.. ( i uploaded a program to blink the led in 13th pin every second).. But i got the following error

Binary sketch size: 834 bytes (of a 7168 byte maximum)
avrdude: verification error, first mismatch at byte 0x0000
         0x3f != 0xff
avrdude: verification error; content mismatch

And the LED still blinks only every 10 seconds..SO i guess it didnt quite upload correctly..Does anybody know what the verifcation error means?

Would really appreciate some help.
Thanks..
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 203
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I got an error like that it was because avrdude was trying to set the Lock byte and the bootloader doesn't support the lock write and read part of the STK500 protocol.  In the Arduino preferences file you can add the line "upload.verbose=true" to get more information about the upload process.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey,
  Thanks for your reply. I did what you told me and tried uploading again.Here is the output http://dl.dropbox.com/u/904687/arduinooutput.txt  .. Im using an external 16mhz clock.. and the default blink LED blinks every 10 seconds on pin 13..Is that how its supposed to be?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 203
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For some reason it appears that the received bytes are not being logged.  From the fact that it gets the device signature successfully we can deduce that it is properly receiving data from the chip.

Everything looks good up to the end of the verification step where it says the byte at 0x0000 read as 0xff when it was written as 0x3f.  Could the lock bits be set incorrectly?  They should have been set (and verified) when you wrote the bootloader.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey,
 thanks for your reply..I think i might have made a mistake there.. Could you point me to a good tutorial so i can burn the right hex file for the atmega8 using avr studio software? can i use the atmega168 hex files on the atmega8? i think i might have burnt the wrong hex file and might have set the wrong lock bits. If there is any way you could guide me through this..for the atmega8..it would be really helpful..Thanks..
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 203
Posts: 8719
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I'm not familiar with AVR Studio. 

What programming device are you using?  Have you tried using the Arduino IDE to burn the bootloader and upload sketches?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey..thanks for your reply.. the arduino IDE does not recognize my programmer so i used AVR studio to burn the atmega8 hex file. to upload code i tried using arduino IDE but thats when i got the error mentioned in the first post..THe programmer im using is similar to this http://nskelectronics.com/avr_dude.html
Logged

Norman, OK, USA!
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Klingon Machinist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Prashanth,

I posted a reply in another thread about loading hex files directly to your Mega8.

You may want to look at this post on Tod Bot's blog:

http://todbot.com/blog/2009/05/26/minimal-arduino-with-atmega8/

This page might be of use to you. He also has a bootloader for the m8 for use without external crystals.

Hope that helps.
Logged

M.S.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for your reply.. for some reason arduino isn't recognizing my ISP burner.. i dont think its mkII .. i already set the fuse settings to use an external crystal( ive inserted 16mhz ).. i dont think i can undo that.. I think i need to get the lock bits right..
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm ,
   I had this exact same set of symptom(s) occur to me also while working with the 1284P(s) chip on my sanguino breakout(replaced my 644P). I have burned the adaboot 1284 bootloader using a spare 328P dieciellma loaded with megaISP and prevented from booting with the 120ohm resistor trick.

I then found that I could NOT load arduino programs compiled to .hex files either from the command line(above error) or from the arduino environment(strange error after replacing avrdude, setspeed issues in that environment) after burning this bootloader.

However when I used the Arduino  in MegaISP mode to program the 1284P chip with the arduino test program EVERYTHING loaded and ran perfectly after bringing up the sanguino hardware.. (NOT a fuses issue)..this was from the command line(after bootloader programming).


      wondering what gives as I see people constantly searching for the solution to this error but having to load arduino .hex files with a ISP programmer gets highly inconvenient(at least in my case)... and sucks as a solution(I need to update the arduino environment properly for the new avrdude and 1284P chip)



             puzzled
             gwen

                            


« Last Edit: March 05, 2011, 12:10:29 pm by gwen » Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Meh, I use my arduino as a programmer, and that was something that I wanted to ask you on this. The way that programmer looks, does it already have an Atmel chip in the socket? If so then you may need to pull your reset high (with a 120 ohm resistor between reset and ground). I have had crazy troubles with my arduino as an ISP until I disabled reset. It's been smooth sailing all the way since then.

but just to ask have you tried using avrdude by itself? It's not that hard.

here is the minimum syntax:
avrdude.exe -p [chip to program] -P [port your programmer is on] -c [name of programmer] -b [baud rate of programmer, usually 19200]

Major parts:
*any of these parts you would do good to add -e which erases the chip before doing whatever you want it to do.*
to lock, or unlock the bootloader add this to the end of the syntax:lock:w:[lock/unlock bits]:m
to set fuses add this to the end of the syntax:lfuse:w:[fusebits]:m -U hfuse:w:[fusebits]:m
to flash a hex file add this to the end of the syntax: flash:w:[your .hex file]

So for example to unlock the bootloader, burn the bootloader, lock the bootloaderset the fuse bits, and then flash an app to an atmega32 using an Arduino As ISP, you would type:

*unlocks chip and uses internal 8mhz oscillator*
avrdude -p m32 -c avrisp -b 19200 -P com4 -e -U lfuse:w:0xd4:m -U hfuse:w:0x99:m
*unlock bootloader*
avrdude -p m32 -c avrisp -b 19200 -P com4 -U  lock:w:0x3F:m
*flash arduino bootloader*
avrdude -p m32 -c avrisp -b 19200 -P com4 -e -U flash:w:AtmegaBOOT_168_diecimila.hex
*lock the bootloader in*
avrdude -p m32 -c avrisp -b 19200 -P com4 -U lock:w:0x0f:m
*upload a hex file(or arduino sketch if you may call it. still a hex file)*
avrdude -p m32 -c avrisp -b 19200 -P com4 -U flash:w:atmega32blinkpin32.cpp.hex

***Also***
I have recently found you can upload arduino code through your isp programmer straight to the chip! So you don't have to even have an ftdi if you don't want (and you don't have to use avrdude directly to do it either!)

For your atmega 8, change the boards.txt entry to this:
Code:
atmega8.name=Atmega8 programming through ISP

atmega8.upload.using=avrisp*or the name of your programmer!
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200

atmega8.bootloader.low_fuses=0xdf
atmega8.bootloader.high_fuses=0xca
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=16000000L
atmega8.build.core=arduino
« Last Edit: March 06, 2011, 11:17:02 pm by hexskrew » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This method worked for me on a atmega328-PU very well after being unable to get my breadboard 8Mhz Arduino bootloader working properly!

I also used
atmega328bb.upload.speed=19200  (for some reason the breadboard.zip sample has the 8Mhz chip set 56kbps, which didn't  work for me).
and
signature       = 0x1e 0x95 0x14;  (instead of 0x1e 0x95 0x0F, in avrdude.conf)

Logged

Pages: [1]   Go Up
Jump to: