Understanding Signature and Serial Number (Arduino Leonardo, ATmega32U4)

I am currently working on implementing a device unique ID so I am able to identify my Arduino Leonardo chips from the embedded source code.

There are numerous resources in the internet with many different aproaches for getting a unique number.

Most of the time the command/makro
is mentioned but I am still confused what this function does and what exactly is read out.

First I was thinking that reading just the first 16 bytes (byte 0 - 15) is the way to go:

0x1E639561 8761FFFF 00FFFFF7 FFFF5830
0x1E779573 8775FFFF 00FFFFF7 FFFF5739

However the numbers seem to be kind of systematic, especially the 0xFF bytes. So it seems to be no adequate data for identification and I have to be totally sure that the data is not changing!

Then I found out (from an other example from the internet) that reading byte 14 to 23 (10 bytes) seems to be more random, which is good.

0x57393131 3037150C 1011
0x58303230 39381507 0319
0x59373932 30311510 081A
0x58303231 3136150B 1807

But still, I don't know what I am reading.
I think it is data that is saved on the flash memory. This brings me to the question if this number may be overwritten when I reprogram the bootloader or directly flash the HW over avrdude?

And I am really curious what I am reading.
Maybe there is a better solution for reading an unique id?
If possible I don't want to define an ID myself since the production procedur would be much more complicated.

Hope one of the experts can help.

Thank you.

Some of the newer AVR chips (ie xMega, ATmega4809) are documented as having a unique identifying information in their "signature row" of memory.
For xMega, this is stuff like "lot number" and "wafer coordinates", so by the time you merge everything together its likely that a set of chips would have 'similar" values, while still being unique if you include all of the bytes. An Atmega4809 has a simpler 10byte "serial number"

Alas, the Atmega32u4 is NOT one of the chips documented as having such info. There has been speculation that some of the undocumented bytes might have unique info similar to the xMega, but - if it's not documented, you can't count on it.

The signature row is documented as being read-only, and is NOT erased by normal programming procedures. There is more speculation that some of the HVPP commands might be able to overwrite the data, but AFAIK, not one has come up with exact procedures.

1 Like

Thank you for your answer.

And do you know how long this signature row is for the ATmega32U4?


Nope. :frowning:
There has been some theorizing that it's the same length as a "flash page" (256 bytes on a 32u4) https://www.avrfreaks.net/forum/undocumented-signature-row-contents

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.