Skip to main content
Associate II
February 7, 2026
Solved

How to read UID in STM32L476

  • February 7, 2026
  • 3 replies
  • 208 views

Hi,

How to set UID using CubeMX and read in STM32L476 and use it for device commissioning process?

Best answer by MHoll.2

The UID is not handle by CubeMX, you have to access the 3 registers by yourself. Se Chapter 49.1 in the Reference Manual RM0351

3 replies

MHoll.2
Senior III
February 7, 2026
mangesh1Author
Associate II
February 7, 2026

Hi NHoLL.2,

I read that post but CubeMX options are not available in my STM32L476(Nucleo-L476R) series.

MHoll.2
MHoll.2Best answer
Senior III
February 7, 2026

The UID is not handle by CubeMX, you have to access the 3 registers by yourself. Se Chapter 49.1 in the Reference Manual RM0351

TDK
Super User
February 7, 2026

UID cannot be set. It can only be read. The STM32L476 does have a UID.

HAL_GetUIDw0/HAL_GetUIDw1/HAL_GetUIDw2 will read the three 32-bit parts of it.

"If you feel a post has answered your question, please click ""Accept as Solution""."