-
Notifications
You must be signed in to change notification settings - Fork 139
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
Added fake EFUSE to atmega8 part. #981
Conversation
This allows to have a common platform.txt recipe for all the ATMegaXX parts in the Arduino IDE. See: arduino/Arduino#2075 (comment) arduino/Arduino#2075 Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Thank you for the PR Umberto! I've incorporated the same fix to my own 3rd party Arduino cores through their own avrdude.conf files, as it is a neat hack that works well with Arduino IDE. However, Avrdude is a standalone program that happens to be bundled with Arduino IDE, and adding a "fake" fuse that will show up in the "Memory type table" when using Avrdude in verbose mode:
So, in my opinion, I think it's best to leave this to forks and custom avrdude.conf files, like the one I use with my 3rd party Arduino cores. If not, we'll have to add a fake efuse to every target that only has a low and a high fuse, for consistency. But I'm very grateful that you're taking your time to submit these PRs! |
Since all newer AVRs don't fit into the classic lfuse/hfuse/efuse scheme anyway (let alone the very first AVRs ;-), I think there ought to be a better solution. |
This PR only makes it possible to pass |
When thinking a bit more, I don't think this is such a terrible idea after all. It's a very simple fix (see below), and it certainly makes this PR obsolete. @dl8dtl would such a PR?
diff --git a/src/update.c b/src/update.c
index 1500254..7cb1b99 100644
--- a/src/update.c
+++ b/src/update.c
@@ -222,9 +222,9 @@ int do_op(PROGRAMMER * pgm, struct avrpart * p, UPDATE * upd, enum updateflags f
mem = avr_locate_mem(p, upd->memtype);
if (mem == NULL) {
- avrdude_message(MSG_INFO, "\"%s\" memory type not defined for part \"%s\"\n",
- upd->memtype, p->desc);
- return -1;
+ avrdude_message(MSG_INFO, "%s: warning: \"%s\" memory type not defined for part \"%s\"\n\n",
+ progname, upd->memtype, p->desc);
+ return 0;
} |
I'm still not convinced at all why to hack up AVRDUDE for that. |
Well, it would make Avrdude a little more permissive. But it's not for me to decide whether this is a good thing or not. |
IMHO it's not a bad idea |
Here is a slightly different version that prevents Avrdude from trying to verify a non-existent memory and thus printing the warning twice. main.c for (ln=lfirst(updates); ln; ln=lnext(ln)) {
+ UPDATE * prev = upd;
upd = ldata(ln);
- rc = do_op(pgm, p, upd, uflags);
+
+ if (strcmp(prev->memtype, upd->memtype) != 0 || avr_locate_mem(p, upd->memtype) != NULL)
+ rc = do_op(pgm, p, upd, uflags);
+
if (rc) {
exitrc = 1;
break;
}
} update.c int do_op(PROGRAMMER * pgm, struct avrpart * p, UPDATE * upd, enum updateflags flags)
{
struct avrpart * v;
AVRMEM * mem;
int size, vsize;
int rc;
mem = avr_locate_mem(p, upd->memtype);
if (mem == NULL) {
- avrdude_message(MSG_INFO, "\"%s\" memory type not defined for part \"%s\"\n",
- upd->memtype, p->desc);
- return -1;
+ avrdude_message(MSG_INFO, "%s: warning: \"%s\" memory type not defined for part \"%s\"\n\n",
+ progname, upd->memtype, p->desc);
+ return 0;
} Output:
|
@MCUdude |
I am in favor of PR #1036 than this PR. It is a generic fix for such issues.
|
I agree |
@stefanrueger So this one should be superseded by #1053 right? |
@umbynos Correct. Try it out. In -U, using a known memory (ie, for which there is a part that has such a memory) that happens not to be defined for the particular part will just skip that one -U bit.
Specifically implemented that way, so that you don't need to add fake fuses (though that would still work if you wanted to do that in your private
|
This allows to have a common platform.txt recipe for all the ATMegaXX parts
in the Arduino IDE.
See:
arduino/Arduino#2075 (comment)
arduino/Arduino#2075
Co-authored-by: Martino Facchin m.facchin@arduino.cc