Skip to content

Commit eb80233

Browse files
committed
sample: Hello arduino: VS Code and gdb demo
Demo VS Code and gdb step through code and build with a single button click! Signed-off-by: Dhruva Gole <goledhruva@gmail.com>
1 parent 04c1821 commit eb80233

File tree

4 files changed

+70
-1
lines changed

4 files changed

+70
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch",
9+
"device": "native_posix",
10+
"cwd": "${workspaceFolder}",
11+
"program": "/home/dhruva/zephyrproject/modules/lib/Arduino-Zephyr-API/samples/hello_arduino/build/zephyr/zephyr.exe",
12+
"request": "launch",
13+
"type": "cppdbg",
14+
"runToEntryPoint": "main",
15+
"gdbPath": "/usr/bin/gdb",
16+
"preLaunchTask": "West Build"
17+
},
18+
]
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
// Hush CMake
3+
"cmake.configureOnOpen": false,
4+
5+
// IntelliSense
6+
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
7+
8+
// File Associations
9+
"files.associations": {
10+
}
11+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "West Build",
6+
"type": "shell",
7+
"group": {
8+
"kind": "build",
9+
"isDefault": true
10+
},
11+
"linux": {
12+
"command": "/home/dhruva/zephyrproject/.venv/bin/west"
13+
},
14+
"args": [
15+
"build",
16+
"-p",
17+
"always",
18+
"-b",
19+
"native_posix"
20+
],
21+
"problemMatcher": [
22+
"$gcc"
23+
]
24+
25+
}
26+
],
27+
"inputs": [
28+
{
29+
"id": "board",
30+
"type": "promptString",
31+
"default": "native_posix",
32+
"description": "See https://docs.zephyrproject.org/latest/boards/index.html"
33+
},
34+
]
35+
36+
}

samples/hello_arduino/prj.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
CONFIG_CPLUSPLUS=y
2-
CONFIG_ARDUINO_API=y
2+
CONFIG_ARDUINO_API=y
3+
# CONFIG_ZTEST=y
4+
# CONFIG_ZTEST_NEW_API=y
5+

0 commit comments

Comments
 (0)