一键导入
esp32-pin-audit
Audit ESP32 GPIO usage for conflicts, reserved pin violations, and documentation drift.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit ESP32 GPIO usage for conflicts, reserved pin violations, and documentation drift.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Verifies user's board configuration against known hardware limitations like strapping pins, ADC/Wi-Fi conflicts, and input-only pins.
Review ESP32 firmware architecture for RTOS safety, memory management, error handling, and embedded best practices.
Analyze ESP32 Guru Meditation errors and crash dumps to identify root cause and recommend fixes.
Parse and classify ESP32 serial log output to identify errors, warnings, boot issues, and failure patterns.
Generate a structured test plan for ESP32 firmware changes across all testing layers.
Generate a structured implementation contract before making any code changes to an ESP32 project.
| name | esp32_pin_audit |
| description | Audit ESP32 GPIO usage for conflicts, reserved pin violations, and documentation drift. |
Systematically audit GPIO pin usage across the project to detect conflicts, reserved pin misuse, and undocumented assignments.
Search the project for pin definitions:
# Macro definitions
grep -rn "#define.*GPIO\|#define.*PIN\|#define.*SDA\|#define.*SCL\|#define.*MOSI\|#define.*MISO\|#define.*CS\|#define.*CLK" --include="*.h" --include="*.c"
# GPIO_NUM usage
grep -rn "GPIO_NUM_" --include="*.c" --include="*.h"
# Kconfig GPIO options
grep -rn "CONFIG_.*GPIO\|CONFIG_.*PIN" sdkconfig.defaults sdkconfig 2>/dev/null
Flag violations against these reserved pins:
| GPIO | Restriction | Reason |
|---|---|---|
| 0 | Boot strapping | Must be HIGH for normal boot, LOW for download |
| 1 | UART0 TX | Default serial output |
| 2 | Boot strapping | Must be LOW during flash |
| 3 | UART0 RX | Default serial input |
| 6–11 | FORBIDDEN | Connected to internal SPI flash |
| 12 | Boot strapping | MTDI — affects flash voltage |
| 15 | Boot strapping | MTDO — affects debug output |
| 34–39 | Input-only | No output capability, no pull-up/pull-down |
Build a pin allocation table and check for:
For I2C lines:
For inputs with no external circuitry:
Compare actual code pin usage against:
Flag any drift between documented and actual usage.
# Pin Audit Report
## Pin Allocation Table
| GPIO | Function | Component | Direction | Pull | Notes |
|------|----------|-----------|-----------|------|-------|
## Violations
- [ ] [Description of violation]
## Conflicts
- [ ] [Description of conflict]
## Warnings
- [ ] [Potential issues to investigate]
## Documentation Drift
- [ ] [Documented vs. actual usage]
Critical: ADC2 channels (GPIO 0, 2, 4, 12, 13, 14, 15, 25, 26, 27) cannot be used while Wi-Fi is active. Always flag ADC2 usage in Wi-Fi-enabled projects.