avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] device signature string


From: Michael Mayer
Subject: Re: [avrdude-dev] device signature string
Date: Fri, 12 Dec 2003 19:24:56 +0100
User-agent: Mutt/1.5.4i

On Fri, Dec 12, 2003 at 18:46:20 +0100, Jan-Hinnerk Reichert wrote:
> At least the latest AVR910 source I have (V2.2 from May 31st 2000) 
> does it like this.
> 
> So I would not expect that Atmel changes this behaviour in future 
> implementations of Butterfly-bootloader ;-)
ok

> If you are paranoid, just do a check for 0x1e and reverse order, if it 
> is at the end...
maybe, yes.


> > As mentioned yesterday, I want to try to use the signature string
> > to choose a default device, if no -p switch is given at the command
> > line. It seems to be only a relativly small modification, but it is
> > still work in progress.
> 
> IMHO the only problem is that the error handling must be moved from 
> "main.c" to each programmer.

Autodetecting the used part now works for me, it is no longer mandatory (but
still possible) to specify the part with the -p option. I'm quite shure it
will work for an avr910, too. I don't know enough details about the stk500 -
it may work or it may not. But, at least, it will not break it ;-)

Basicly, this was not complicated: Open the programmer, init it, read the
signature, if no part is specified on the command line lookup the part from
the signature, continue as usual - mostly a change in main().

Unfortunatly, pgm->initialize includes the code to tell the programmer which
part we want to use. But at this time this is not known, so I had to
seperate this part of the initialization into a second init function which
is called after the signature is read and evaluated.

The second structual change concerns the way the signature is read. It was
used to be read after the data structures for the part are initialized which
is not possible in this case. So I needed to add a very simple function to
read it, with a hardcoded length of 3 bytes.

This additional simple function is used only for autodetection purposes and
the original functions and datastructures to read the signature are still
included and functional. They were designed to be very flexible and even the
length of the signature is specified for ever single part in avrdude.conf.
I'm not shure about the reason for this. In AVR910 the signature is
specified to be always three bytes long. Do you think it is still neccassary
to be that flexible? Is there a possible scenario where it is not sufficient
just to read three bytes?

Right now, the autodetection hack is just a private proof-of-concept. I
don't send a patch right now because I feel these structural changes have to
be discussed first (if you are interested to include this functionality)
What do you think about this topic?

  Michael




reply via email to

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