esp32_pin_audit
Skill79 starsChanged 8 months agoMITView on GitHub
Audit ESP32 GPIO usage for conflicts, reserved pin violations, and documentation drift.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- esp32_arch_reviewSkill
- esp32_crash_reviewSkill
- esp32_log_triageSkill
- esp32_test_planSkill
- feature_contractSkill
- esp32_hardware_checkSkill
- pr_prepareSkill
- repo_scoutSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Before adding new peripheral code.
- Distinctive: line 14
When debugging mysterious hardware behavior.
- Distinctive: line 21
Search the project for pin definitions:
- Distinctive: line 64
Verify pull-up or pull-down is configured to avoid floating pins.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ESP32 Pin Audit
Systematically audit GPIO pin usage across the project to detect conflicts, reserved pin misuse, and undocumented assignments.
When to Use
- Before adding new peripheral code.
- During architecture review.
- When debugging mysterious hardware behavior.
- Before release.
Steps
1. Collect All Pin Declarations
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/null2. Check Reserved Pins
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 |
3. Detect Conflicts
Build a pin allocation table and check for:
- Double assignment: Same GPIO used by two different peripherals.
- Bus conflicts: I2C and SPI sharing the same pins.
- ADC/DAC conflicts: ADC2 channels unusable when Wi-Fi is active.
- Strapping conflicts: Boot pins used without awareness.
4. Verify Pull-Up/Pull-Down Configuration
For I2C lines:
- External pull-ups are required. Internal pull-ups are too weak for reliable I2C.
- Flag if only internal pull-ups are configured for I2C.
For inputs with no external circuitry:
- Verify pull-up or pull-down is configured to avoid floating pins.
5. Check Documentation
Compare actual code pin usage against:
- Pin map comments in source files.
- README or documentation references.
- Schematic references if available.
Flag any drift between documented and actual usage.
6. Generate Audit Report
# 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]ADC2 Wi-Fi Warning
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

