Close

OpenOCD config files for STM8L Low Density Devices

A project log for eForth for cheap STM8S gadgets

Turn cheap modules from AliExpress into interactive development kits!

ThomasThomas 09/25/2020 at 05:320 Comments

For RM0031 STM8L Low Density devices (e.g. STM8L051F3 or STM8L050J3) I'm using the following OpenOCD target configuration:

#config script for STM8L051

set FLASHEND 0x9FFF
set BLOCKSIZE 0x40
set EEPROMSTART 0x1000
set EEPROMEND 0x10ff

proc stm8_reset_rop {} {
   mwb 0x4800 0xaa
   mwb 0x4800 0xaa
   reset halt
}

source [find target/stm8l.cfg]

For STM8L101 family devices (i.e. STM8L101F3 or STM8L001J3) the following configuration works for me:

#config script for STM8L101

set FLASHEND 0x9FFF
set BLOCKSIZE 0x40

proc stm8_reset_rop {} {
   mwb 0x4800 0x00
   reset halt
}

source [find target/stm8l.cfg]

 I didn't bother about the EEPROM because for all practical purposes the memory blocks designated as "DATA EEPROM" behave like Flash ROM.

My OpenOCD version is "Open On-Chip Debugger 0.10.0+dev-01404-g3934483-dirty". Using OpenOCD I could reset chips such that they consequently worked with STM8FLASH.

Discussions