简体中文 · English
# AI Agent Guide: Version Update, Firmware Build, and Flashing Pipeline This document defines the unified pipeline for firmware version bumping, compilation, 0x0 merged binary generation, layout verification, and device flashing. ## 1. Automated Pipeline Tool: `tools/pipeline.py` The repository provides a unified script (`tools/pipeline.py`) that chains the entire workflow, supporting version bumping, building, flashing, and full **backup/restore** of user data. ### Usage Examples 1. **Standard Safe Flash (Fastest, preserves NVS & profiles in-place)**: ```bash python tools/pipeline.py --bump patch --flash ``` 2. **Flash with explicit Backup & Restore (Full safety net)**: ```bash python tools/pipeline.py --bump patch --flash --backup --restore ``` 3. **Backup only (Save Wi-Fi, profiles & QR codes to disk)**: ```bash python tools/pipeline.py --backup-only --backup-dir ./backups/my_backup ``` 4. **Restore only (Write saved user data back to device)**: ```bash python tools/pipeline.py --restore-only --backup-dir ./backups/my_backup ``` 5. **Build and package 0x0 binary without flashing**: ```bash python tools/pipeline.py --bump patch ``` ## 2. Core Execution Stages ### Stage 1: Update Version - Location: `main/badge_profile.h` - Macro: `#define BADGE_VERSION "X.Y.Z"` ### Stage 2: Activate ESP-IDF 5.5.3 Environment - Toolchain path: `D:\esp\esp-idf` - Activation in Windows PowerShell: ```powershell [Environment]::SetEnvironmentVariable('MSYSTEM', '') Set-Location D:\esp\esp-idf . .\export.ps1 Set-Location