2011-09-29 03:41 AM
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 2
Intrusive read
[0x505d] FLASH_FPR - Flash protection register
0x00
[0x505e] FLASH_NFPR - Flash complementary protection register
0xff
[0x505f] FLASH_IAPSR - Flash in-application programming status register
Intrusive read
[0x5062] FLASH_PUKR - Flash Program memory unprotection register
0xae
[0x5064] FLASH_DUKR - Data EEPROM unprotection register
0x56
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:2011-11-09 09:54 AM
I have received the following from ST:
The unique ID's are being programmed inside the STM8 products during their production only from second half of 2010. If you get samples with marking ending by for example MYS 11xx, those should be OK. 11 stands for the year, xx for the week.