Avrdudess ATtiny45 verification error

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

I'm programming an ATtiny45 with a USBasp and AVRDUDESS and using the Arduino IDE (1.8.5) to compile my sketchs with ATtinyCore library. Everything was going just fine. I've already programmed dozens of hex files and had no problem whatsoever. Until someday I tried to download a recently compiled sketch and got the verification error below:

 

avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x1f

avrdude: verification error; content mismatch

 

Thing is: I tried to download a previously generated .hex of the same program to the ATTiny and succeeded. That makes me think the Arduino IDE changed the compile method or anything like that, since I cant program any new generated .hex files. Although I don't think it has updated along this period.

Any guesses?

Thanks in advance :)

 

Heitor

Last Edited: Thu. Mar 14, 2019 - 05:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is (partial) support for ATtiny85 in the

Arduino IDE if you select the Gemma board.

The 45 is just a smaller version so it should

be possible to coax Arduino to program it.

 

There is a boards.txt file somewhere in the

Arduino install directory. Exit the Arduino IDE
and edit this file. Search for the Gemma board

and make a copy of the settings. Choose a

name, something like Tiny45 and edit the

settings accordingly.

 

Start the Arduino IDE and look under Tools ->
Board for your new entry.

 

It's also possible to add a second processor to

an existing board, so you could select the Gemma

board and then also select between tiny85 and

tiny45 under Tools -> Processor. There are some

examples of other boards which have more than

one processor so just copy what they did to get

this working.

 

 

--Mike

 

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

Isolate the problem:

 

Did you recently upgrade the Arduino IDE?  I have found that on some old programs I have to add function declarations now before the .ino file will compile.

Upgrade AVRdudess?  AVRdude?  Are the settings in AVRdudess the same as before?

 

Tried different USBasp module?  Tried a different Tiny45?  Is the USBasp powering/or not-powering the Tiny45 target?
 

Are the electrical signals getting from the USBasp module to the Tiny45?  MOSI, MISO, Reset, SCK, Vcc, Gnd 

Can you see all these signals on an oscilloscope or one of those $8 Saleae Logic Analyser clones?

 

Intel Hex files are ASCII based.  Does the old working hex file look like the non-working new one (in a hex editor program)?

 

Does your code load and work as before when loaded into an Arduino Nano (mega328P-based) instead of a Tiny45?

 

Last Edited: Wed. Mar 13, 2019 - 06:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Mike, thanks a lot for the answer!

 

I'll try what you suggested and come back later with the results, but i suspect that's not the case. I can still download to my ATTtiny files that was generated previously in the same way I'm generating the new ones right now, and it works just fine. I also tried to repeat this process with a ATmega328, using the package of the link below to program the chip without an arduino board. Had the same issue: I can flawlessly download .hex files that I've generated previously a certain date, but not the ones i'm creating right now.  I think that's something to do with how the ide itself is compiling my program or how it's exporting the binary file. What do you think?

Appreciate the attention :)

 

https://raw.githubusercontent.co...

Heitor

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

Thanks for your answer, Simonetta.

 

As I was writing a response to your answer, I found the source of the problem. I'm using Adafruit_NeoPixel library to control a ws2812 pixel led. When I import it, even though the IDE compiles the sketch error free, I get the verification error when trying to donwload. If I remove the lines that make use of that library, Im able to download the resulting hex file again.

 

Just reinstalled that library and now it works just fine. Don't know exactly what the issue was, but I do remember getting a error with this library before after trying to "innovate" a little. Some config file must've changed.

 

Thanks for replying anyway, appreciate it .

 

Heitor

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

heitormasson wrote:
When I import it, even though the IDE compiles the sketch error free, I get the verification error when trying to donwload. If I remove the lines that make use of that library, Im able to download the resulting hex file again.
Could it be that it simply builds too big for a 4K micro perhaps?

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

Hello clawson, thanks for your answer.

 

Maybe the size really is a problem. I have new information: the verification error persists and occurs even when I'm not using that library. The pattern I was able to identify is: the bigger the file, the more likely it is to get verification error. I tried programming the same .hex file multiple times, now to a ATmega328 barebones (using the same method I was using to program the Tiny45, except for the AttinyCore library, of course). If  the file is below about 700 bytes, I rarely get verification error, but it still happens. When I use Adafruit library and define a adafruit_neopixel object, the .hex file size goes up to almost 2k bytes. and verification errors are far more frequent, which even makes it hard to get a successful download. I tried it with the "old files" I thought weren't a issue, but they show the same result.

 

This has happened only for a few days. I really don't have a clue on what's changed. Or maybe nothing has changed and my programs just got a lot bigger? Don't think thats the case, though.

Heitor