Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 9 months ago.
Can somebody confirm that the 96bits unique ID is avaiblabe from mbed please ?
hi, I bought a Nucleo STM32L152RET6 64pins Nucleo board and I've seen that the UID seems to be located at 0x1FF800D0 for STM32L15xxE (Cat.5) chips (page 880 of STM32L1xxx (RM0038) UserManual.
when I use this portion of code,
unique ID test : unsigned long *uid = (unsigned long *)0x1FF800D0; pc.printf("\r\nUnique ID: %08X %08X %08X \r\n", uid[0], uid[1], uid[2]);
the returned UID is displayed as : 0B473333 36363238 5C595900
please, can one confirm this is the correct location and that this UID is really unique to each chip (and is not a series or product type number) ? thank you for your support Rico
Question relating to:
1 Answer
9 years, 9 months ago.
Hello,
Yes I confirm that the UID is located at address 0x1FF800D0 for this device and is really unique for each device.
Regards.
Thanks for the post it help me. I did a little research and see that all the bytes are not contiguous and the ordering of them to make the 96 bit number is also off. Here I am loading a char array with the hex representation
sprintf(deviceId,"%08x%08x%08x", uid[5], uid[1], uid[0]);
Not sure if this is how it is on all stm chips or just the stm32l152
posted by David Gagnon 25 Sep 2015I posted a sample that think pulls this for a freescale chip. There is a single define that should make it work for the STM chips. https://developer.mbed.org/users/joeata2wh/code/frdm_print_unique_serial_number/
posted by Joseph Ellsworth 08 Mar 2016