Avrdude Verifcation failure when using -q switch

This isn't Arduino per se, but just wondering if anyone's come across this before - I was initially using the VisualMicro IDE to upload to a Tiny85 using a TinyISP programmer, but have now removed the IDE from from the suspects list and can reproduce with just avrdude and my compiled .hex

Basically this works:

avrdude -c usbtiny -p attiny85 -U flash:w:Tiny85Test.hex

but adding the -q switch like this fails

avrdude -c usbtiny -p attiny85 -q -U flash:w:Tiny85Test.hex

with the following error

avrdude: verification error, first mismatch at byte 0x00c0
         0xb0 != 0x68
avrdude: verification error; content mismatch

I'm using the Arduino 1.0.3 fileset and the Avrdude that that contains...
Unfortunately VisualMicro adds the -q when it builds teh Avrdude command line, so the upload always fails.

A bit more investigation shows that it fails with avrdude v5.11 but succeeds with v5.10

I was wondering if it could be a timing issue, since outputting the ### progress markers on the console might be slowing things down enough to affect timings somewhere...

I don't know if this helps:

I noticed that a new release of avrdude, was released just one month after ver. 5.11 called 5.11.1

So maybe there was a bug in 5.11 ?

http://download.savannah.gnu.org/releases/avrdude/

More about ver. 5.11 problems

http://arduino.cc/forum/index.php/topic,152732.0.html

I'm using USBtinyISP and avrdude 5.11. I use it on a lot of different chips, it works fine.

yet another error report re.: avrdude ver. 5.11 and 5.11.1 and USBTiny

http://forums.adafruit.com/viewtopic.php?f=25&t=28382

I'm using USBtinyISP and avrdude 5.11. I use it on a lot of different chips, it works fine.

Maybe difference in firmware version or driver or OS ?

I get the verification failures usually when the programmer's sck clock is too fast when the attiny internal clocking set below 1.5 MHz. You can usually fix this by slowing down the sck clock signal. A few programmers like the usbtiny can be told to slow down with an avrdude -B option.

Try this:

avrdude -c usbtiny -p attiny85 -q -B50 -U flash:w:Tiny85Test.hex

You may need to experiment with bigger numbers -B100, -B250. Of course it will really slow down the programming the higher you go.

I suspect that that the -q option is removing some delays in outputting the progress bar display info. So in effect it is speeding up the writing a little bit.

Alternatively, if you are not able to use the -B option in avrdude, some programmers do not support that option, or you are not able to add that to the command sequence. You can try a programmer like the USBasp which will support a hardware jumper setting to use a slow sck clock. But be aware that there are many different versions of the USBasp and some do not support the hardware jumper setting.

I tried the 5.11.1 patch last night but no luck - problem still exists. I have just realised that this is still a 'virginal' Tiny85 - the fuses have not yet been set (due to a possible issue with VisualMicro) so that may have a bearing. it's supposed to be on 8Mhz internal clock but is currently on 1Mhz I think. I'll set teh fuses separately tonigth and see if that changes anything...

Were you able to try the -B50 option with avrdude? That should work with the 1MHz clocking.

Literally just tried it - still the same problem

Also burnt the fuses for 8 / 8 and 8 / 1 MHz - still fails at both settings :frowning:

Sounds like your USBtinyISP may be have problems. Or are you able to try another tiny85 chip to verify?
Do you have another type of programmer to test with?

I don't think it's the programmer as it worked fine with avrdude 5.10 and has been working for a couple of years. Don't have another '85 but I do have a '2313 so I'll try that as soon as I get a chance again