cancel
Showing results for 
Search instead for 
Did you mean: 

[HELP] The diffrence of Option Bytes between IAR and STVP

croket_2512
Associate II
Posted on November 08, 2014 at 09:50

I have just began with STM8 and I use IAR. I'm in trouble with Option Bytes with both of IAR and STVP. They have some differences between them. I use STM8S105C6T6 chip. I also searched in datasheet, user manual, reference manual from ST but I didn't find the answer yet. Maybe, I missed something. Hope people help me!

With Option Bytes of IAR:

_ UBC: has 2 options: Write protection disabled and Write protected

_ I2C: has 2 options: Frozen when stopped and Running.

_ Timer1: has 2 options: Frozen when stopped and Running.

_ Timer2: has 2 options: Frozen when stopped and Running.

_ Timer3: has 2 options: Frozen when stopped and Running.

_ Timer4: has 2 options: Frozen when stopped and Running.

With Option Bytes of STVP:

_ UBC[7..0]: 8 bit, choose between 0 and 1 for each bit.

_ BOOTLOADER ENABLE: Bootloader Disabled and Bootloader enabled.

My questions are:

1. There isn't BOOTLOADER ENABLE in IAR, so where is it???

2. I don't understand the options Frozen when stopped và Running of I2C, Timer[1..4]. What does they mean? Why doesn't STVP have? What are their uses? And there isn't the line ''Frozen when stopped'' in all documents of ST!!!

3. I know UBC stands for User boot code area. Is that the memory program area which we write the code of bootloader? With STVP we have 8 bits for UBC and we choose the suitable bits from page 0 to page 63 memory program. But with IAR, there are only two options Write protection disabled and Write protected ; it means we have only two options: one for no UBC, no write protection and one for pages 0 to 63 defined as UBC, memory write-protected, doesn't it?

Thank you! Hope people helping me!
1 REPLY 1
zzdz2
Associate II
Posted on November 08, 2014 at 14:54

I don't know about these specific compilers/tools but the meaning of option bytes is described in the ''Option bytes'' section in the datasheet.

OPT2 is used to remap pins (timers and others) so it's probably somehow related to those weird ''frozen'' options but I have no idea how.

Quote:

UBC[7:0] User boot code area

            0x00: no UBC, no write-protection

 0x01: Page 0 to 1 defined as UBC, memory write-protected

 0x02: Page 0 to 3 defined as UBC, memory write-protected

 0x03: Page 0 to 4 defined as UBC, memory write-protected

                             ...

0x3E: Pages 0 to 63 defined as UBC, memory write-protected

                  Other values: Reserved

BL[7:0] Bootloader option byte

    For STM8S products, this option is checked by the boot ROM code after reset.

Depending on the content of addresses 0x487E, 0x487F, and 0x8000 (reset vector), the

  CPU jumps to the bootloader or to the reset vector. Refer to the UM0560 (STM8L/S

                        bootloader manual) for more details.