Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
Add Flash and Build tasks for VS Code
Browse files Browse the repository at this point in the history
  • Loading branch information
ndabas committed Feb 13, 2023
1 parent a442222 commit 36393f3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
27 changes: 24 additions & 3 deletions packages/pico-examples/ide/vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"configurations": [
{
"name": "Pico Debug (Cortex-Debug)",
"cwd": "${workspaceRoot}",
"cwd": "${workspaceFolder}",
"executable": "${command:cmake.launchTargetPath}",
"request": "launch",
"type": "cortex-debug",
Expand All @@ -22,16 +22,37 @@
},
{
"name": "Pico Debug (Cortex-Debug with external OpenOCD)",
"cwd": "${workspaceRoot}",
"cwd": "${workspaceFolder}",
"executable": "${command:cmake.launchTargetPath}",
"request": "launch",
"type": "cortex-debug",
"servertype" : "external",
"servertype": "external",
"gdbTarget": "localhost:3333",
"gdbPath": "arm-none-eabi-gdb",
"device": "RP2040",
"svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
"runToEntryPoint": "main"
},
{
"name": "Pico Debug (C++ Debugger)",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${command:cmake.launchTargetPath}",
"MIMode": "gdb",
"miDebuggerPath": "arm-none-eabi-gdb",
"miDebuggerServerAddress": "localhost:3333",
"debugServerPath": "openocd",
"debugServerArgs": "-f interface/cmsis-dap.cfg -f target/rp2040.cfg -c \"adapter speed 1000\"",
"serverStarted": "Listening on port .* for gdb connections",
"filterStderr": true,
"stopAtEntry": true,
"hardwareBreakpoints": {
"require": true,
"limit": 4
},
"preLaunchTask": "Flash",
"svdPath": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd"
}
]
}
3 changes: 2 additions & 1 deletion packages/pico-examples/ide/vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
}
},
"cmake.buildBeforeRun": true,
"cmake.generator": "Ninja",
"cmake.configureOnOpen": true,
"cmake.configureSettings": {
"CMAKE_MODULE_PATH": "${env:PICO_INSTALL_PATH}/pico-sdk-tools"
},
"cmake.generator": "Ninja",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}
29 changes: 29 additions & 0 deletions packages/pico-examples/ide/vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Flash",
"type": "shell",
"command": "openocd",
"args": [
"-f",
"interface/cmsis-dap.cfg",
"-f",
"target/rp2040.cfg",
"-c",
"adapter speed 1000; program {${command:cmake.launchTargetPath}} verify reset exit"
],
"problemMatcher": []
},
{
"label": "Build",
"type": "cmake",
"command": "build",
"problemMatcher": "$gcc",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

0 comments on commit 36393f3

Please sign in to comment.