PicoForge is a modern, browser-based visual programming environment designed specifically for the Raspberry Pi Pico (RP2040). It bridges the gap between drag-and-drop simplicity and professional C++ development by generating valid, compiled Pico SDK code in real-time.
- Visual Logic Builder: Drag-and-drop support (using
@dnd-kit) for GPIO, SPI, I2C, ADC, PWM, and Flow Control. - Live Architecture Preview: Real-time system visualization using dynamic Mermaid diagrams.
- Dockerized Build Toolchain: Compiles C++ code for RP2040 in a containerized environment—no local toolchain installation required.
- Reusable Functions: Visually define C++ functions with steps and call them endlessly in your main loop.
- Smart Validation:
- Prevents pin conflicts (e.g., using a pin for both SPI and GPIO).
- Enforces hardware constraints (e.g., valid SPI0 vs SPI1 pins).
- Auto-links config blocks to their actions.
- Production-Ready Code: Generates clean, commented
main.cppandCMakeLists.txtthat auto-detects required libraries (hardware_spi,hardware_pwm, etc.).
PicoForge uses a containerized microservices architecture to ensure consistent, reproducible builds across any OS.
graph LR
User[User / Browser] -- 1. Visual Design --> React[Frontend UI]
React -- 2. JSON Config --> Node[Node.js Backend]
Node -- 3. Scaffolding --> Gen[Code Generator]
Gen -- 4. C++ Source --> BuildEnv[Docker Build Container]
BuildEnv -- 5. Compile (GCC) --> Bin[firmware.uf2]
Bin -- 6. Download --> User
- Frontend (
/web/frontend): A React application built with Vite and Tailwind CSS. It handles the block logic, validation, and state management. - Backend (
/web/backend): A Node.js Express API. It acts as the orchestrator, managing project files and spinning up build containers. - Build Environment (
/docker): A custom Alpine Linux Docker image pre-loaded with the officialpico-sdk,cmake, andarm-none-eabi-gcc.
d:\apps\picoforge
├── 📂 web
│ ├── 📂 frontend # React UI: Visual Builder, Components, Mermaid Preview
│ └── 📂 backend # Node.js API: Scaffold Service, Project Management
├── 📂 docker # Dockerfiles defining the dev and build environments
├── 📂 workspace # Persistent volume for User Projects & Build Artifacts
├── 📄 docker-compose.yml # Orchestration for all services (frontend, backend, builder)
└── 📄 README.md # Documentation- Docker Desktop (Ensure it is running)
- Git
-
Clone the repository:
git clone https://github.com/yourusername/picoforge.git cd picoforge -
Start the environment: This command builds the frontend, backend, and compile-toolchain containers.
docker-compose up -d --build
-
Access PicoForge: Open your browser to
http://localhost:8080.
- Create Project: Click "New Project", give it a name (e.g.,
blink-led). - Setup Hardware:
- Drag Setup blocks (e.g.,
SPI CONFIG,PWM CONFIG) into the Setup section. - Validation checks will ensure you pick valid hardware pins.
- Drag Setup blocks (e.g.,
- Define Logic:
- Drag Action blocks (e.g.,
GPIO SET,SPI WRITE,WAIT) into the Loop section. - Create custom functions using the
Function Defblock.
- Drag Action blocks (e.g.,
- Visualize: Check the "Architecture Preview" card to see a generated diagram of your system.
- Build: Click the Build button. The backend generates the C++ code and compiles it.
- Flash: When the build finishes, a
project.uf2file will download. Drag this to your Pico (mounted as RPI-RP2).
Contributions are welcome!
- Fork the repo.
- Create a feature branch (
git checkout -b feature/amazing-feature). - Commit your changes.
- Push to the branch.
- Open a Pull Request.
MIT License - see LICENSE for details.