2025-06-12 4:38 AM
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.
Solved! Go to Solution.
2025-06-12 5:16 AM - edited 2025-06-12 5:17 AM
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 :
Hope it helps you.
STOne-32
2025-06-12 5:10 AM - edited 2025-06-12 5:19 AM
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
source RM0440
2025-06-12 5:16 AM - edited 2025-06-12 5:17 AM
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 :
Hope it helps you.
STOne-32