Skip to main content
TMA1of3
Associate III
March 1, 2023
Solved

STM32H743 – Unique device ID register

  • March 1, 2023
  • 2 replies
  • 5705 views

dear ST / reader,

our application uses the STM32H743. We need a unique serial number to be stored in this micro, in non-volatile memory, to uniquely identify each board. There’s no on-board EEPROM, so we were wondering if this device includes any internal unique number of its own that can be accessed and which could then be used for this purpose when we found the following …

The “Unique device ID register (96 bits)�? which is “unique for any device and in any context�?. Does this mean the value will be different in each and every STM32H743, or all STM32H743s have the same number ?

What is the procedure to read this value, please ?

Best answer by Tesla DeLorean

Each IC has a different number, composed of lot, wafer, die, etc

It's a constant in addressable memory, you can read it like any other memory, you can use a pointer, or library abstractions.

/**
 * @brief Return the first word of the unique device identifier (UID based on 96 bits)
 * @retval Device identifier
 */
uint32_t HAL_GetUIDw0(void)
{
 return(READ_REG(*((uint32_t *)UID_BASE)));
}
 
/**
 * @brief Return the second word of the unique device identifier (UID based on 96 bits)
 * @retval Device identifier
 */
uint32_t HAL_GetUIDw1(void)
{
 return(READ_REG(*((uint32_t *)(UID_BASE + 4U))));
}
 
/**
 * @brief Return the third word of the unique device identifier (UID based on 96 bits)
 * @retval Device identifier
 */
uint32_t HAL_GetUIDw2(void)
{
 return(READ_REG(*((uint32_t *)(UID_BASE + 8U))));
}

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
March 1, 2023

Each IC has a different number, composed of lot, wafer, die, etc

It's a constant in addressable memory, you can read it like any other memory, you can use a pointer, or library abstractions.

/**
 * @brief Return the first word of the unique device identifier (UID based on 96 bits)
 * @retval Device identifier
 */
uint32_t HAL_GetUIDw0(void)
{
 return(READ_REG(*((uint32_t *)UID_BASE)));
}
 
/**
 * @brief Return the second word of the unique device identifier (UID based on 96 bits)
 * @retval Device identifier
 */
uint32_t HAL_GetUIDw1(void)
{
 return(READ_REG(*((uint32_t *)(UID_BASE + 4U))));
}
 
/**
 * @brief Return the third word of the unique device identifier (UID based on 96 bits)
 * @retval Device identifier
 */
uint32_t HAL_GetUIDw2(void)
{
 return(READ_REG(*((uint32_t *)(UID_BASE + 8U))));
}

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
RCooke88
Associate III
March 8, 2024

Is there a scheme for the UI number? I understand that there are three 32 bit values that make up the ID number but is there somewhere that explains what bits equal what?

You mention that the number includes values for " lot, wafer, die, etc.". Is there a description somewhere?

We're using the STM32H7A3RIT6 chip.We'd like to use the UI number for the product's serial number but we can't use 96 bits since it will be displayed on the screen and probably printed on the back label.

Thanks,

Richard

Tesla DeLorean
Guru
March 8, 2024

Check if there is sufficient OTP to implement your own

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
raptorhal2
Lead
March 8, 2024

See Section 61.1 in the reference manual

RCooke88
Associate III
March 8, 2024

I did look at that section in the manual but it doesn't tell me which byte equals what type. For example which number is the lot, wafer, or die number?

We can't use the entire 96bit value. I'm asking if the first 32bits might be more variable than the 3rd 32bits. Or is the 3rd number better than the second?

Tesla DeLorean
Guru
March 8, 2024

Seem to recall an App Note, or Knowledge Base on the forum

@STOne-32 @STTwo-32 any H7 materials?

https://www.st.com/resource/en/product_training/STM32L4_System_eSign.pdf

UID[31:0]: X and Y coordinates on the wafer

UID[63:40]: LOT_NUM[23:0] Lot number (ASCII encoded)

UID[39:32]: WAF_NUM[7:0] Wafer number (8-bit unsigned number)

UID[95:64]: LOT_NUM[55:24] Lot number (ASCII encoded)

https://www.st.com/resource/en/reference_manual/rm0351-stm32l47xxx-stm32l48xxx-stm32l49xxx-and-stm32l4axxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

 

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