cancel
Showing results for 
Search instead for 
Did you mean: 

Reading different CPUID when ever STM32F107 is power cycled.

Skira.17
Associate II

Hi ST community,

I am trying to read the CPUID of STM32F107 using the following code snippet. But the problem is each time I power cycle it, I am reading a different CPUID. 

I am reading CPUID from address location UID_BASE_ADDRESS(0x1FFFF7E8) for STM32F107. 

I am also using same code snippet for STM32F407, and reading CPUID from the address location UID_BASE_ADDRESS(0x1FFF7A10), in this case I am able to read the same

CPUID across power cycles. What might be the problem in case of STM32F107?

#define   INDEX_ZERO          ((uint8_t) 0)

#define INDEX_ONE          ((uint8_t) 1)

#define INDEX_TWO          ((uint8_t) 2)

void Get_CPU_UID ( unsigned int * uid_in_buff )

{

unsigned int * UID_ptr = (unsigned int *) UID_BASE_ADDRESS;

if(uid_in_buff != (unsigned int *)RESET)

{

uid_in_buff[INDEX_ZERO] = UID_ptr[INDEX_ZERO];

uid_in_buff[INDEX_ONE] = UID_ptr[INDEX_ONE];

uid_in_buff[INDEX_TWO] = UID_ptr[INDEX_TWO];

}

}

Thank you,

Regards,

Sai

1 REPLY 1
TDK
Guru

Check that your clock settings and flash wait states are valid.

If you feel a post has answered your question, please click "Accept as Solution".