2023-03-13 09:16 AM
I am working with STM32L010C6T6 MCUs. I need a way to consistently and uniquely identify each MCU with as few bytes as possible. The 96 bits "Unique device ID" register seems ideal but what is the minimal number of bytes I need?
Are all 96 bits mandatory to fulfil my needs? At a first look, the answer seems to be no as 4 bytes seems to be enough but I am not sure.
In Reference Manual RM0451, section 25.2, page 730-731 the 96 bits "Unique device ID registers" are described as follows:
Here are my assumptions. We have 3 distinct fields:
Is the "Unique ID" field really unique? If yes, is it unique among all STM's MCU/MCPs, all STM32 MCUs, all STM32L0 Series, STM32L0x0 Value Line, …
Below is the full UID registers of two distinct STM32L010C6T6 I own.
Solved! Go to Solution.
2023-03-14 11:49 AM
In fact, the 96bit ID is unique and likewise a certain part of the ID always seems to be the same. However, the last statement refers only to the devices just considered. If you take STM32L010C6T6 from a different batch, the other IDs are guaranteed to differ. In the reference manual some parts of the Unique ID are mentioned, but you cannot draw any conclusions concerning the family or similar. If you want to use the Unique ID, you would actually have to use the full 96bit.
Since this does not seem to make sense in your case, you can use as an alternative e.g. an own Unique ID as suggested by Jan, whose width you define so large that in no case over the life cycle of the system the same number is used twice, e.g. with assumed 50k/a and 50 years life span 2.5Mio, i.e. approx. 22bit, incl. possibly check bits (simple sum or similar to IBAN) e.g. 24bit = 3 bytes.
Would that be a viable suggestion?
Regards
/Peter
2023-03-13 03:46 PM
Welcome, @Duverney Marc André, to the community!
Yes, the 96-bit Unique device ID, if present and mentioned in the reference manual, is unique across all STM32 ever produced by STMicroelectronics.
Important: of course, this only applies to originals from STMicroelectronics, because counterfeits have been found without this or with the same unique ID.
In your example, the IDs only differ in bit 80.
Does it answer your question?
Regards
/Peter
2023-03-14 05:34 AM
Hi @Peter BENSCH,
Thank you for answering me.
Unfortunately it doesn't answer the entirety of my question. I was already able to establish the uniqueness of the whole 96-bit field. Knowing it extend to all STM32 ever produced is useful to know.
In addition, I whish to know if I could use only a part of the 96 bits and what are the consequences of doing so, especially given the name of the last field (i.e. "Unique ID" @ page 731 of RM0451). I am aware that the name of the field (32-bit "Unique ID") is confusing with the name of the whole identifier (96-bit "Unique device ID").
My design is a low power device with radio communication running on battery. Sending all 12 bytes of the 96 bits identifier would represent near the half of my overall consumption.
Therefore, I would like to obtain a more details description of this identifier. The filed named "Unique ID" suggests a certain uniqueness but to what extent? If this is unique across the whole STM32L0 series, I am good to go with only 4 bytes.
Moreover, if the same field named "Unique ID" is not unique at all, the ASCII nature of the field named LOT_NUM, if in standard ASCII, implies that all MSB bit of each byte is always '0'. (which seems to be true on the two samples I showed in my first message). As there is 7 LOT_NUM byte, if there is at least one more bit whose state is always known, I could at least save one byte over my communication.
Thank you for reading me. Have a nice day.
2023-03-14 09:23 AM
> I wish to know if I could use only a part of the 96 bits
Not if you want the ID to be unique.
> and what are the consequences of doing so
Collisions, i.e. two devices may be undistinguishable.
Don't be focused on the naming of registers, it won't help. If you want true unique ID of any length other than 96 bits, you have to generate it yourself at production time, and program it together with the firmware.
JW
2023-03-14 11:49 AM
In fact, the 96bit ID is unique and likewise a certain part of the ID always seems to be the same. However, the last statement refers only to the devices just considered. If you take STM32L010C6T6 from a different batch, the other IDs are guaranteed to differ. In the reference manual some parts of the Unique ID are mentioned, but you cannot draw any conclusions concerning the family or similar. If you want to use the Unique ID, you would actually have to use the full 96bit.
Since this does not seem to make sense in your case, you can use as an alternative e.g. an own Unique ID as suggested by Jan, whose width you define so large that in no case over the life cycle of the system the same number is used twice, e.g. with assumed 50k/a and 50 years life span 2.5Mio, i.e. approx. 22bit, incl. possibly check bits (simple sum or similar to IBAN) e.g. 24bit = 3 bytes.
Would that be a viable suggestion?
Regards
/Peter
2023-03-16 04:23 AM
These are the answers I was afraid to read. I hoped there was a more detailed description/ruleset governing these UID fields to further adapt its use to specific applications.
However, I understand it is difficult to further constrain the UID construction, given that all future STM's productions have to comply with the uniqueness of the previous ones.
For now, we will stick to using the last four bytes of the 96-bit field and introduce a control in the production process to exclude duplicates. Depending on the rejection rate, a custom ID will be implemented.
Thank you for your time. Have a nice day.
Is there a way to flag this thread as resolved or something?
2023-03-16 04:50 AM
Yes, if the problem is solved, please mark this thread as answered by selecting Select as best, as also explained here. This will help other users find that answer faster.
Good luck!
/Peter