Stm32 UniqueID is 96 bits, but I see that you define it as 16 bytes.
Perhaps st does not follow a standard?
there are uuid generators online.
If you assume STM32 unique IDs have enough entropy, 96 bits will be more than enough to ensure a very low probability of collision between devices (ethernet had no problems with just 48 bits).
There is no requirement that unique IDs are random. If you can assure they are different they can be just a simple counter incremented per device.
Random numbers are used to make it unnecessary to have that synchronisation element. You depend on statistic properties of big enough random numbers to avoid collisions, instead of a global serial ID.
A simple solution for the hobbyist is to use a build timestamp in your firmware. By rebuilding your firmware you ensure another unique id.
1 Like