Skip to main content
oeliks
Associate III
December 23, 2019
Solved

Read and use of 96 bit unique ID

  • December 23, 2019
  • 1 reply
  • 5052 views

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?​

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

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

    }

    1 reply

    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    December 23, 2019

    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 VenmoUp vote any posts that you find helpful, it shows what's working..