AVRdude and the dreaded '-F' option

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The description of the -F option is...

 

Quote:

-F

Normally, AVRDUDE tries to verify that the device signature read from the part is reasonable before continuing. Since it can happen from time to time that a device has a broken (erased or overwritten) device signature but is otherwise operating normally, this options is provided to override the check.

(my bold)

 

Has anyone ever come across an AVR with an erased or overwritten device signature?

 

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not an AVR.   But I did have an AT89S52 with a bad signature.    In every other respect it was fine.

If you do happen to have an errant Signature on a known good chip,   you should just add a matching entry in your private avrdude.conf

 

I have always assumed that the -F "advice" was to justify lengthy threads on AvrFreaks.

 

On most occasions it is bad wiring or inappropriate clock speed/fuse.   Which is exactly what avrdude advises.

IMHO,   avrdude should advise about wiring and clock.    It should never suggest -F

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, a few months back, an error reading the signature was indeed solved with the "-F" option. So these things, while extremely rare, apparently do happen.

http://www.avrfreaks.net/forum/f...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It also allows "slow" users to avoid updating their AVRdude when new MCUs become available. You know, like M238 :)

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

It also allows "slow" users to avoid updating their AVRdude when new MCUs become available. You know, like M238 :

It is not the only option for that situation, but it is possibly the worst.

The obviously best is of-course to update avrdude. 

Next best would be to hand-edit the cofig file of avrdude, adding a new entry. 

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh, I totally agree. But are "slow users" likely to do that? Of course, "slow users" include:

 

1. The "why update when the old one  still works just fine" (except, of course, it doesn't because it does not include keys  for newer devices).

 

2. The "I'll update when I have nothing else, more pressing to do" (except, of course, that such a time never comes).

 

3. The "I'll update when I remember to do it" (except, of course, the memory often seems to be a blank slate)

 

4. The "Yes, I known that I am a procrastinator, but ...." (except that procrastination is a habit).

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Mon. Oct 30, 2017 - 03:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

-F , the first letter of the next word that comes out of your mouth when you do mess up a chip.

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." - Marcus Aurelius               

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So Larry to what do we owe the pleasure of this flurry of activities on your part? Did you escape, did they let you out or are you simply bored with zipping around Europe in Lamborginis, Ferraris, Maseratis etc. and just wanted to be reminded what the simple folks do for fun? cheeky

 

For me it's the later of course......

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has anyone ever come across an AVR with an erased or overwritten device signature?

It is a long time ago.

I experimented with an ISP programming software (like Arduino ISP sketch) and ended up with the signature deleted.

Except this, the chip (M168) worked normally.

 

 

  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you still have that chip?
.
Is it just the 3 Signature bytes being set to 0xFF?
Or has the whole signature row been erased?
.
It is easy to modify avrdude.conf to read other bytes in the signature row.
Or just use the regular SPM facilities at runtime.
.
There has often been speculation that the signature row is writable. After all, the Calibration byte must be written at some point in manufacture.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I remember well, the signature was read as FF FF FF.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

[

david.prentice wrote:

There has often been speculation that the signature row is writable. After all, the Calibration byte must be written at some point in manufacture.

 

There are a couple of snippets in the datasheet.

 

Quote:

• Bit 5 – SIGRD: Signature Row Read
If this bit is written to one at the same time as SPMEN, the next LPM instruction within three clock cycles will read
a byte from the signature row into the destination register. see ”Reading the Signature Row from Software” on
page 277 for details. An SPM instruction within four cycles after SIGRD and SPMEN are set will have no effect.
This operation is reserved for future use and should not be used.

 

Quote:

28.3 Signature Bytes
All Atmel microcontrollers have a three-byte signature code which identifies the device. This code can be read in
both serial and parallel mode, also when the device is locked. The three bytes reside in a separate address space.
For the ATmega48A/PA/88A/PA/168A/PA/328/P the signature bytes are given in Table 28-10.

 

(my bolds)

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmmm, there are lots of gaps in the command format for either parallel or serial programming.

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

While a dude, I'm not a big 'Dude person.  So, can -F be abstracted to "skip/ignore signature check at head of ISP sequence"?

 

If so, I can think of only one instance over the years:  Mega162 in M161C compatibility mode.  Those are always tough -- if you only intend to have one "emergency" oddball production batch, do you make another firmware set just for that?  A balance a year from now/then on how the circumstances will be remembered for the next build.

 

Somewhat like the '328" situation mentioned earlier, it may have nothing to do with updating tools but rather an oddball model used for this particular production batch that varies only in signature perhaps.

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the programmer can "connect", it can read the Signature. If the Signature is correct for the part number printed on the package, you simply stop and add the appropriate entry to the avrdude.conf file.
.
A subsequent run will recognise your new device and program normally.
.
No one would EVER sell a product with a damaged signature chip.
But it is not unreasonable to create a matching entry for hobbyist use.
.
Yes, the -F switch ignores a bad signature. I can not see ANY situation that justifies its use.
I presume that it was added for punters that were used to AS4. The AS4 GUI would report a bad signature but made no attempt to stop you shooting your own foot.
.
I have always assumed that this is standard GUI philosophy. i.e. ignore errors
.
David.