avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] Safemode - oops


From: Brian Dean
Subject: [avrdude-dev] Safemode - oops
Date: Thu, 10 Feb 2005 22:52:10 -0500
User-agent: Mutt/1.4.2.1i

Hi,

I got bitten by safemode the other day in that I use a driving script
to diagnose and test out the boards that I make.  As part of the
process, I call avrdude to change fuse bits and load a diagnostics
program.  The diags were failing and I couldn't figure out why because
everything else was checking out.  It turned out that safemode was
keeping the fuse bits from being set, and thus the ATmega128 was
running in ATmega103 compatibility mode (default fuse setting shipped
by Atmel) and my diag firmware was not running correctly due to that
since the code was built for an ATmega128.

I didn't notice the safemode change in behaviour because all the
output from avrdude was being supressed by my driving script (python)
- I just check the return value from the program to know whether
programming succeeded or not, thus I got no indication that the fuse
bits were not being changed.

Before we release, I propose we make avrdude return a non-zero error
condition if any fuse bits are being requested to change, but the -u
option is not specified.  We already print out a warning, but since my
process is automated and I rely on the avrdude return code to know
whether all the requested operations succeeded, I did not see the
text.  I'm guessing I will not be the only one that runs into this.

I'm thinking of something like the attached patch.  It will return
non-zero if all of the following are true:

     1) -u is not specified

     2) fuses are specified to be programed

     3) fuses are actually changed (different from when avrdude was started)

     4) safe-mode restores the fuses back to their default values

Thus, the idea is to return non-zero when an action is requested but
is not performed.

Any thoughts on this?

-Brian
-- 
Brian Dean
BDMICRO - ATmega128 Based MAVRIC Controllers
http://www.bdmicro.com/

Attachment: patch.safe
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]