A starting point for all Pico family software development on our module-based PCB. This template provides a foundation for developing embedded applications that will eventually include OpenCyphal communication capabilities for interoperability with other systems.
This template includes:
- Basic hardware initialization (SPI, I2C, UART, Timers)
- VS Code workspace configuration
- CMake build system setup
- Example code demonstrating common peripherals
- Future support for OpenCyphal communication protocol
- VS Code - Download from https://code.visualstudio.com/
- Raspberry Pi Pico VS Code Extension - Required for development
The easiest way to get started with Pico development is using the official VS Code extension:
- Open VS Code
- Go to the Extensions view (
Ctrl+Shift+XorCmd+Shift+X) - Search for "Raspberry Pi Pico"
- Install the official extension by Raspberry Pi Foundation
Alternatively, you can install it from the command line:
code --install-extension raspberrypi.raspberry-pi-picoThe VS Code extension will automatically handle:
- Pico SDK installation and management
- Toolchain setup (ARM GCC compiler)
- CMake configuration
- Build tools (Ninja)
- Debugging tools (OpenOCD, GDB)
For detailed setup instructions, refer to the official Getting Started with Pico Guide.
-
Create a new repository from this template:
- Go to this repository on GitHub
- Click "Use this template" → "Create a new repository"
- Choose your repository name and settings
- Clone your new repository locally
-
Initialize submodules:
git submodule update --init --recursive
-
The VS Code extension should automatically configure the project. If prompted, select your Pico board type.
This template includes Git submodules for external dependencies, including the MCP251XFD CAN controller driver.
# Initialize and update all submodules
git submodule update --init --recursive# Add a new submodule
git submodule add <repository-url> <path>
# Example: Adding OpenCyphal library (future enhancement)
# git submodule add https://github.com/OpenCyphal/libcanard.git lib/libcanard- Always commit submodule changes before committing the parent repository
- When pulling updates, use
git pull --recurse-submodules - To remove a submodule, follow Git's standard submodule removal process
The project includes pre-configured VS Code tasks:
- Compile Project: Use
Ctrl+Shift+P→ "Tasks: Run Task" → "Compile Project" - Flash to Device: Use "Run Project" or "Flash" task
- Debug: Use the built-in debugger with the configured launch settings
# Create build directory (if not exists)
mkdir -p build
cd build
# Configure with CMake
cmake ..
# Build the project
make -j4This template is configured for the following default pin assignments:
- MISO: GPIO 16
- CS: GPIO 17
- SCK: GPIO 18
- MOSI: GPIO 19
- SDA: GPIO 8
- SCL: GPIO 9
- TX: GPIO 4
- RX: GPIO 5
For complete pinout information, refer to: https://pico.pinout.xyz/
├── module-name.c # Main application code
├── CMakeLists.txt # Build configuration
├── pico_sdk_import.cmake # SDK import script
├── .vscode/ # VS Code configuration
│ └── c_cpp_properties.json
└── build/ # Build output (auto-generated)
This template uses the MCP251XFD driver for CAN communication:
- Repository: Emandhal/MCP251XFD
- Documentation: MCP251XFD Driver Library Guide
This template is planned to include:
- OpenCyphal Integration: Communication protocol for distributed embedded systems
- CAN Bus Support: Hardware abstraction for CAN communication
- Advanced Peripheral Examples: PWM, ADC, DMA usage
- Power Management: Low-power modes and optimization
- Unit Testing Framework: Automated testing capabilities
- Pico C/C++ SDK Documentation: https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html
- Getting Started Guide: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf
- Pinout Reference: https://pico.pinout.xyz/
- Pico Examples Repository: https://github.com/raspberrypi/pico-examples
We welcome contributions to improve this template! Please follow these guidelines:
-
Fork the repository and create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the project coding standards:
- Use consistent indentation (4 spaces for C code)
- Add comments for complex logic
- Follow existing naming conventions
- Test your changes on actual hardware when possible
-
Commit your changes with descriptive messages:
git commit -m "Add SPI flash memory support with wear leveling" -
Update documentation as needed:
- Update README if adding new features
- Add inline code documentation
- Update pinout configurations if changed
-
Submit a Pull Request:
- Push your branch to your fork
- Create a PR with a clear title and description
- Reference any related issues
- Include testing details and hardware compatibility
- Title: Use clear, descriptive titles (e.g., "Add I2S audio support for RP2040")
- Description: Explain what changes were made and why
- Testing: Describe how you tested the changes
- Breaking Changes: Clearly note any breaking changes
- Documentation: Ensure all new features are documented
- Follow the existing code style and structure
- Add error handling where appropriate
- Include examples for new peripheral configurations
- Maintain compatibility with the VS Code extension workflow
- Test builds with both Debug and Release configurations
When reporting bugs or requesting features:
- Use descriptive titles
- Include hardware details (Pico model, board revision)
- Provide steps to reproduce issues
- Include relevant code snippets or error messages
This project is licensed under the terms specified in the LICENSE file.