-
Notifications
You must be signed in to change notification settings - Fork 151
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
SerialUPDI does not support page erase #1111
Comments
Hi Dawid!
I'm sorry to hear that! There's no rush, so do it if/when you have the energy to look into it. Here are some test commands you can use for testing with the latest upstream version of Avrdude. You can paste it all at once in the terminal window. For more info regarding terminal flash write, see #1106.
Here's the result with and without page erase support for a JTAG3 programmer. Notice the warning message and the read time for the second last command: Without jtag3 UPDI page erase fix
With jtag3 UPDI page erase fix
|
@dbuchwald Thanks for reply - I hope things go well. In order to force page_erase() one can stay in the avrdude terminal (now there is the new
Or, from a linux bash
The reading/chip erase/writing cycle is not necessary when page_erase is properly implemented. The terminal tries to use page_erase() whenever it needs to set a previously cleared bit in flash; if it's not there or doesn't work the chip is read, erased and written back. |
There is a write-up here, not so sure if it is relevant or not. |
Hey,
First of all, sorry for the whole delay, it’s just that I couldn’t find time to properly test it until now.
I have filed new PR for this change, it seems to be working fine, but…
There is something weird about the data being written to and from the cache. Maybe it’s that I don’t understand what is supposed to happen, but I was confused enough to put all the info in the PR.
Let me know if the PR provides the functionality you expected.
Best regards,
Dawid Buchwald
On 6 Oct 2022, at 20:22, Stefan Rueger ***@***.******@***.***>> wrote:
@dbuchwald<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.ghproxy.top%2Fdbuchwald&data=05%7C01%7C%7C3411ec515d2446ac3e0e08daa7c7bc0b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638006773539447802%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J89DXom5ekPebiI8SXKeAwkQH9vJKkxLQTWCp58nnvM%3D&reserved=0> Thanks for reply - I hope things go well.
In order to force page_erase() one can stay in the avrdude terminal (now there is the new flush command):
erase
write flash 0 0
flush
write flash 0 255
flush
Or, from a linux bash
$ echo "erase;write flash 0 0;flush;write flash 0 255;flush" | tr \; \\n | avrdude -c ... -qqp ... -t
avrdude> erase
avrdude: erasing chip
avrdude> write flash 0 0
avrdude> flush
avrdude: synching cache to device... done
avrdude> write flash 0 255
avrdude> flush
avrdude: synching cache to device... reading/chip erase/writing cycle needed ... done
The reading/chip erase/writing cycle is not necessary when page_erase is properly implemented. The terminal tries to use page_erase() whenever it needs to set a previously cleared bit in flash; if it's not there or doesn't work the chip is read, erased and written back.
—
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.ghproxy.top%2Favrdudes%2Favrdude%2Fissues%2F1111%23issuecomment-1270502872&data=05%7C01%7C%7C3411ec515d2446ac3e0e08daa7c7bc0b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638006773539447802%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ChmTA2EtllhlIlr9PWmp%2F5ypXQjiAAIWCOAymAiCd1Q%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.ghproxy.top%2Fnotifications%2Funsubscribe-auth%2FAAMBKN32E7BIEKCIYUCJ7VDWB4KGPANCNFSM6AAAAAAQ6HCT4U&data=05%7C01%7C%7C3411ec515d2446ac3e0e08daa7c7bc0b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638006773539447802%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KpH%2FUu5LQfN%2FMz15RhEkYg0E0kAAX1mup4HBPcdWnmw%3D&reserved=0>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
255 is interpreted as signed integer. Either use 0xff or 255U to make it unsigned. A signed 255 does not fit into one signed byte that has a range of [-128, 127]. This needs two bytes. |
PR #1151 has been merged. |
Now that #1106 is merged, page erase support is getting more relevant, as Avrdude only needs to erase the pages modified and not the whole memory. @dbuchwald did a fantastic job with the current SerialUPDI implementation but is lacking (flash) page erase support.
avrdude/src/serialupdi.c
Lines 885 to 891 in 44fe5be
However, it appears that the underlying functionality is already present:
avrdude/src/updi_nvm.c
Lines 1075 to 1088 in 44fe5be
I'm currently working on UPDI page erase support for JTAG3 compatible programmers.
The text was updated successfully, but these errors were encountered: