pi_pico/build.sh
Mohamed Salem 3687e48684 Add complete firmware stack with USB-CDC proof of life
Dockerized build system (Dockerfile, docker-compose, build.sh) with
Pico SDK cross-compilation. Modular CMake split into project_config,
mcu_config, and sources_config under cmake/. Component architecture
following inc/prg/cfg convention: STD_TYPES, MCU_USB, HAL_COM,
APP_CLSW, SYS_ECU. Full call chain SYS_ECU -> APP_CLSW -> HAL_COM
-> MCU_USB verified end-to-end on RP2040-Zero hardware over USB-CDC.
Includes flash.sh for automated .uf2 flashing on macOS and
devcontainer config for VS Code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:23:24 +02:00

26 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Build script for the Pico firmware.
# Creates an out-of-source build directory to keep generated files
# separate from the project source code.
#
# Directory layout expected at project root:
# cmake/ - all build-system files (CMakeLists.txt + cmake_config/)
# src/ - application source code
# build/ - created by this script, holds all CMake/Make output
#
# Using -S and -B lets us point CMake at the cmake/ source folder while
# keeping the build artifacts in a sibling build/ folder at the project root.
# Fail fast on any error so a broken configure step doesn't silently lead
# to a confusing make error further down.
set -e
# Configure the build: tell CMake the source directory is cmake/ and the
# binary (build) directory is build/. CMake will create build/ if needed.
cmake -S cmake -B build
# Compile everything using all available CPU cores. The final output is a
# .uf2 file in build/ that can be dragged onto the Pico's USB mass storage.
cmake --build build -j"$(nproc)"