AVR910 - Universal Programmer Improvement suggestion #1652
Replies: 6 comments 8 replies
-
Thanks for the enhancement idea.
Why not publish the FW source code of your enhancement in your github repo? And then raise a PR to enhance avrdude to support your enhanced avr910 programmer. We may treat it as a new programmer and not touch the existing avr910, so you can actually use a new name which you like. Without an open-source FW, I do not think avrdude project will want to support it, now that we have the support of many programmers (some may say too many). |
Beta Was this translation helpful? Give feedback.
-
Existing discussions on avr910. |
Beta Was this translation helpful? Give feedback.
-
I am sure your protocol that is loosely based on the AVR910 protocol works for programming the four parts that you have tried it with. If, in your suggested modification, avrdude were to request the low fuse (your command
In the early days, different parts required different bit patterns and they had different mechanisms to read/write flash and or eeprom and different mechanisms to recognise when it was safe to communicate with the part again (different write delay timings among those). So, what you describe as beyond dumb and useless was, and still is, necessary to program these older parts. You may not care about these parts, but ATmel did and the AVRDUDE project does. Your idea is not the first extension of the AVR910 protocol and certainly not the only one. Extending the AVRDUDE 910 protocol to your suggested one is out of question as it would rule out other extensions that might be more useful, eg, cater for flash in excess of 128 kB. Can I suggest that once your work
you are welcome to submit a PR for adding a |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Well, no: you marked 5 parts as "exception" in your own analysis after mapping x to 0 and ignoring the last (output) byte. Notwithstanding this, it is not AVRDUDE's place to argue whether a protocol is good, bad or ugly. The project facilitates programming with existing, popular and working programmers using published protocols. Happy to continue the discussion once your idea gets to that place. |
Beta Was this translation helpful? Give feedback.
-
I am locking this conversation. @flyandancexo |
Beta Was this translation helpful? Give feedback.
-
I have successfully tested my new programmer very loosely based on AVR910 on an Atiny13, atmega88, atmega16 and atmega128 with AVRdude V6.3 and AVRdude V7.2, and this covers page size from 32-256 byte; The screenshot is on an Atmega128 using V7.2 with a write speed of 129998/6.05=21487 and read speed of 129998/3.57=36414; It's still a working project, and so the final speed would be much faster. To actually create something great; it's very complicated that I have been spending more than 5 months working on it up to this point, and it's still not done yet.
======================================================
I can modify the source code for AVR910 easily, but I will let you do it, since I am not part of the team, but here I am providing some insights that I know that can make AVR910 great for the future.
devcode:
What the heck is devcode? Does anyone actually understand what it's? It's absolutely nothing I can tell you. First thing first, it should be removed or make optional. The absolutely key thing that is required to properly program a MCU correctly is simply the target MCU's page size because different MCU has different page size, to properly programming different MCU, this is critical and AVRdude shouldn't need to request this information from the programmer, but instead can get that from the -p option via AVR-part.
The command order is incorrect in AVEdude's AVR910 implementation: page size is requested before the target MCU is actually being selected, that means it's literally mission impossible for anyone to actually able to create a working programmer using AVR910. The point of the devcode is for the host to selected a supported MCU by sending back its picked code back to the programmer.
This is my magic of actually able to send back the correct requested page size. A lot of information can be extracted from the signatureBytes.
Universal command:
It sounds useful, but beyond dumb. It's useless basically. Below is my code that works around this problem. Instead of using universal command, use those my suggested command codes to request various fuses back. It's simpler and easier.
======================================================================
Correct order:
This is a log that I have saved and re-order to a correct and proper order. Order is important. For example, issuing a page write command before chip erase is incorrect. It's not possible to write to a page without it being erased first.
If the programmer didn't pass the 'P' stage, then it should terminate the programming event. Going forward at that point is meaningless. Send a 'L' command to terminate it.
Then signatures are checked with the provide -p option, and again terminates it if it's not matching.
Fuse can be checked after that or not, safe mode.
T and t option should be made optional or removed completely.
Page size is the 'b' command, this shouldn't be requested in the first place because page size can be extracted form AVR-part, but this can be read back as a confirmation. 1, if the answer is 'Y' and the page size is a valid size of 32-64-128-256, then this over-rides AVR-Part, and a warning message should be promoted. 2, If the answer is not 'Y', then use the page-size provide by AVR-part;
Block mode or page mode should be used under any circumstance, and so the 'a' can be made optional. There are more that can be changed, but to make it compatible with older version, a lot of the not required things should be made optional. For example, if 'S' option is made optional, older programmer should still work. It's just not responding with a 7-byte string, no problem at all, but if you were to increase the 'S' option string to 8 characters, then it would not work properly.
Last but not least, change the AVR910 description to New 2024 Updated Serial Programmer. The old description sounds very cheap.
Beta Was this translation helpful? Give feedback.
All reactions