AVR Dude reprogrammig Signature Bytes

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

My question is this. Can anyone who has had experience in either performing or is able to decipher the terminal commands to fix a Mega48 which was overwritten by a bad programmer device so as that it spilled over from the EEPROM area to the OSCCAL & Signature bytes.

I have fixed the Mega 48 now by setting the on board oscillator in the STK500 to 1KHz.

However the previously mentioned bytes are un-writeable with the STK500 & Studio.

 

According to the Introduction on page 5 v6.1:

"AVRDUDE can be used effectively via the command line to read or write all chip memory types (eeprom, flash, fuse bits, lock bits, signature bytes)"

The commands to enter on PDF page 18 are:

 

Chapter 2: Command Line Options

calibration
One or more bytes of RC oscillator calibration data.
eeprom The EEPROM of the device.
efuse The extended fuse byte.
flash The flash ROM of the device.
fuse The fuse byte in devices that have only a single fuse byte.
hfuse The high fuse byte.
lfuse The low fuse byte.
lock The lock byte.

signature
The three device signature bytes (device ID).
fuseN The fuse bytes of ATxmega devices, N is an integer number for each fuse supported by the device.

 

application
The application flash area of ATxmega devices.
apptable The application table flash area of ATxmega devices.
boot The boot flash area of ATxmega devices.
prodsig The production signature (calibration) area of ATxmega devices.
usersig The user signature area of ATxmega devices.

The op field specifies what operation to perform:
r read the specified device memory and write to the specified file
w read the specified file and write it to the specified device memory
v read the specified device memory and the specified file and perform a verify operation
The filename field indicates the name of the file to read or write. The format field is optional and contains the format of the file to read or write.

Possible values are:
i Intel Hex
s Motorola S-record
r raw binary; little-endian byte order, in the case of the flash ROM data
e ELF (Executable and Linkable Format), the final output file from the linker; currently only accepted as an input file
m immediate mode; actual byte values specified on the command line,
separated by commas or spaces in place of the filename field of the -U option.

This is useful for programming fuse bytes without having to create a single-byte file or enter terminal mode.

If the number specified begins with 0x, it is treated as a hex value. If the number otherwise begins with a leading zero (0) it is treated as octal. Otherwise, the value is treated as decimal.

a auto detect; valid for input only, and only if the input is not provided at stdin.
d decimal; this and the following formats are only valid on output.
They generate one line of output for the respective memory section,
forming a comma-separated list of the values. This can be particularly useful for subsequent processing, like for fuse bit settings.
h hexadecimal; each value will get the string 0x prepended.
o octal; each value will get a 0 prepended unless it is less than 8 in which case it gets no prefix.
b binary; each value will get the string 0b prepended.
The default is to use auto detection for input files, and raw binary format for output files.
Note that if filename contains a colon, the format field is no longer optional since the filename part following the colon would otherwise be misinterpreted as format.

As an abbreviation, the form -U filename is equivalent to specifying -U
flash:w:filename:a. This will only work if filename does not have a colon in it.

Last Edited: Mon. Aug 17, 2015 - 12:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The signature row is not normally writeable, but Atmel must have a way of doing so during manufacture.  Whatever it is, it is undocumented.

 

However, some enterprising freaks have made some progress in determining how to do so.  It would seem that the signature row is effectively an entire extra page of flash (size depends upon the flash page size for the device).  Below are some relevant threads:

https://www.avrfreaks.net/forum/undocumented-signature-row-contents

http://www.eevblog.com/forum/microcontrollers/bootloader-on-smd-atmega328p-au/msg268938/#msg268938

http://www.eevblog.com/forum/microcontrollers/how-bloody-hard-can-it-be-to-program-an-avr-chip/msg270545/#msg270545

https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=208216#208216

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Aug 20, 2015 - 03:20 AM