This document provides context for the Gemini code assistant to understand the picoTracker project.
picoTracker is a low-cost, open-source, and DIY hardware music tracker. The firmware is a modified version of LittleGPTracker, retaining most of its functionality while adding custom modifications.
The project is written in C++20 and uses CMake for building. It has a modular
architecture, with different components separated into directories like
Application, Services, System, and UIFramework.
The codebase is cross platform, supporting firmware for both the original RP2040 baed "pico" model and the STM32H7 based "Advance" (adv) model. The platform specific code for each lives under the respective Adaptors sub directories.
Key Technologies:
- C++20: The primary programming language.
- CMake: The build system used to compile the project.
- Raspberry Pi Pico SDK: Used for building the firmware for the Pico.
- FreeRTOS: Used for the "picoTracker Advance" board.
- ETL (Embedded Template Library): A C++ template library for embedded systems.
- Sdfat: A generic FAT file system module for the picoTracker pico model.
- FatFs: A generic FAT file system module for the picoTracker Advance (adv) model.
- tinyusb: An open-source USB host/device stack.
- LVGL: A lightweight, embedded graphics library (mentioned but might not be in use).
The project is built using CMake. Here are the general steps to build the project:
-
Clone the repository:
git clone https://github.com/democloid/picoTracker cd picoTracker -
Initialize submodules:
git submodule update --init --recursive
-
Create a build directory:
mkdir build cd build -
Run CMake:
PICO_SDK_PATH=../sources/Externals/pico-sdk cmake ../sources
-
Build the project:
make -j$(nproc)
To create a debug build:
PICO_SDK_PATH=../sources/Externals/pico-sdk cmake -DCMAKE_BUILD_TYPE=Debug -DPICO_DEOPTIMIZED_DEBUG=1 ../sources/- Coding Style: The project follows the
Google C++ Style Guide.
Code formatting is enforced by
clang-format. Before submitting a pull request, runclang-formatto ensure your code adheres to the style guide. printfusage: Theprintffamily of functions should not be used. Instead, use thenanoprintflibrary functions found innanoprintf.h. For debug logging, use theTraceclass.- Debugging: The recommended way to debug is by using a
picoProbeandOpenOCD. Thedocs/DEV.mdfile provides detailed instructions on how to set up a debugging environment. - CI: GitHub Actions are used for continuous integration, which includes a
clang-formatcheck and a build of the firmware.
sources/: Contains the C++ source code for the project.sources/CMakeLists.txt: The main CMake file that defines the project structure, dependencies, and build process.sources/Adapters/: Contains the platform-specific code for the Pico and the "Advance" board.sources/Application/: Contains the main application logic.sources/Services/: Contains services used by the application, such as audio and MIDI.sources/Externals/: Contains external libraries and dependencies.docs/: Contains developer documentation for the project, including build guides, a developer guide.usermanual: Contains the user manual in markdown format.README.md: The main README file for the project..clang-format: The configuration file forclang-format.