• Stars
    star
    294
  • Rank 141,303 (Top 3 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tool to automatically generate a Pico C SDK Project

pico-project-generator

This is a command line or GUI tool, written in Python, to automatically generate a Pico C SDK Project.

The tool will generate all required CMake files, program files and VSCode IDE files for the set of features requested.

It will also add example code for any features and optionally for some standard library functions.

Notes for installation on Windows

If you are using the Windows installer, the version of Python that is part of that package does not include TKInter support which is needed by this generator. You will need a standard install of Python as follows:

  1. Install the SDK with the Raspberry Pi "Pico setup for Windows" installer from https://github.com/raspberrypi/pico-setup-windows/.
  2. Install the full version of Python from https://www.python.org/downloads/windows/.
  3. Open a Pico - Developer Command Prompt window.
  4. cd to the location where you have downloaded/cloned the pico-project-generator.
  5. Launch using py.exe instead of python.exe. e.g. py pico_project.py --gui, this will use the latest installed version (the full version) of Python, instead of the embedded distribution included with the SDK.

Command line

Running ./pico_project.py --help will give a list of the available command line parameters

usage: pico_project.py [-h] [-t TSV] [-o OUTPUT] [-x] [-l] [-c] [-f FEATURE] [-over] [-b] [-g] [-p PROJECT] [-r] [-uart] [-nouart] [-usb] [-cpp]
                       [-cpprtti] [-cppex] [-d DEBUGGER] [-board BOARDTYPE] [-bl]
                       [name]

Pico Project generator

positional arguments:
  name                  Name of the project

optional arguments:
  -h, --help            show this help message and exit
  -t TSV, --tsv TSV     Select an alternative pico_configs.tsv file
  -o OUTPUT, --output OUTPUT
                        Set an alternative CMakeList.txt filename
  -x, --examples        Add example code for the Pico standard library
  -l, --list            List available features
  -c, --configs         List available project configuration items
  -f FEATURE, --feature FEATURE
                        Add feature to generated project
  -over, --overwrite    Overwrite any existing project AND files
  -b, --build           Build after project created
  -g, --gui             Run a GUI version of the project generator
  -p PROJECT, --project PROJECT
                        Generate projects files for IDE. Options are: vscode
  -r, --runFromRAM      Run the program from RAM rather than flash
  -uart, --uart         Console output to UART (default)
  -nouart, --nouart     Disable console output to UART
  -usb, --usb           Console output to USB (disables other USB functionality
  -cpp, --cpp           Generate C++ code
  -cpprtti, --cpprtti   Enable C++ RTTI (Uses more memory)
  -cppex, --cppexceptions
                        Enable C++ exceptions (Uses more memory)
  -d DEBUGGER, --debugger DEBUGGER
                        Select debugger (0 = SWD, 1 = PicoProbe)
  -board BOARDTYPE, --boardtype BOARDTYPE
                        Select board type (see --boardlist for available boards)
  -bl, --boardlist      List available board types
  -cp, --cpath          Override default VSCode compiler path

You can list the features supported by the tools by using ./pico_project.py --list. These features can be added to the project using the --feature options, this can be used multiple times.

GUI version

The GUI version of the tool, run by adding --gui to the command line, uses tkinter to provide a platform-agnostic script that will run on Linux, Mac and Windows. All the options from the command line tool are also supported in the GUI. It may be necessary to install the python3-tk package for GUI support on Ubuntu/Debian platforms.

The board type selects the specific board header files to be used. The generator will scan the Pico SDK boards folder for all available boards.

You can add specific features to your project by selecting them from the checkboxes on the GUI. This will ensure the build system adds the appropriate code to the build and also adds simple example code to the project showing how to use the feature. There are several options available, which provide the following functionality.

Pico Wireless Options Description
None Do not include any Pico W libraries
Onboard LED Only include a small library to provide access to the PicoW LED
Polled lwIP A polled lwIP implementation library
Background lwIP A library to run the lwIP stack in the background.
Console Options Description
Console over UART Enable a serial console over the UART. This is the default.
Console over USB Enable a console over the USB. The device will act as a USB serial port. This can be used in addition to or instead of the UART option, but note that when enabled other USB functionality is not possible.
Code Options Description
Add examples for Pico library Example code will be generated for some of the standard library features that by default are in the build, for example, UART support and HW dividers.
Run from RAM Usually, the build creates a binary that will be installed to the flash memory. This forces the binary to work directly from RAM.
Generate C++ Any generated source files will use the .cpp extension.
Enable C++ exceptions By default exceptions are not support, check this to enable. There is an impact of speed and code size.
Enable C++ RTTI By default RTTI (Run Time type information) is not enabled, check this to enable. There is an impact of speed and code size.
Advanced Brings up a table allowing selection of specific board build options. These options alter the way the features work, and should be used with caution.
Build Options Description
Run Build Once the project has been created, build it. This will produce files ready for download to the Raspberry Pi Pico.
Overwrite Project If a project already exists in the specified folder, overwrite it with the new project. This will overwrite any changes you may have made.
IDE Options Description
Create VSCode Project As well as the CMake files, also create the appropriate Visual Studio Code project files.
Debugger Use the specified debugger in the IDE

More Repositories

1

linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
C
11,056
star
2

documentation

The official documentation for Raspberry Pi computers and microcontrollers
Python
5,178
star
3

firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5,133
star
4

pico-sdk

C
3,536
star
5

pico-examples

C
2,763
star
6

noobs

NOOBS (New Out Of Box Software) - An easy Operating System install manager for the Raspberry Pi
Makefile
2,210
star
7

userland

Source code for ARM side libraries for interfacing to Raspberry Pi GPU.
C
2,040
star
8

tools

C
1,876
star
9

rpi-imager

The home of Raspberry Pi Imager, a user-friendly tool for creating bootable media for Raspberry Pi devices.
C
1,668
star
10

rpi-eeprom

Installation scripts and binaries for the Raspberry Pi 4 and Raspberry Pi 5 bootloader EEPROMs
Shell
1,257
star
11

pico-micropython-examples

Examples to accompany the "Raspberry Pi Pico Python SDK" book.
Python
948
star
12

usbboot

Raspberry Pi USB booting code, moved from tools repository
C
897
star
13

picamera2

New libcamera based python library
Python
852
star
14

debugprobe

C
730
star
15

hats

C
658
star
16

pico-tflmicro

Pico TensorFlow Lite Port
C++
619
star
17

picotool

C++
549
star
18

Raspberry-Pi-OS-64bit

Repository for containing issues on the 64 bit operating system (as distinct from the 32 bit one)
466
star
19

pico-extras

C
459
star
20

pico-playground

C
434
star
21

quake3

C
390
star
22

rpicam-apps

C++
383
star
23

maynard

Desktop environment for Wayland
C
336
star
24

piserver

Raspberry Pi Server wizard to serve Raspbian to network booting Pis
C++
311
star
25

pico-bootrom-rp2040

C
271
star
26

raspiraw

Example app directly receiving raw data from CSI2 sensors
C
257
star
27

pico-setup-windows

PowerShell
252
star
28

libcamera

C++
211
star
29

utils

A collection of scripts and simple applications
C
148
star
30

openocd

C
141
star
31

windows-drivers

Windows IOT drivers
C
120
star
32

pico-bootrom-rp2350

C
120
star
33

cmprovision

Provisioning system for CM4 products
PHP
97
star
34

pico-setup

Shell
92
star
35

scratch

Scratch releases
79
star
36

usbbootgui

GUI for booting a Raspberry Pi device like Pi Zero or compute module as a device
M4
77
star
37

rp2350_hacking_challenge

CMake
70
star
38

tinyusb

C
67
star
39

rpi-sense

Sense HAT firmware and driver
Assembly
66
star
40

usb-pid

Raspberry Pi Pico PID allocations
63
star
41

gpioexpander

Buildroot based ethernet gadget which gives a host access to PIGPIO to control GPIO pins
Makefile
62
star
42

pico-vscode

The official VS Code extension for Raspberry Pi Pico development. It includes several features to simplify project creation and deployment.
TypeScript
62
star
43

target_fs

Shell
39
star
44

weston

The Weston Wayland Compositor
C
37
star
45

scriptexecutor

Simple buildroot based system for executing a remote script for manufacture programming
Shell
36
star
46

pico-host-sdl

C
27
star
47

pico-feedback

24
star
48

raspberrypi.github.io

Raspberry Pi GitHub organisations
HTML
20
star
49

pytrack

Python
17
star
50

Pi-Codec

Tools for the IQaudIO Pi-Codec / CodecZero sound cards
16
star
51

skygate

Python
15
star
52

style-guide

14
star
53

bookworm-feedback

13
star
54

CMSIS-RP2xxx-DFP

C
13
star
55

armulet

C++
8
star
56

pylibcamera

Meson
8
star
57

libpisp

C++
7
star
58

pico-sdk-tools

Shell
5
star
59

rpi-sb-provisioner

A minimal-input automatic secure boot provisioning system for Raspberry Pi devices.
Shell
5
star
60

pykms

Meson
2
star
61

FreeRTOS-Kernel

C
1
star
62

sweet-b

C
1
star