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

Problem downloading EEPROM from Arduino Mega 2560 #1011

Closed
ravenboy opened this issue Jun 24, 2022 · 4 comments
Closed

Problem downloading EEPROM from Arduino Mega 2560 #1011

ravenboy opened this issue Jun 24, 2022 · 4 comments
Labels
invalid This doesn't seem right

Comments

@ravenboy
Copy link

ravenboy commented Jun 24, 2022

Mac Big Sur, avrdude 6.3

in a sketch running on a Mega2650: using EEPROM library I wrote "757343238393515142B0" starting at location Zero

char buffer[] = "757343238393515142B0";
for (int i=0; i<21; i++) {
EEPROM.write(i,buffer[i]);
}

reading it works fine

char buffer2[21]
for (int i=0; i<21; i++) {
buffer2[i] = EEPROM.read(i);
}

buffer2[20]='\0';
Serial.printlin (buffer2);
prints "757343238393515142B0" to serial

when i download the EEPROM memory using AVRDude, i get no errors.
A printout of the hex file reveals :
b':2000000037353733343332333432423000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79\n:20002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0\n:20004000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0\n

etcetera

which has only 12 of the bytes i wrote to EEPROM
hex 37 35 37 33 34 33 32 33 34 32 42 30
ascii 7 5 7 3 4 3 2 3 4 2 B 0

i wrote 20 bytes 757343238393515142B0
so the download doesn't have 8 bytes in the middle.
the bytes missing start at position 7 and are the 8 bytes 83935151
so the download has the first 7 bytes of what i wrote
plus the last 4, but lacks bytes 8 thru 15

any idea how avrdude's download would disagree with what the arduino sketch can READ??

i used
avrdude -p m2560 -c wiring -P [port] -U eeprom:r:file.hex:i

@mcuee mcuee added the invalid This doesn't seem right label Jun 25, 2022
@mcuee
Copy link
Collaborator

mcuee commented Jun 25, 2022

That is probably becasue the wiring bootloader has an issue with EEPROM read. You need to build the bootloader again with this patch.

Ref:

@mcuee
Copy link
Collaborator

mcuee commented Jun 25, 2022

I will close this issue now. Please re-open if the above fix does not sort out your issue.

@mcuee mcuee closed this as completed Jun 25, 2022
@ravenboy
Copy link
Author

ravenboy commented Jun 26, 2022

many thanks!

@ravenboy
Copy link
Author

Thanks so much for the speedy and excellent support. Once i sussed out burning bootloaders, burning with stk500boot_v2_mega2560_eeprom_fix.hex is working!!!

@mcuee mcuee changed the title Problem downloading EEPROM from Arduino Mega 2650 Problem downloading EEPROM from Arduino Mega 2560 Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants