2024-08-29 07:04 PM - last edited on 2024-08-30 01:34 AM by Amel NASRI
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
Solved! Go to Solution.
2024-08-29 07:29 PM
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
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.
2024-08-29 07:29 PM
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
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.
2024-08-30 01:31 AM
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.
2024-09-11 10:50 PM
::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?