-
Notifications
You must be signed in to change notification settings - Fork 136
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
Bad EEPROM dump from ATmega328p using Adafruit 'Arduino as ISP' programmer #990
Comments
I inspect ATmega328 EEPROM section in avrdude.conf here and notice that paged=no but page_size=4. Changing page_size=0 or remove the line fix the bad EEPROM dump above. |
I could also confirm that the configuration for ATmega48/88/168 also have the same offending line but I don't have the physical uC to verify. |
Maybe try If you want to erase EEPROM consider sth like
Your first for loop looks wrong (though it erases EEPROM OK). And note you don't need to erase EEPROM before you write/update it. |
I disabled EESAVE fuse in my project so EEPROM erase is a precaution. My erase loop looks funky because later I'll be saving 2 data byte in a word since eeprom_read_byte() only use byte-based addressing. Short update. Switching the programmer to
Since my simple modification above sort out my specific need, I will come back to this issue later. |
My bad, I did not realize there is a difference between ArduinoISP and 'Arduino as ISP'. I like to clarify that I'm using 'Arduino as ISP' programmer soo |
You may want to try Edit: both seem the same for this "Arduino as ISP" use case. |
BTW, it seems to me ScratchMonkey (stk500v2) is better than "Arduino as ISP". This is the testing using ScratchMonkey (stk500v2) and it seems to work fine. So I tend to think avrdude.conf is okay.
|
WIth the same setup (one Arduino Uno clone with m16u2, one Arduino Uno clone with CH340) , somehow I can not get "Arduino as ISP" sketch to work, strange. I have used the "Arduino as ISP" sketch previously.
|
Okay I have to reduce the baud rate to 19200 for my setup to work. I can not reproduce the issue (verified with both usbasp and the "Arduino as ISP" itself).
|
@x0urc3
|
@dl8dtl BTW, Atmel document https://github.com/avrdudes/avrdude/blob/main/atmel-docs/STK500v2-AVR068.pdf seems to say that AVRISP is the same as STK500v2 in most cases except some unique features of the STK500v2. But then avrdude's Is it that the original AVRISP FW is compatible with STK500v1 and later FW is compatible with STK500v2? |
@mcuee as I mentioned in my first post, terminal mode (-t) works fine. I am having trouble when using |
No issue here as well.
Using usbasp to verify as well.
|
I want to replicate @mcuee test case by writing and reading using -U argument, but my setup is not cooperating.
|
BTW based on avrdude.conf both |
Just FYI for my setup. Programmer: Arduino Uno with "Arduino as ISP" sketch. @x0urc3 Please give the "ScratchMonkey" sketch a try, it is emulating stk500v2 protocol and works better for me. Ref: you can see my test results here, no need to patch avrdude. |
Thanks @mcuee for the feedback and suggestion |
@x0urc3 Glad that you have found the root cause of the issue. Please close this issue then since it is not an avrdude problem. |
bad-dump.hex.gz. The data seems to repeat itself at the 256 boundary i.e. 0x100, 0x200, 0x300. Command used are as follows:
The text was updated successfully, but these errors were encountered: