Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
84
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

Flash program memory and data EEPROM

RM0016

 

 

Figure 8. Flash memory and data EEPROM organization high density STM8S and STM8AF

1 page = 512 bytes

1 block = 128 bytes

0x00 4000

DATA EEPROM

0x00 47FF

0x00 487F

0x00 8000

Programmable size from 2 pages (1 Kbytes) up to 64 or 128 Kbytes (1 page steps)

0x02 7FFF

DATA MEMORY (up to 2 Kbytes)

OPTION BYTES (1 block)

Interrupt vectors (128 bytes)

USER BOOT CODE (UBC) (permanently write protected)

Flash program memory

MAIN PROGRAM (write access possible for IAP and using MASS mechanism)

32 to 128 Kbytes of Flash Program Memory

ai15501b

4.4.2Memory access/ wait state configuration

The Flash/ data EEPROM access time allows the device to run at up to 16 MHz without wait states.

When using the high-speed external clock (HSE) at higher frequencies up to 24 MHz, one wait state is necessary. In this case the device option byte should be programmed to insert this wait state. Refer to the datasheet option byte section.

4.4.3User boot area (UBC)

The user boot area (UBC) contains the reset and the interrupt vectors. It can be used to store the IAP and communication routines. The UBC area has a second level of protection to prevent unintentional erasing or modification during IAP programming. This means that it is always write protected and the write protection cannot be unlocked using the MASS keys.

The size of the UBC area can be obtained by reading the UBC option byte.

40/454

Doc ID 14587 Rev 9

RM0016

Flash program memory and data EEPROM

 

 

The size of the UBC area can be configured in ICP mode (using the SWIM interface) through the UBC option byte. The UBC option byte specifies the number of pages allocated for the UBC area starting from address 0x00 8000.

Refer to Figure 9, Figure 10, and Figure 11 for a description of the UBC area memory mapping and to the option byte section in the datasheets for more details on the UBC option byte.

Figure 9. UBC area size definition on low density STM8S devices

0x00 8000

64 bytes

Interrupt vectors

0x00 8040

64 bytes

0x00 8080

64 bytes

0x00 80C0

64 bytes

0x00 8100

0x00 9F00

64 bytes

0x00 9F40

64 bytes

0x00 9F80

64 bytes

0x00 9FC0

64 bytes

0x00 9FFF

Page 0

Page 1

Page 2

Page 3

Page 124

Page 125

Page 126

Page 127

=0x01 UBC[7:0] =0x02 64 bytes 128 bytes

UBC[7:0] =0x7F 8 Kbytes

64 bytes to 8 Kbytes user boot code area

1.N (number of protected pages) = UBC[7:0].

2.UBC[7:0] = 0x00 means no user boot code area is defined. Refer to the datasheets for the description of the UBC option byte.

3.The first 2 pages (128 bytes) contain the interrupt vectors.

Doc ID 14587 Rev 9

41/454

Flash program memory and data EEPROM

RM0016

 

 

Figure 10. UBC area size definition on medium density STM8S

and STM8AF with up to 32 Kbytes of Flash program memory

0x00 8000

Interrupt vector table

0x00 807F

0x00 8200

512 bytes

0x00 8400

512 bytes

0x00 8600

512 bytes

0x00 8800

0x00 F800

512 bytes

0x00 FA00

512 bytes

0x00 FC00

512 bytes

0x00 FE00

512 bytes

0x00 FFFF

Page 0

Page 1

Page 2

Page 3

Page 60

Page 61

Page 62

Page 63

 

 

UBC[7:0] =0x01

1 Kbytes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UBC[7:0] =0x02

2 Kbytes

UBC[7:0] =0x3E

32 Kbytes

 

 

1K to 32 Kbytes User boot code area

1.N (number of protected pages) = UBC[7:0] + 2 for UBC[7:0] > 1.

2.UBC[7:0] =0x00 means no user boot code area is defined. Refer to the datasheets for the description of the UBC option byte.

3.The first 2 pages (1 Kbytes) contain the 128 bytes of interrupt vectors (32 IT vectors).

42/454

Doc ID 14587 Rev 9

Соседние файлы в папке Минимум документации STM8