https://github.com/modmuss50/pico-template
A simple ready to go template project for building C/C++ software for the Raspberry Pi Pico
https://github.com/modmuss50/pico-template
cmake cpp example ninja raspberry-pi rp2040 template
Last synced: 6 months ago
JSON representation
A simple ready to go template project for building C/C++ software for the Raspberry Pi Pico
- Host: GitHub
- URL: https://github.com/modmuss50/pico-template
- Owner: modmuss50
- Created: 2021-01-22T18:42:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-01T16:23:04.000Z (over 3 years ago)
- Last Synced: 2025-04-23T12:58:00.196Z (6 months ago)
- Topics: cmake, cpp, example, ninja, raspberry-pi, rp2040, template
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 26
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Pico Template
A simple C/C++ template for the Raspberry Pi pico using cmake.
[CLion](https://www.jetbrains.com/clion/) works great as an IDE.
Was made with help from the [Getting Started guide](https://datasheets.raspberrypi.org/pico/getting_started_with_pico.pdf)
# Requirements
### MacOS```bash
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc cmake ninja
```### Debian/Ubuntu
```bash
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential ninja-build
```### Windows
[Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install) can be used to run Ubuntu.
# Setup
Updates the [pico-sdk](https://github.com/raspberrypi/pico-sdk) sub-module, this may take a few minutes as its quite large.
```bash
git submodule update --init --recursive
```# Build
Creates a new `build` directory and uses [ninja](https://ninja-build.org/) to build the .uf2 file.
```bash
mkdir build
cd build
cmake -G Ninja ..
ninja
```Copy the .uf2 file from the `build` directory onto the pico to run
# Serial console (MacOS)
```bash
ls /dev/tty.*
screen /dev/tty.usbmodem0000000000001
```