cancel
Showing results for 
Search instead for 
Did you mean: 

Unique ID problem

VCapu
Associate III
 
4 REPLIES 4
VCapu
Associate III

Hello. I am using the micro STM32F415ZGT. I have a problem when I use the functions HAL_GetUIDw0, HAL_GetUIDw1 and HAL_GetUIDw2: I get the same value on different boards with the same model of micro. And also, if I make a modification in my project, the value that I get changes. UID_BASE address is 0x1FFF7A10UL, the offsets are 0x00, 0x04 and 0x08, as it is written on the reference manual. Thank you  

VCapu
Associate III

Ok, probably I solved. From what I see, only the word 0 changes from a chip to another of the same model. Is it right?

this is what i have working right now.

and i never had an issue with it, never found two mcus with the same uuid in a production line of thousands.

(i needded the 96bit shrinked down to 8 bytes to fit in a canbus frame)

void readThisDeviceUUID(){
	uint32_t ID_1_3_val= HAL_GetUIDw0() +HAL_GetUIDw2();
	uint32_t ID_2_val= HAL_GetUIDw1();
	memcpy(&uuid[0],&ID_2_val,4);
	memcpy(&uuid[4],&ID_1_3_val,4);
	sprintf((char *)uuidString,
			"%x %x %x %x %x %x %x %x ",
			uuid[0],uuid[1],uuid[2],uuid[3],uuid[4],uuid[5],uuid[6],uuid[7]
	);
}

we dont need to firmware by ourselves, lets talk

The impression that only DWORD 0 changes is only true in your specific case. The UID is actually always structured identically and is explained in some training documents, e.g. the one describing the Device Electronic Signature of the STM32L4 family, which can be consulted on this point:

Unique device identifier is a 96 bit register created from

  • coordinates of the die on the wafer,
  • lot number and
  • wafer number, with certain number of bits reserved for each of those records.

So there is a good chance that your Wafer No and Lot No happen to be identical. However, if you need a clear distinction for a large number of systems produced, you must use the entire 96 bits.

Regards

/Peter

In order 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.