2
0
mirror of git://git.code.sf.net/p/openocd/code synced 2025-07-19 23:36:13 +10:00
openocd/tcl/target/stm8s.cfg
Antonio Borneo ffe6bc8220 swim: add new transport
Add SWIM and STM8 to documentation and update TODO file.
Introduce transport "swim" and command "swim newtap".
Switch in swim.c from HLA API to the new SWIM API.
Implement in stlink driver the SWIM APIs as wrappers of existing
HLA functions.
Remove any SWIM related reference from HLA files.
Update stm8 config files and stlink-dap interface config file.

Change-Id: I2bb9f58d52900f6eb4df05f979f7ef11fd439c24
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5530
Tested-by: jenkins
2020-05-24 21:32:05 +01:00

85 lines
1.8 KiB
INI

# script for stm8s family
#
# stm8 devices support SWIM transports only.
#
transport select swim
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME stm8s
}
# Work-area is a space in RAM used for flash programming
# By default use 1kB
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x400
}
if { [info exists FLASHSTART] } {
set _FLASHSTART $FLASHSTART
} else {
set _FLASHSTART 0x8000
}
if { [info exists FLASHEND] } {
set _FLASHEND $FLASHEND
} else {
set _FLASHEND 0xffff
}
if { [info exists EEPROMSTART] } {
set _EEPROMSTART $EEPROMSTART
} else {
set _EEPROMSTART 0x4000
}
if { [info exists EEPROMEND] } {
set _EEPROMEND $EEPROMEND
} else {
set _EEPROMEND 0x43ff
}
if { [info exists OPTIONSTART] } {
set _OPTIONSTART $OPTIONSTART
} else {
set _OPTIONSTART 0x4800
}
if { [info exists OPTIONEND] } {
set _OPTIONEND $OPTIONEND
} else {
set _OPTIONEND 0x487f
}
if { [info exists BLOCKSIZE] } {
set _BLOCKSIZE $BLOCKSIZE
} else {
set _BLOCKSIZE 0x80
}
swim newtap $_CHIPNAME cpu
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME stm8 -chain-position $_CHIPNAME.cpu
$_TARGETNAME configure -work-area-phys 0x0 -work-area-size $_WORKAREASIZE -work-area-backup 1
$_TARGETNAME configure -flashstart $_FLASHSTART -flashend $_FLASHEND -eepromstart $_EEPROMSTART -eepromend $_EEPROMEND
$_TARGETNAME configure -optionstart $_OPTIONSTART -optionend $_OPTIONEND -blocksize $_BLOCKSIZE
# Uncomment this line to enable interrupts while instruction step
#$_TARGETNAME configure -enable_step_irq
# Set low speed at debug entry
adapter speed 363
reset_config srst_only
# uncomment this line to connect under reset
#reset_config srst_nogate connect_assert_srst