cancel
Showing results for 
Search instead for 
Did you mean: 

Read and use of 96 bit unique ID

oeliks
Senior

Using HAL. How to read unique ID and use it to identify specyfic chip?

Do simple:

​uint32_t HAL_GetREVID (void )

 uint32_t HAL_GetDEVID (void )

Do the job? Are they really unique, or can these values repeat in same chips?​

1 ACCEPTED SOLUTION

Accepted Solutions

No, those relate to the type/step of IC you have ie H743 Step V

The Unique is pulled as 3x 32-bit values from memory

#define UID_BASE       (0x1FFF7590UL)    /*!< Unique device ID register base address */

/**

 * @brief Get Word0 of the unique device identifier (UID based on 96 bits)

 * @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format

 */

__STATIC_INLINE uint32_t LL_GetUID_Word0(void)

{

 return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));

}

/**

 * @brief Get Word1 of the unique device identifier (UID based on 96 bits)

 * @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40])

 */

__STATIC_INLINE uint32_t LL_GetUID_Word1(void)

{

 return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));

}

/**

 * @brief Get Word2 of the unique device identifier (UID based on 96 bits)

 * @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24]

 */

__STATIC_INLINE uint32_t LL_GetUID_Word2(void)

{

 return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));

}

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

View solution in original post

1 REPLY 1

No, those relate to the type/step of IC you have ie H743 Step V

The Unique is pulled as 3x 32-bit values from memory

#define UID_BASE       (0x1FFF7590UL)    /*!< Unique device ID register base address */

/**

 * @brief Get Word0 of the unique device identifier (UID based on 96 bits)

 * @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format

 */

__STATIC_INLINE uint32_t LL_GetUID_Word0(void)

{

 return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));

}

/**

 * @brief Get Word1 of the unique device identifier (UID based on 96 bits)

 * @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40])

 */

__STATIC_INLINE uint32_t LL_GetUID_Word1(void)

{

 return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));

}

/**

 * @brief Get Word2 of the unique device identifier (UID based on 96 bits)

 * @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24]

 */

__STATIC_INLINE uint32_t LL_GetUID_Word2(void)

{

 return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));

}

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