cancel
Showing results for 
Search instead for 
Did you mean: 

own unique ID

anhe-zhang
Associate

Hi,

I am using STM32G0B1 MCU for my project. Is it true each STM32 IC has its own unique ID. For STM32G4 product has the UID facility. Is it 96-bit ID for all the stm32 families or is it different.

Which manual has to be referred for this?
If yes can I use that for serial number for the product.
Which memory location is it stored?
Can read that from IC and send it through UART?

Can anyone suggest.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The unique ID register on the STM32G0B1 can be read starting from 0x1FFF7590, per the reference manual:

STM32G0x1 advanced Arm®-based 32-bit MCUs - Reference manual

TDK_0-1724984733751.png

 

With HAL, you can read it using the following functions:

uint32_t w0 = HAL_GetUIDw0();
uint32_t w1 = HAL_GetUIDw1();
uint32_t w2 = HAL_GetUIDw2();

 

Most STM32 chips have a 96 bit unique ID like this. Although it varies.

 

Yes, you can use this as a serial number. It is unique for each chip.

Yes, you can read this and send it through UART.

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

View solution in original post

3 REPLIES 3
TDK
Guru

The unique ID register on the STM32G0B1 can be read starting from 0x1FFF7590, per the reference manual:

STM32G0x1 advanced Arm®-based 32-bit MCUs - Reference manual

TDK_0-1724984733751.png

 

With HAL, you can read it using the following functions:

uint32_t w0 = HAL_GetUIDw0();
uint32_t w1 = HAL_GetUIDw1();
uint32_t w2 = HAL_GetUIDw2();

 

Most STM32 chips have a 96 bit unique ID like this. Although it varies.

 

Yes, you can use this as a serial number. It is unique for each chip.

Yes, you can read this and send it through UART.

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

Hi @anhe-zhang ,

More details about Unique ID of STM32 products can be found in the article How to obtain and use the STM32 96-bit UID and the associated discussion.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

::Connection command STM32_Programmer_CLI.exe -c port=SWD freq=4000 pause When I connect to a device, I cannot connect unless the device is turned on. Are there other commands that can force the device to wake up?