2024-08-27 01:59 AM
Hello Everyone,
I am working on stm32h723zg, and I want to obtaind the serial of the micro controller for the unique id:
uint32_t unique_id[3];
void read_serial_number(void) {
// Unique ID registers
unique_id[0] = HAL_GetUIDw0(); // Unique ID Register 1
unique_id[1] = HAL_GetUIDw1(); // Unique ID Register 2
unique_id[2] = HAL_GetUIDw2();
}
How can I combine this id to obtain the proper serial number
2024-08-27 07:45 AM
@Tesla DeLorean wrote:all 96-bit factor in
Ah yes - I missed that DEVICE_ID2 (in deviceserial1) does get used:
if (deviceserial0 != 0)
{
IntToUnicode( deviceserial0, &USBD_StringSerial[ 2], 8);
IntToUnicode( deviceserial1, &USBD_StringSerial[18], 4); <<< here!
}
(but USBD_StringSerial is not set at all when deviceserial0 == 0)
2024-08-27 07:57 AM
I think that's only the case when the "ROM/OTP" is not programmed, basically System Flash, and most frequently encountered with ES/ENGINEERING SAMPLE parts.
Contractually, at least internally, I suspect that they won't be zero due to part, batch or wafer designations being used for the "unique" number space at ST