cancel
Showing results for 
Search instead for 
Did you mean: 

Does STM32F429 nucleo 144 Serial number and Unique ID are same?

Sgowd.1
Associate II

I am using STM32F429 nucleo 144 board for security application. I Need to read a unique ID while doing this process i am getting ST-link SN number of the device. So is SN of the microcontoller is a unique number ? or is it common number for all STM devices?? or SN and unique ID are same or different??

5 REPLIES 5
KnarfB
Principal III

The ST-link SN number belongs to the debug probe and not to the MCU. The on-chip 96-bit unique device identifier (UID) is different and belongs to the MCU. It can be read by

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

I would use that e.g. as part of a personalization string for seeding a random number generator etc...

Thank you so much.

If possible can you please provide me the complete Code to read the unique ID of an MCU. I am new in this field so it could be helpfull if you could provide me with the complete code

KnarfB
Principal III

Generate a new project in STM32cubeIDE with all default settings and insert the above lines where you need it, e.g in main() USER CODE section 2

I created the new Project and inserted the above line and ran the Code. but still I didnot get the unique ID. I have attached the console Image what I got after executing the Code. Kindly check it and suggest me.

KnarfB
Principal III

You can execute your program step by step from the IDE and watch the variables.

Think you should start learning more about debugging and IO.

See for example the chapter on debugging/tracing here: https://gitlab.com/stm32mcu/wiki/-/wikis/home