Every EFM32 device is assigned a 64-bit Unique ID, which is programmed into the Device information page of the flash during the production of the device.This 64-bit value is guaranteed to be unique for all past and future EFM32 device that are manufactured.
The 64-bit value can be read from the following addresses:
UNIQUE_0 is a 32-bit timestamp (Unix time) set during production
UNIQUE_1 is a 32-bit value that represents the facility ID where the part was produced.
As each facility does not produce more than one part per second (smallest resolution of the timestamp), the two values together constitute a 64-bit unique number when combined.
Note that Silicon Labs while reserves the right to change the structure of these values in the future, but the uniqueness will still be guaranteed.
Hashing the Unique ID to generate smaller ID values
While uniqueness is only guaranteed when using the full 64-bit value, smaller IDs can be generated by using a cryptographic hashing function to reduce the ID bit number while still maintaining a low probability that two or more IDs will be identical. A hash function has a diffusion property that every bit of its input affects on average half of the bits of the output. Hashing the ID and then discarding bits will result in a collision probability directly related to the effective reduction in bit count.
Given that we generate k hash values where each value is a non-negative integer less than N, the probability that at least two of them are equal can be shown to be approximately:
The approximation is valid only if k is a lot smaller than N.
If a 56 bit hash value is generated from the Unique ID, there would then be a k(k-1)/(2*2^56) probability that at least two values would collide. If we assume that we generate k=1e6 values, the probability of collision is 6.93e-6.
Many cryptographic hashing functions could be suitable for this application, but when using an EFM32 the on-chip AES accelerator provides a speed benefit over other pure SW solutions. The AES accelerator can be used by combining the 64-bit UNIQUE ID together with an arbitrarily chosen constant to be used as the 128-bit data input to the AES function. The 128-bit key could also be an arbitrarily chosen constant. n bits of the output of the AES encryption can then be chosen to represent a pseudo unique ID with the collision probabilities described above.