I’ve been working on an Arduino project with the Atmel ATMega328P on a custom board using an Olimex AVR-ISP-MK2 to program through the ICSP header and kept running into an error when trying to flash a newly compiled program to the 328P. The error would come up as “avrdude: verification error, first mismatch at byte 0x0002” when trying to burn the program and as “avrdude: verification error, first mismatch at byte 0x0000” when trying to burn the Ardunio boot loader.

I was getting frustrated trying to figure this verification error out but while talking it out with a friend I tried a few different things and finally came upon the cause of the problem, I had been omitting the -e flag when burning the bootloader and low and behold it worked out. Here’s my line for writing the Arduino 328P bootloader:

The -e causes AVRDude to erase the chip first, and then write the Arduino boot loader. After that you can upload the program to the AVR.

And here’s the line I used for the program

Hopefully this will help save someone the same frustration I ran into.

Tags: , , ,