safemode and -V result in odd warnings/errors about fuses without -u

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

safemode and -V result in odd warnings/errors about fuses without -u

Britton Kerin
I often use -V to speed up edit-compile-debug.  This always results in
a message like this:

     avrdude: safemode: Verify error - unable to read efuse properly.
Programmer may
not be reliable.

Almost always the next line after this is:

    avrdude: safemode: Fuses OK (E:FD, H:DA, L:FF)

This seems inconsistent, since avrdude just claimed it couldn't verify
the fuses.  Every once in a while there is instead a prompt saying
fuses changed, should change back y/n or something about like that.  I
wonder if something isn't being initialized right, and ends up with -V
(without -u) sometimes triggering this?

Adding -u as well of course stops the warning by disabling safe mode.
I guess what's going on here is -V causes the fuses to not be read
back out.  If this is indeed the case, I'd say the warning is pretty
misleading and should be changed, probably to suggest -u as well.  And
the next line about fuses being OK is totally wrong.

I guess -V could still read back the fuses if safe mode is not
disabled, as that's pretty fast.  But maybe it's sort of weird.  I
think I like best the current behavior (assuming I'm right about it)
but with a better message (and not the initialization problem,
assuming I'm right about that).

Britton

_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat
Reply | Threaded
Open this post in threaded view
|

Re: safemode and -V result in odd warnings/errors about fuses without -u

Erik Christiansen-2
On 15.10.19 13:32, Britton Kerin wrote:

> I often use -V to speed up edit-compile-debug.  This always results in
> a message like this:
>
>      avrdude: safemode: Verify error - unable to read efuse properly.
> Programmer may
> not be reliable.
>
> Almost always the next line after this is:
>
>     avrdude: safemode: Fuses OK (E:FD, H:DA, L:FF)
>
> This seems inconsistent, since avrdude just claimed it couldn't verify
> the fuses.  Every once in a while there is instead a prompt saying
> fuses changed, should change back y/n or something about like that.  I
> wonder if something isn't being initialized right, and ends up with -V
> (without -u) sometimes triggering this?

While I don't use -V, my reading of the manpage is:

» When enabled, safemode will issue a warning if the any fuse bits are
found to be different at program exit than they were when avrdude was
invoked.«

I.e. The reported gobbeldygook then means "You changed 'em, I didn't.
It's up to you."

> Adding -u as well of course stops the warning by disabling safe mode.

Well, not quite. The manual says that it only does:

» -u      Disable the safemode fuse bit checks. «

I.e. It is the supported means for avoiding the inappropriate message
produced by code which is evidently written to handle real errors, and
has not been tweaked to reword itself when you've turned off its ability
to detect whether you're meddling with the fuses.

> I guess what's going on here is -V causes the fuses to not be read
> back out.  If this is indeed the case, I'd say the warning is pretty
> misleading and should be changed, probably to suggest -u as well.  And
> the next line about fuses being OK is totally wrong.

Yup, spot on. But the avrdude homepage hasn't been edited since 2010,
and the last serious guru to appear on this list is Juerg Wunsch, back
in 2016, so any code tweaking is up to us, I figure. (Fiddling a few
printf statements, and even a conditional or two, is no big deal, but
I'm up to my armpits building an off-grid retirement abode, as an
owner-builder, and have some AVR-based networked LED lighting
controllers to finish when the building's done.)

I'd just use -u, as that's what's available - and it works. :-)

Erik