2025-10-07 4:43 PM - edited 2025-10-07 4:46 PM
I have a NUCLEO-C071RB with an STM32C071RB. In section 31.1 of RM0490 Rev 5, it describes the first 32 bits of the unique ID like this:
Bits 31:0 UID[31:0]: X and Y coordinates on the wafer expressed in BCD format
BCD should mean binary-coded decimal, which means each 4-bit nibble is between 0 and 9, but if I run "STM32_Programmer_CLI --connect port=swd -r8 0x1FFF7550 12", I get:
0x1FFF7550 : AF 00 40 00 14 50 36 42 48 37 30 20
The first byte, 0xAF, is not BCD.
In my experience working with these chips, it looks like bytes 0 and 2 are just arbitrary binary bytes which tend to be less than 0x80 but not always. And bytes 1 and 3 are always 0.
So what do those first four bytes really represent? And is the documentation for the other 8 bytes in RM0490 accurate? It says there is a 1-byte wafer number, followed by 7 bytes of ASCII for the lot number.
(Part of the reason I'd like to know this is so I can make a good scheme for losslessly compressing the unique ID into something smaller than two hex characters per byte, taking advantage of the parts that tend to be ASCII or zero.)