Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verification error; content mismatch #7

Closed
ghost opened this issue Jun 18, 2016 · 3 comments
Closed

verification error; content mismatch #7

ghost opened this issue Jun 18, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 18, 2016

Gives this error when uploading codes using arduino IDE with USBASP, and when PORTE is used in the code, the code will not upload at all. but It uploads fine using the hex file generated in arduino IDE directly via avrdude.

avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x0100 0xff != 0x20 avrdude: verification error; content mismatch

bad.txt
good.txt

@MCUdude
Copy link
Owner

MCUdude commented Jun 18, 2016

are you using the latest version of MegaCore? Both codes uploads fine on my ATmega128 running at 16MHz using a USB to serial converter. Have you tried using another programmer like Arduino as ISP?

EDIT: I can reproduce the error when using an Arduino sketch. When using int main(void) it works just fine. I'll have a look at it

@MCUdude
Copy link
Owner

MCUdude commented Jun 18, 2016

I found the Issue! The good news is that there's nothing wrong with my core. The bad new is that there's nothing I can do about it..

You see, there is some kind of bug in AVRdude 6.0.1 (which Arduino IDE ships with) that gives this error. Running this code:


void setup() {
  DDRA = 0xff;
  DDRB = 0xff;
  DDRC = 0xff;
  DDRD = 0xff;
  DDRE = 0xff;
  DDRF = 0xff;
}

void loop() {
  PORTA ^= 0xff;
  PORTB ^= 0xff;
  PORTC ^= 0xff;
  PORTD ^= 0xff;
  PORTE ^= 0xff;
  PORTF ^= 0xff;

  delay(1000);
}

and uploading with AVRdude 6.0.1 using this command (generated by Arduino IDE):

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Users/Hans/Documents/Arduino/hardware/MegaCore/avr/avrdude.conf -v -patmega128 -cusbasp -Pusb -Uflash:w:/var/folders/_p/s3kykxss20bbhfmqcg0ctrp80000gn/T/build6448819071412050804.tmp/sketch_jun18a.cpp.hex:i 

gives this error:

Reading | ################################################## | 100% 0.28s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0100
         0xff != 0x0f
avrdude: verification error; content mismatch

avrdude done.  Thank you.

If I open Terminal (I'm using a mac by the way) and use the latest version of AVRdud, but still sticks with the same hex file and parameters:

avrdude -C/Users/Hans/Documents/Arduino/hardware/MegaCore/avr/avrdude.conf -v -patmega128 -cusbasp -Pusb -Uflash:w:/var/folders/_p/s3kykxss20bbhfmqcg0ctrp80000gn/T/build6448819071412050804.tmp/sketch_jun18a.cpp.hex:i 

This is the output:

Reading | ################################################## | 100% 0.21s

avrdude: verifying ...
avrdude: 720 bytes of flash verified

avrdude: safemode: hfuse reads as CE
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:CE, L:BF)

avrdude done.  Thank you.

If you won't use the bootloader I guess you'll have to use a newer version of AVRdude. You should probably create an issue over at the Arduino Github page where you suggest bumping up to AVRdude 6.3.

EDIT: It seems like someone already have thought about it!

@ghost
Copy link
Author

ghost commented Jun 18, 2016

okay, I see. thank you. Seems to me that this bug only happens when I use 0xff, the default value for all the memory.

@MCUdude MCUdude closed this as completed Jul 5, 2016
MCUdude added a commit that referenced this issue Feb 28, 2020
Update MajorCore core folder name in .travis.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant