Skip to content

Commit 4043da2

Browse files
committed
Add VSCode attaching tutorial
1 parent 90483ca commit 4043da2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,42 @@ docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/d
4040
docker exec -it pico-sdk /bin/sh
4141
```
4242

43+
## Attach VSCode to running container
44+
45+
You can use the SDK container with Visual Studio Code, follow the instruction below:
46+
47+
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.
48+
49+
![image-1](https://user-images.githubusercontent.com/20487002/201380432-da387680-f6b0-4542-8c02-6a3eec8e103d.png)
50+
51+
2. Open the terminal and go to the projects you want to open in VSCode.
52+
53+
3. Pool 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.
54+
55+
```
56+
docker run -d -it --name pico-sdk --mount type=bind,source=${PWD},target=/home/dev lukstep/raspberry-pi-pico-sdk:latest
57+
58+
docker exec -it pico-sdk /bin/sh
59+
```
60+
61+
4. Click the green button in the lower left corner of VSCode and select options: Attach to Running Container...
62+
63+
![imag-2](https://user-images.githubusercontent.com/20487002/201382466-0204a11c-8487-4da5-8a3c-2c9cc233333c.png)
64+
65+
![imag-3](https://user-images.githubusercontent.com/20487002/201382561-41e4c75e-3424-4c50-99ac-f6bc76ec6892.png)
66+
67+
5. Select the SDK container.
68+
69+
![imag-4](https://user-images.githubusercontent.com/20487002/201383009-54a3fc62-1206-4105-83d0-d956448434dd.png)
70+
71+
6. Then a new VSCode window will open. At the bottom window, you can see that it is attached to the SDK container.
72+
73+
![imag-5](https://user-images.githubusercontent.com/20487002/201383452-10573842-de2a-46c3-9ebf-f6fd5f06c687.png)
74+
75+
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.
76+
77+
![imag-6](https://user-images.githubusercontent.com/20487002/201386202-dd0934b2-5fae-4a2d-8875-f2cb40b1dc59.png)
78+
79+
8. Now You can explore, develop and build your Raspberry Pi Pico project via Visual Studio Code!
80+
81+
![imag-7](https://user-images.githubusercontent.com/20487002/201389505-d1346622-a8e1-4d0b-842c-57e5b54f9183.png)

0 commit comments

Comments
 (0)