You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-96
Original file line number
Diff line number
Diff line change
@@ -11,20 +11,16 @@ and can be used for container runs.
11
11
Commands below show how to run a container, using an image from Docker Hub
12
12
```
13
13
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/dev lukstep/raspberry-pi-pico-sdk:latest
14
-
15
14
docker exec -it pico-sdk /bin/sh
16
15
```
17
16
18
-
The directory from which the `docker run` command was called will be mounted to /home/dev in the container.
17
+
The directory from which the `docker run` command was called will be mounted to /home/dev in the container.
19
18
So after attaching to the SDK container you can build your project following the steps:
20
19
21
20
```
22
21
cd /home/dev
23
-
24
22
mkdir build
25
-
26
23
cd build
27
-
28
24
cmake .. && make -j4
29
25
```
30
26
@@ -34,108 +30,35 @@ To build your own SDK image, You need to clone this repository and run the follo
34
30
35
31
```
36
32
cd raspberry-pi-pico-docker-sdk
37
-
38
33
docker build . --tag pico-sdk
39
-
40
34
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/dev pico-sdk
41
-
42
35
docker exec -it pico-sdk /bin/sh
43
36
```
44
37
45
-
## Visual Studio Code as Rassberry Pi PICO projects IDE
46
-
47
-
You can use the SDK container with Visual Studio Code as Raspberry Pi Pico projects IDE.
48
-
49
-
### Attaching VSCode to SDK Docker container
50
-
51
-
Follow the instruction below to set up VSCode:
52
-
53
-
1. Install [Visual Studio Code](https://code.visualstudio.com) and next [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) extensions.
2. Open the terminal and go to the projects you want to open in VSCode.
58
-
59
-
3. Pull SDK image from Docker HUB and run SDK container via the following command. The container must be running while you attach to it via VSCode.
60
-
61
-
```
62
-
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/dev lukstep/raspberry-pi-pico-sdk:latest
63
-
64
-
docker exec -it pico-sdk /bin/sh
65
-
```
66
-
67
-
4. When the container is launched, go to VSCode, click the green button in the lower left corner of VSCode and select options: Attach to Running Container...
7. Now, there is needed to open project files. Your project is mounted to `/home/dev` in the container. Go to EXPLORE tab in VSCode and click Open Folder. In opened window write `/home/dev` and click the OK button.
For an IntelliSense that will be aware of Raspberry Pi Pico SDK dependencies, we will use [Clangd](https://clangd.llvm.org). Clangd is a C/C++ language server provided by the LLVM project. To Setup Clang as Intellisense engine follow instruction below:
90
-
91
-
1. To begin with, you need to install the server itself (Clangd is not installed by default in the SDK container image), to do this in the terminal call the command:
92
-
93
-
```
94
-
apk add clang-extra-tools
95
-
```
96
-
97
-
2. Next is needed to install the Visual Studio Code [Clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd).
1. To set-up The Clangd extension, in the project root directory, create folder .vcode with file settings.json. To settings.json past configuration from the snippet below:
4. For clangd to work, it needs a `compile_commands.json` file. This file contains the compilation and dependency information of each file in the project. To create it you need to add to the CMake command, `-DCMAKE_EXPORT_COMPILE_COMMANDS=1`. So You need to build your project with the command:
122
-
123
-
```
124
-
mkdir build
125
-
126
-
cd build
127
-
128
-
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
129
-
130
-
make
131
-
```
46
+
#### Prerequisites
132
47
133
-
5. Now IntelliSense should work!. Now you should see a prompt when you start typing. If you hover your cursor over a function from the SDK you should see its documentation, You can go to the function definition by pressing F12.
48
+
To use dev container you need to VSCode, Docker and VSCode extensions installed.
49
+
Use [this](https://code.visualstudio.com/docs/devcontainers/tutorial#_prerequisites) instruction to set-up.
You need to Visual Studio Code and Docker installed.
7
+
8
+
## Attaching VSCode to SDK Docker container
9
+
10
+
Follow the instruction below to set up VSCode:
11
+
12
+
- Install [Visual Studio Code](https://code.visualstudio.com) and next [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) extensions.
- Open the terminal and go to the projects you want to open in VSCode.
17
+
18
+
- Pull SDK image from Docker HUB and run SDK container via the following command. The container must be running while you attach to it via VSCode.
19
+
20
+
```
21
+
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/dev lukstep/raspberry-pi-pico-sdk:latest
22
+
docker exec -it pico-sdk /bin/sh
23
+
```
24
+
25
+
- When the container is launched, go to VSCode, click the green button in the lower left corner of VSCode and select options: Attach to Running Container...
- Now, there is needed to open project files. Your project is mounted to `/home/dev` in the container. Go to EXPLORE tab in VSCode and click Open Folder. In opened window write `/home/dev` and click the OK button.
For an IntelliSense that will be aware of Raspberry Pi Pico SDK dependencies, we will use [Clangd](https://clangd.llvm.org). Clangd is a C/C++ language server provided by the LLVM project. To Setup Clang as Intellisense engine follow instruction below:
48
+
49
+
- To begin with, you need to install the server itself (Clangd is not installed by default in the SDK container image), to do this in the terminal call the command:
50
+
51
+
```
52
+
apk add clang-extra-tools
53
+
```
54
+
55
+
- Next is needed to install the Visual Studio Code [Clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd).
- To set-up The Clangd extension, in the project root directory, create folder .vcode with file settings.json. To settings.json past configuration from the snippet below:
- For clangd to work, it needs a `compile_commands.json` file. This file contains the compilation and dependency information of each file in the project. To create it you need to add to the CMake command, `-DCMAKE_EXPORT_COMPILE_COMMANDS=1`. So You need to build your project with the command:
80
+
81
+
```
82
+
mkdir build
83
+
cd build
84
+
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
85
+
make
86
+
```
87
+
88
+
- Now IntelliSense should work!. Now you should see a prompt when you start typing. If you hover your cursor over a function from the SDK you should see its documentation, You can go to the function definition by pressing F12.
0 commit comments