Skip to content

Commit

Permalink
Add Cortex-Debug config, improve cppdbg
Browse files Browse the repository at this point in the history
Co-authored-by: Jörg Ebeling <[email protected]>
  • Loading branch information
rovo89 and Apehaenger committed Jan 23, 2025
1 parent 9b73eb7 commit 5c31695
Show file tree
Hide file tree
Showing 4 changed files with 100,066 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
libasio-dev iproute2 \
python3 python3-venv python3-pip \
cmake make \
gdb-multiarch
gdb-multiarch && \
ln -s /usr/bin/nm /usr/bin/nm-multiarch && \
ln -s /usr/bin/objdump /usr/bin/objdump-multiarch

USER $USERNAME
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack"
"ms-vscode.cpptools-extension-pack",
"marus25.cortex-debug",
]
}
}
Expand Down
48 changes: 39 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
// For remote debugging, you need to prepare your CM4 host with a recent OpenOCD version.
// Simply follow steps 1 and 2 of this description:
// https://core.x-tech.online/docs/tutorials/flashing-stm32-from-cm4/
// Once done, start OpenOCD on your CM4 host via:
// openocd -f interface/xcore.cfg -f target/stm32h7x.cfg -c "bindto 0.0.0.0"
// Also make sure you have the Dev Mode enabled in the bootloader.
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug on STM32",
"name": "cppdbg (remote)",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "CMake: build",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/build/Debug/openmower.elf",
"program": "${command:cmake.launchTargetPath}",
"postRemoteConnectCommands": [
{"text": "load"},
{
"text": "-target-download",
}
],
"svdPath": "${workspaceFolder}/cfg/STM32H723.svd",
"linux": {
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb-multiarch",
"miDebuggerServerAddress": "${input:hostname}:3333"
"miDebuggerPath": "gdb-multiarch",
"miDebuggerServerAddress": "${input:target}:3333",
},
}
},
{
"name": "Cortex-Debug (remote)",
"type": "cortex-debug",
"cwd": "${workspaceFolder}",
"request": "launch",
"servertype": "external",
"gdbPath": "gdb-multiarch",
"gdbTarget": "${input:target}:3333",
"executable": "${command:cmake.launchTargetPath}",
"svdFile": "${workspaceFolder}/cfg/STM32H723.svd",
// Rebuild and flash on "Restart", but not on "Reset device".
"preLaunchTask": "CMake: build",
"preRestartCommands": [
"-target-download",
],
"preResetCommands": [],
"breakAfterReset": false,
// Uncomment to break in main before debugging
// "runToEntryPoint": "main",
},
],
"inputs": [
{
"id": "hostname",
"description": "Select OpenMower hostname",
"id": "target",
"description": "Select hostname where OpenOCD is running",
"type": "promptString",
}
]
],
}
Loading

0 comments on commit 5c31695

Please sign in to comment.