Download PM0054 - STMicroelectronics

Transcript
Contents
PM0054
Contents
1
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2
Related documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3
Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4
5
3.1
Low density STM8L101x microcontrollers . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2
Low density STM8L05x/15x microcontrollers . . . . . . . . . . . . . . . . . . . . . . . 9
3.3
Medium density STM8L05x/15x, STM8AL31xx/STM8AL3Lxx
microcontrollers 10
3.4
Medium+ density STM8L15x microcontrollers . . . . . . . . . . . . . . . . . . . . . 11
3.5
High density STM8L05x/15x/16x microcontrollers . . . . . . . . . . . . . . . . . . 12
Memory protection strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1
Readout protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2
Proprietary code area protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3
User boot code area protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4
Unwanted memory access protection . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Programming STM8 Flash microcontrollers . . . . . . . . . . . . . . . . . . . . . 17
5.1
Unlocking the memory access security system (MASS) . . . . . . . . . . . . . 17
5.2
Block programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.3
Word programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.4
Byte programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.5
Programming the option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.6
5.5.1
Summary of memory dedicated option bytes . . . . . . . . . . . . . . . . . . . . 21
5.5.2
How to program the option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Memory access versus programming method . . . . . . . . . . . . . . . . . . . . . 23
5.6.1
ICP methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.6.2
IAP method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6
Flash program memory & data EEPROM comparison . . . . . . . . . . . . 26
7
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2/28
Doc ID 15433 Rev 9