-
Notifications
You must be signed in to change notification settings - Fork 149
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
FLASH write fails if there are odd number of bytes. #1068
Comments
The AVR flash is organized in units of 16 bits. So you cannot write a single 8-bit entity to it. Strange enough, the Normally, any program that produces flash data for the AVR is supposed to pad them to a full 16-bit word. |
@dl8dtl I know, that it is impossible to write one byte to AVR, because ISP commands are two bytes oriented. But if You write program where You use const string located in PROGMEM(FLASH), there is possible that hex or bin contains odd number of bytes. And Avrdude behave not clear, people thinks that MCU is corrupted, and try to switch it to "good" one.
|
I think this is a good workaround for flash. |
For terminal mode, I think this seems to be okay now (fixed in git main) thanks to @stefanrueger's various fixes to the terminal mode.
|
Actually I can not reproduce the issue for
|
Using the test file from the original report, both avrdude 7.0 release and git main are okay.
|
Can you try different programmers (eg: usbasp) to see if the issue is also there? Thanks. |
Hi, @mcuee ! With COM port based PonyProg I have this:
I think reason is - USBASP and USBTINY forms write/read commands inside programmer MCU. But PonyProg do this by avrdude, pulling or pushing COM port pins. So, problem is with PonyProg code. r. InspectorColombo. |
Would you please try latest git main to see if there are any different in behavior now? Thanks. I am thinking PR #1188 might help in your situation. @stefanrueger |
I am hoping that PR #1188 removed this issue as -c programmers only ever see full pages to write that would have been padded from device contents. Say your hex has a single byte, the other bytes from the page it sits in will be read in from the device and the full page given to the programmer to write. I neither have the part nor the programmer, though. |
Unfortunately I can not reprodeuce the issue with an FT232 adapter which uses bitbang with avrdude 7.0 release or the latest git main. However, from the prompt, we can see the latest git main writes 817 bytes and not 818 bytes. So I believe the issue is sorted out.
|
Please help to try the latest git to see if it sorts out the issue for you. Thanks. I will close the issue in the end of Jan 2023 if I do not hear any news. In that case, you can still re-open the issue if there are still issues. Thanks. |
It is vvv likely this has been solved with PR #1265, which applies to all programmers that do not offer paged read/write such as par and serbb, both of which are used for the PonyProg device. |
Just wondering if you can test avrdude 7.1 release against this issue, with the parallel port programmer and ponyser programmer you have. Thanks. |
Just wondering if you have time to revisit this topic to see if the issue has been resolved. Thanks. |
I think that can be closed... confident PR #1265 worked. |
Hi!
AVRDUDE fails with writing to FLASH if there are even number of bytes. If bytes count is odd, everything is fine.
I suppose it skips writing for single byte, because AVR commands are always 2(or sometimes, 4) bytes length.
System - Win10_x64
MCU - ATmega8535
Programmer - PonyProg like with COM(RS232) interface.
Actually 1st time I faced this bug in old 2007, with LPT based programmer. I've workaround it by manual add one 0xFF byte to binary file. So, I am surprized, when I saw same problem in 2022. It's weird, that no one reported it before.
Issue is reproduced with bin and with hex file format. And I'm sure it is not programmer or MCU dependent.
TestFiles.zip
Here is test hex and bin files in archive.
r. Peter Falc.
The text was updated successfully, but these errors were encountered: