2018-02-01 02:12 AM
how to find MCU serial number/unique id for the MCU?
2018-02-01 02:37 AM
If you are using HAL:
uint32_t HAL_GetREVID (void )
uint32_t HAL_GetDEVID (void )2018-02-01 03:15 AM
alternatively, find where the uid is located and simply point a pointer to it.
for example,
#define U_ID ((const uint16_t *) 0x48CD) //U_ID95..0, referenced via U_ID[0], ..., U_ID[5]
#define U_ID0 U_ID[0] //X coordinate#define U_ID1 U_ID[1] //Y coordinate...
the starting address, 0x48CD here, can vary from chip family to chip family but the basic idea is the same.
2018-02-25 02:33 AM
Does the STM8 have a serial number or unique ID?
Golab.Bogdan
andhenry.****
might be thinking of STM2018-02-25 01:42 PM
I am sorry for misleading you. Frankly I do not know the STM8 family.
But I googled the st site () and found for an example MCU:
it seems that there should be 96 unique id embedded in the a device.
I used this particular query using google to narrow down search results only to the st site:
''site:st.com stm8 unique id''
2018-02-25 03:42 PM
I'm currently using the STM8L052R8 and that does not have a unique ID, as far as I can tell by reading the data sheets and reference manual (and I just read back the data from 0x48CD and it's just zeros). So I looks like some STM8 devices do have a Unique ID, while others don't (or its not documented). The OP does not mention which device or family they are using. They'll need to read the data sheets to check.
If they do have a device with a unique ID then method mentioned by
henry.****
would work, or could be adapted. To be unique all 12 bytes (96-bits) would be needed.