A STM8 Debugger for vscode. Use STLink to debug your STM8 program
Only for Windows platform
launch.json
, there are some examples: {
"version": "0.2.0",
"configurations": [
{
"type": "stm8-debug",
"request": "launch",
"name": "Launch Program",
"serverType": "st7",
"executable": ".\\out\\Debug\\stm8_demo.out",
"cpu": "STM8S003F3P"
}
]
}
Notice: make sure you can find your 'target' and 'interface' in OpenOcd config folder !, like: 'target/stm8s003.cfg'
{
"version": "0.2.0",
"configurations": [
{
"type": "stm8-debug",
"request": "launch",
"name": "Launch Program",
"serverType": "stm8-sdcc",
"executable": ".\\out\\Debug\\stm8_demo.elf",
"openOcdConfigs": [
"interface/stlink.cfg",
"target/stm8s003.cfg"
]
}
]
}
F5
to launch stm8 debuggerYou can browse cpu peripheral value by Peripheral View, like this:
Note: You need to create a new \
step 1. create a new <cpu_name>.svd.json
file, write peripheral descriptions.
step 2. set svdFile property in launch.json
There is a demo for stm8s003f3
cpu, file name: stm8s003f3.svd.json
[
{
"name": "GPIOA",
"baseAddress": "0x5000",
"registers": [
{
"name": "ODR",
"bytes": 1,
"fields": [
{
"name": "0",
"bitsOffset": 0,
"bitsWidth": 1
}
]
},
{
"name": "IDR",
"bytes": 1
},
{
"name": "DDR",
"bytes": 1
},
{
"name": "CR1",
"bytes": 1
},
{
"name": "CR2",
"bytes": 1
}
]
},
{
"name": "FLASH",
"baseAddress": "0x505A",
"registers": [
{
"name": "CR1",
"bytes": 1
},
{
"name": "CR2",
"bytes": 1
},
{
"name": "NCR2",
"bytes": 1
},
{
"name": "FPR",
"bytes": 1
},
{
"name": "NFPR",
"bytes": 1
},
{
"name": "IAPSR",
"bytes": 1
},
{
"name": "PUKR",
"baseAddress": "0x5062",
"bytes": 1
},
{
"name": "DUKR",
"baseAddress": "0x5064",
"bytes": 1
}
]
}
]