cancel
Showing results for 
Search instead for 
Did you mean: 

does stm32f0 have uniq identifire or something for finding it in RS485 network?

navid ansari
Associate III
Posted on July 11, 2017 at 08:10

hi

i have network of rs485 and i want uniq identifier on stm32f0 . does this mcu have something like this?

if not what u recommend?

#stm32f0 #unique-id #device-id
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on July 11, 2017 at 12:21

you need to read the reference manual for your chip. this will probably work.

    uint32_t word0 = *(uint32_t *)(UID_BASE);

    uint32_t word1 = *(uint32_t *)(UID_BASE + 0x04); // offsets as per reference manual

    uint32_t word2 = *(uint32_t *)(UID_BASE + 0x08);

View solution in original post

4 REPLIES 4
Tilen MAJERLE
ST Employee
Posted on July 11, 2017 at 10:24

Hi

ansari.navid

‌,

all STM32 devices have unique ID, of 96-bits. You may use this as your device address in the network. You just must take care that if you only take single byte (ex. MSB byte) for ID for address, you may have duplicate device addresses on network.

Posted on July 11, 2017 at 10:31

please tell me how to get or read this 

unique ID?

im using keil 

maybe just tell me which register from where 

Posted on July 11, 2017 at 11:57

i did it like this

navid0 = *((unsigned long *)0x1FFFF7F8);

navid1 = *((unsigned long *)0x1FFFF7FC);

navid2 = *((unsigned long *)0x1FFFF800);

but the addresses is not what is in forum . 

i dont know if this id is right or not cause i found the address

Posted on July 11, 2017 at 12:21

you need to read the reference manual for your chip. this will probably work.

    uint32_t word0 = *(uint32_t *)(UID_BASE);

    uint32_t word1 = *(uint32_t *)(UID_BASE + 0x04); // offsets as per reference manual

    uint32_t word2 = *(uint32_t *)(UID_BASE + 0x08);