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

Commit 36393f3

Browse files
committed
Add Flash and Build tasks for VS Code
1 parent a442222 commit 36393f3

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
lines changed

packages/pico-examples/ide/vscode/launch.json

+24-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"configurations": [
44
{
55
"name": "Pico Debug (Cortex-Debug)",
6-
"cwd": "${workspaceRoot}",
6+
"cwd": "${workspaceFolder}",
77
"executable": "${command:cmake.launchTargetPath}",
88
"request": "launch",
99
"type": "cortex-debug",
@@ -22,16 +22,37 @@
2222
},
2323
{
2424
"name": "Pico Debug (Cortex-Debug with external OpenOCD)",
25-
"cwd": "${workspaceRoot}",
25+
"cwd": "${workspaceFolder}",
2626
"executable": "${command:cmake.launchTargetPath}",
2727
"request": "launch",
2828
"type": "cortex-debug",
29-
"servertype" : "external",
29+
"servertype": "external",
3030
"gdbTarget": "localhost:3333",
3131
"gdbPath": "arm-none-eabi-gdb",
3232
"device": "RP2040",
3333
"svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
3434
"runToEntryPoint": "main"
35+
},
36+
{
37+
"name": "Pico Debug (C++ Debugger)",
38+
"type": "cppdbg",
39+
"request": "launch",
40+
"cwd": "${workspaceFolder}",
41+
"program": "${command:cmake.launchTargetPath}",
42+
"MIMode": "gdb",
43+
"miDebuggerPath": "arm-none-eabi-gdb",
44+
"miDebuggerServerAddress": "localhost:3333",
45+
"debugServerPath": "openocd",
46+
"debugServerArgs": "-f interface/cmsis-dap.cfg -f target/rp2040.cfg -c \"adapter speed 1000\"",
47+
"serverStarted": "Listening on port .* for gdb connections",
48+
"filterStderr": true,
49+
"stopAtEntry": true,
50+
"hardwareBreakpoints": {
51+
"require": true,
52+
"limit": 4
53+
},
54+
"preLaunchTask": "Flash",
55+
"svdPath": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd"
3556
}
3657
]
3758
}

packages/pico-examples/ide/vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
}
1818
},
1919
"cmake.buildBeforeRun": true,
20-
"cmake.generator": "Ninja",
20+
"cmake.configureOnOpen": true,
2121
"cmake.configureSettings": {
2222
"CMAKE_MODULE_PATH": "${env:PICO_INSTALL_PATH}/pico-sdk-tools"
2323
},
24+
"cmake.generator": "Ninja",
2425
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
2526
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Flash",
6+
"type": "shell",
7+
"command": "openocd",
8+
"args": [
9+
"-f",
10+
"interface/cmsis-dap.cfg",
11+
"-f",
12+
"target/rp2040.cfg",
13+
"-c",
14+
"adapter speed 1000; program {${command:cmake.launchTargetPath}} verify reset exit"
15+
],
16+
"problemMatcher": []
17+
},
18+
{
19+
"label": "Build",
20+
"type": "cmake",
21+
"command": "build",
22+
"problemMatcher": "$gcc",
23+
"group": {
24+
"kind": "build",
25+
"isDefault": true
26+
}
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)