Skip to content

Visual Studio Code Dev Container based C/C++ development environment for Raspberry Pi Pico

Notifications You must be signed in to change notification settings

va1da5/pico-vscode-dev-environment

Repository files navigation

VS Code Dev Container Environment For Raspberry Pi Pico C/C++

This project provides a ready-to-use portable development environment for Raspberry Pi Pico using C/C++ based on Visual Studio Code Dev Containers.

The environment is based on containers (Podman to be specific) which provides a easy to start way to run the development tools and libraries required for C/C++ development. The containers will be configured with all necessary dependencies and tools, such as a C/C++ compiler and debugger. The editor comes configured with extensions for C/C++ development, such as language support and debugging tools.

Udev Rules

There might be some issues when mounting devices using root-less containers, such as when using Podman. Because of that there is a requirement to pre-configure UDEV rules for openocd. The repository includes 60-openocd.rules file which needs to be placed in etc/udev/rules.d/ and the Picoprobe reconnected. Please note, that these rules were updated for Fedora OS. The original file can be found in here. devcontainer.json contains custom run arguments with annotations for container runtime, like run.oci.keep_original_groups=1. It is meant to fix group membership issues and prevent missing permission errors when trying to access devices from container. Correct annotation needs to be used according to the container runtime (oci, crun).

Flash Binaries

# build binary manually
make build

# flash binary directly using openocd
make flash

Linting

There is an option to enable C++ code linting functionality using Clang-tidy. Install the linter using the commands below.

apt update && apt install clang-tidy

Picoprobe Wiring

wiring diagram

References

About

Visual Studio Code Dev Container based C/C++ development environment for Raspberry Pi Pico

Topics

Resources

Stars

Watchers

Forks