ワンクリックで
esp32-debugging
Debug ESP32 firmware issues including compilation errors, runtime panics, memory issues, and communication failures
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Debug ESP32 firmware issues including compilation errors, runtime panics, memory issues, and communication failures
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Debug static, hiss, or noise on embedded I2S audio (ESP32 + MAX98357A / PCM DACs), especially streamed PCM. Measure the signal at each pipeline stage instead of guessing at the amp. Use when audio plays but sounds wrong.
Generate a printable Typst build guide (source + PDF) for an ESP32/MCU project by analyzing its docs, source, and schematic
Register a project in the monorepo — justfile mod, CI matrix, standard file inventory
Standardize credential handling for an ESP32 project (credentials.h.example, .gitignore, pre-commit protection)
Set up ESP-IDF development environment, create new projects, and verify configuration
Generate a CLAUDE.md for a project with build commands, hardware constraints, architecture, and development tasks
| name | esp32-debugging |
| description | Debug ESP32 firmware issues including compilation errors, runtime panics, memory issues, and communication failures |
| user-invocable | true |
| argument-hint | [error-context] |
| allowed-tools | Bash(just:*), Read, Grep, Glob |
Apply this skill when the user:
$ARGUMENTS may contain error messages or context about the issue.
If the error isn't clear from $ARGUMENTS, ask the user to provide:
Run a fresh build to capture the error:
just <project>::build 2>&1 | tail -100
Missing Includes
fatal error: driver/gpio.h: No such file or directory
Fix: Add the component to REQUIRES in main/CMakeLists.txt:
idf_component_register(
SRCS "main.c"
REQUIRES driver
)
Undefined References
undefined reference to 'some_function'
Fix: Ensure the component containing the function is in REQUIRES or PRIV_REQUIRES.
Type Errors Look for mismatched types between function declarations and implementations.
Guru Meditation Error Patterns
| Error | Cause | Fix |
|---|---|---|
StoreProhibited | Writing to invalid memory | Check pointer initialization |
LoadProhibited | Reading from invalid memory | Check null pointers |
InstrFetchProhibited | Corrupted function pointer | Check callback assignments |
IntegerDivideByZero | Division by zero | Add zero checks |
Stack Overflow
Guru Meditation Error: Core 0 panic'ed (Stack overflow)
Fix: Increase stack size in task creation:
xTaskCreatePinnedToCore(task_fn, "name", 4096, NULL, 5, NULL, 0);
// ^^^^ increase this
Stack Smashing
Stack smashing detected
Fix: Local buffer overflow — check array bounds and string operations.
Check Heap Usage
ESP_LOGI(TAG, "Free heap: %lu", esp_get_free_heap_size());
ESP_LOGI(TAG, "Min free heap: %lu", esp_get_minimum_free_heap_size());
Common Memory Issues
free() after malloc()I2C Issues
E (1234) i2c: i2c_master_cmd_begin(xxx): I2C_NUM error
Checklist:
Serial/UART Issues
Dual-Controller Sync (I2C)
# Clean build to eliminate stale objects
just <project>::clean && just <project>::build
# Start serial monitor
just <project>::monitor PORT=/dev/cu.usbserial-0001
Enable in sdkconfig.defaults or via menuconfig:
CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT — Print panic info before rebootCONFIG_FREERTOS_WATCHPOINT_END_OF_STACK — Detect stack overflow earlierCONFIG_HEAP_POISONING_COMPREHENSIVE — Detect heap corruption| Symptom | Fix |
|---|---|
| Stack overflow | Increase task stack size in xTaskCreate |
| Memory leak | Check for missing free() calls |
| I2C timeout | Verify connections, pull-ups, addresses |
| Crash on startup | Increase CONFIG_ESP_MAIN_TASK_STACK_SIZE to 8192+ |