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

Binary sketch size: 45290 bytes (of a 258048 byte maximum)
avrdude: verification error, first mismatch at byte 0x0308
         0x62 != 0xff
avrdude: verification error; content mismatch

I found the offending code but can't figure out how it's broken. I've converted a png to hex and have it in PROGMEM. It's an icon that I'm going to display on a touchscreen. I have another icon that works fine.

Here's the relevant code:

The weird thing is that I have another icon I'm displaying the exact same way and it works fine. It compiles and uploads successfully. Once the code is uploaded it appears to still be running the old program and the reset button the arduino doesn't work. If I pull the USB and reconnect I get a blank screen and nothing in the Serial monitor. If I comment out just the prog_uint16_t it all works fine.

Code:
// after headers
extern unsigned int glovesicon[4096];

myGLCD.drawBitmap(120,110,59,60,glovesicon);

prog_uint16_t glovesicon[4096] PROGMEM={
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,   // 0x0010 (16) pixels
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,   // 0x0020 (32) pixels
......removed

prog_uint16_t glovesicon[4096] PROGMEM={
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF,   // 0x0300 (768) pixels
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8858
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Too many 0xFF's.  AVRDUDE, the program that uploads sketches, assumes that memory is full of 0xFF (has been erased).  If it sees that a page to be written is full of 0xFF it doesn't bother to send it.  Unfortunately the Arduino upload doesn't do a Chip Erase first so whatever garbage was left in FLASH is still there for the verification.

I don't know how to work around the problem.
Logged

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All those 0xFFs are probably white pixels. Maybe if I change the background of the image to slightly off-white it'll fix it??
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Changed it to a black background and it minimizes the 0xFFs and it worked fine. Thanks for the help.
Logged

Pages: [1]   Go Up
Jump to: