Skip to content

Commit

Permalink
VScode debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 committed Jun 5, 2024
1 parent 7697d10 commit ffb299e
Show file tree
Hide file tree
Showing 7 changed files with 1,949 additions and 179 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-vscode.cpptools"
"ms-vscode.cpptools",
"cl.stm8-debug"
]
}
66 changes: 66 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// "preLaunchTask": "STM8 Flash", // TODO flash with OpenOCD
"name": "stm-gdb",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/bin/main.elf",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceRoot}/src/controller",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"linux": {
"miDebuggerPath": "stm8-gdb"
},
"windows": {
"miDebuggerPath": "stm8-gdb.exe" // either build from source or use the one downloaded by the stm8-debug extension (add to system PATH)
},
"setupCommands": [
{
"description": "connect to target",
"text": "-target-select extended-remote localhost:3333",
"ignoreFailures": true
},
{
"description": "set source file directory",
"text": "directory ${workspaceRoot}/src/controller"
}
],
"logging": {
"moduleLoad": true,
"trace": true,
"engineLogging": true,
"programOutput": true,
"exceptions": true
},
},

{ // launch OpenOCD task after flashing, but before debugging // TODO flash with OpenOCD
// "preLaunchTask": "STM8 Flash", // TODO flash with OpenOCD
"name": "stm8-debug extension", // it is Windows only
"type": "stm8-debug",
"request": "launch",
"serverType": "stm8-sdcc",
"executable": "${workspaceFolder}\\bin\\main.elf",
"cpu": "STM8S105S6",
"port": "3333",
"svdFile": ".vscode\\stm8s105s6.svd.json", // based on stm8s105k4 from the demo - some registers might not be accurate
"openOcdConfigs": [
"interface/stlink.cfg", //stm8-debug comes with sdcc 10.0
"target/stm8s105.cfg"
],
"customCommands": [
"cd ${workspaceFolder}\\src",
"set remotetimeout 2000",
"set debug remote 1"
]
}
]
}
Loading

0 comments on commit ffb299e

Please sign in to comment.