ST STM8

From SEGGER Knowledge Base
Jump to navigation Jump to search

The STM8 family from STMicroelectronics is designed for cost-sensitive embedded applications, offering a good balance of performance, low power consumption, and integrated peripherals. It features a robust Harvard architecture, flash memory, multiple communication interfaces (such as UART, SPI, and I²C), and is widely used in industrial, automotive, and consumer electronics systems.

Supported devices

Refer to the STM8AS device list and the STM8L device list for a full list of all supported STM8 family devices, their corresponding names and connection diagrams.

Target interfaces

This device supports only 'Single Wire Interface Module' (SWIM).


STM8_SWIM.svg?.png
Interface J-Link support Flasher support
SWIM NO.png YES.png

Memory blocks

Flash bank Base address J-Link support Flasher support Loader
Name Bank size
Data EEPROM 0x4000 NO.png YES.png Default up to 2kB
Option bytes 0x4800 NO.png YES.png Default 128 Bytes
Program memory 0x8000 NO.png YES.png Default up to 128kB


Limitations

Depending on the used tool chain, the Option bytes area may not be fully populated.

This can be fixed using a small Python script: from intelhex import IntelHex

ih = IntelHex()
ih.loadhex('infile.hex')
ih[0x4802] = ih[0x4801] ^ 0xFF # NOPT1
ih[0x4804] = ih[0x4803] ^ 0xFF # NOPT2
ih[0x4806] = ih[0x4805] ^ 0xFF # NOPT3
ih[0x4808] = ih[0x4807] ^ 0xFF # NOPT4
ih[0x480A] = ih[0x4809] ^ 0xFF # NOPT5
ih[0x480C] = ih[0x480B] ^ 0xFF # NOPT6
ih[0x480E] = ih[0x480D] ^ 0xFF # NOPT7
ih.tofile('outfile.hex', format='hex')

STM8 Adapter

SEGGER offers an adapter with standard connectors for STM8 evaluation boards.

STM8-Adapter.png STM8-Adapter-Schematic.jpg

Please note that without the STM8 adapter you have to connect the SWIM line to TCK and via a 1k resistor to PIN17.