cancel
Showing results for 
Search instead for 
Did you mean: 

Unique Id stm32H7

Osability
Associate II

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

11 REPLIES 11

@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)

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..