-
Notifications
You must be signed in to change notification settings - Fork 147
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
[bug #34271] avrdude only writes the eeprom in 8-byte steps (stk500v2) #231
Comments
Joerg Wunsch <joerg_wunsch> Please try this again with a recent version, preferrably If it still fails, please submit a full -vvvv log as an |
Not so sure if this is related. The stk500v2 bootloader implementation out there seems to have problem with EEPROM Read. So probably it has problem with EEPROM write as well. |
Agree. OP didn't provide any verbose Avrdude output either... |
Not so sure if this is relevant or not. |
I'm currently on vacation, and only brought my phone. Is this basically just the stk500v2 bootloader EEPROM bug again? |
Yes looks like a problem again for the bootloader. |
The code changelog says the EEPROM write function has not been tested.
|
It seems to write only the first 8 bytes of EEPROM, worse than reading.
|
Comparison for EEPROM reading.
|
But the conclusion in the below URL is different from my experiences. It is said that EEPROM write should work. Maybe someone else can try to see if the bootloader works for EEPROM writing or not. Ref: https://forum.arduino.cc/t/trouble-reading-writing-eeprom-via-avrdude/467537 |
Yes, I did a little testing a while back, and my conclusion was that stk500v2 EEPROM writing works, but reading fails. I used the bootloader binary bundled with Arduino IDE. |
Maybe my clone (with CH240 using 12MHz crystal, and ATmega2560 using cheap 16MHz resonator) got some problem with the official bootloader. I will stop using this board for wiring/stk500v2 bootloader testing and get another Mega2560 board to see if that helps. |
Have you tried to re-flash the bootloader? |
Yes I have done that with the following bootloader hex file. Arduino Sketech Download is also a bit flaky for the Mega2560 CH340 Clone -- I need to follow the trick to reset the Mega2560 quickly to get the download to be successful, if not content mismatch and timeout error will happen. |
Without the reset trick -- run log within Arduino
With the reset trick it works.
|
Same for avrdude. Without the reset trick it will not work.
With the reset trick it works well.
|
@MCUdude Somehow the bootloader in your repo does not work for this board. Maybe I need to use another one.
|
Erasing the chip (including EEPROM and the reflash the booloader, here is the result. Now the read and write seem to match. But using AVR Dragon shows that the write is not that correct.
|
I will create a new issue for the EEPROM problem. |
@MCUdude Yes you are right. EEPROM write is good with the more proper bootloader hex file. I should not use this one. I should use this one which works better (but still with the EEPROM read problem). |
Niko D niko.delarich@gmail.com
Sun 11 Sep 2011 10:25:24 PM UTC
When uploading eeprom data to an at90can32 over ISP (STK500v2 bootloader), avrdude only transfers data correctly if the size is a multiple of 8.
If the data size is e.g. 12, only the first 8 bytes are transferred. No problems occur when transferring 8bytes or 16bytes. I verified that this is not a problem with my application code by running the command in verbose mode, where it is clearly visible that avrdude sends 8 as the size if 8 < size <16.
My setup:
at90can32 with a modified version of Peter Fleury's STK500V2 bootloader
avrdude v5.11 (latest).
I also tried it with an older version, 5.8cvs, yielding the same result.
This issue was migrated from https://savannah.nongnu.org/bugs/?34271
The text was updated successfully, but these errors were encountered: