Skip to main content
Explorer
June 12, 2025
Solved

STM32L031 UID

  • June 12, 2025
  • 2 replies
  • 336 views

Hello,
I read the UID from STM32L031K6P6 and each device returns the same result: 0x14473332, 0x38363437, 0x0.
I read the value from the address given in RM0377 (0x1FF8 0050).
Is the address given in RM0377 correct?


I am attaching screen shots from CubeProgrammer.

    This topic has been closed for replies.
    Best answer by STOne-32

    Dear @NextUser ,

    The address given in RM0377 for the UID of STM32L0 devices (0x1FF80050) is correct.

    However, See : UID[95:64]) it is at 0x14 offset and not at 0x8

    Ensure that the offset for the third word is set to 0x14 when reading the UID, in your device 1 

    Highlighted   in green below :

    L0_UID_D1.png

    Hope it helps you.

    STOne-32

    2 replies

    Graduate II
    June 12, 2025

    Checking the RM0367 page 970.

    it is indeed 0x1FF8 0050.

    have you tried HAL:

    uint32_t uid[3];
    uid[0] = HAL_GetUIDw0();
    uid[1] = HAL_GetUIDw1();
    uid[2] = HAL_GetUIDw2();

    maybe the issue is in the way you handle pointers in your code

    I just saw your attached images (cubeProgrammer), what if your issue is something as basic as connecting two times the same board, or getting confused with USB cables

    this is what happens if i read the uid of two different stm32g474 i have in my table right now

    Javier1_0-1749730564010.png

    Javier1_1-1749730572160.png

    source RM0440

    Javier1_2-1749730617084.png

     

     

     

    STOne-32Answer
    Technical Moderator
    June 12, 2025

    Dear @NextUser ,

    The address given in RM0377 for the UID of STM32L0 devices (0x1FF80050) is correct.

    However, See : UID[95:64]) it is at 0x14 offset and not at 0x8

    Ensure that the offset for the third word is set to 0x14 when reading the UID, in your device 1 

    Highlighted   in green below :

    L0_UID_D1.png

    Hope it helps you.

    STOne-32