AnsweredAssumed Answered

Unique ID Returning Zeros

Question asked by bleakley.david on Sep 29, 2011
Latest reply on Nov 9, 2011 by bleakley.david
I am using ST Visual Develop

STM8S105xx Datasheet Page 57 details the 96-bit unique device identifier

My Device is STM8S105K6
I am using stm8s_flash.c to call the FLASH_ReadByte function as follows:

for (i=0; i<12; i++)
            u_id[i] = FLASH_ReadByte(0x48CD+i);

u_id is filled with zeros.
I looked in the memory view and this location also appears to be filled with zeros.

I can read other locations as expected.

The Flash Registers are:
                                                                                                                                                                                                                                                                                                                                       
           

[0x505a] FLASH_CR1             - Flash control register 1

           
           

0x00

           
           

[0x505b] FLASH_CR2             - Flash control register 2

           
           

0x00

           
[0x505c]             FLASH_NCR2 - Flash complementary control register 2Intrusive read
[0x505d] FLASH_FPR -             Flash protection register0x00
[0x505e] FLASH_NFPR             - Flash complementary protection register0xff
           

[0x505f] FLASH_IAPSR             - Flash in-application programming status register

           
Intrusive read
           
[0x5062] FLASH_PUKR             - Flash Program memory unprotection register0xae
           
[0x5064] FLASH_DUKR             - Data EEPROM unprotection register0x56
           
       

The option Bytes are

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
           

AFR1

           
           

Default

           
           

AFR2

           
           

Alternate Ative

           
           

AFR3

           
           

Default

           
           

AFR4

           
           

Default

           
           

AFR5

           
           

Default

           
           

AFR6

           
           

Default

           
           

AFR7

           
           

Default

           
           

CKAWUSEL

           
           

Low Speed Internal

           
           

EXTCLK

           
           

External             Oscillator

           
           

HSECNT0

           
           

0

           
           

HSECNT1

           
           

0

           
           

HSECNT2

           
           

0

           
           

HSECNT3

           
           

0

           
           

HSECNT4

           
           

0

           
           

HSECNT5

           
           

0

           
           

HSECNT6

           
           

0

           
           

HSECNT7

           
           

0

           
           

HSITRIM

           
           

3-bit trimming

           
           

IWDG HW

           
           

Software

           
 LSI_EN Disabled
           

PRSC

           
           

16MHz to 128kHz

           
           

ROP

           
           

Read-out             protection disabled

           
           

UBC

           
           

Write protection             disabled

           
           

WWDG_HALT

           
           

No Reset

           
           

WWDG_HW

           
           

Software

           
           

l2C

           
           

Frozen when             stopped

           
           

Timer1

           
           

Frozen when             stopped

           
           

Tìmer2

           
           

Frozen when             stopped

           
           

Tìmer3

           
           

Frozen when             stopped

           
           

Tìmer4

           
           

Frozen when             stopped

           

 

A combination of the following may be true:
       
  1. I have not set up something correctly.
  2.    
  3. I have managed to erase this location.
  4.    
  5. I have got a dodgy device.
Any Ideas?

Outcomes