debug-platformio
Original:🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected
Used when performing GDB debugging on target boards via PlatformIO's built-in debugging features, supporting download-and-halt, attach-only, and crash context analysis.
3installs
Sourceleokemp223/embed-ai-tool
Added on
NPX Install
npx skill4agent add leokemp223/embed-ai-tool debug-platformioTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →PlatformIO Debugging
Applicable Scenarios
- is specified in the
build_system: platformio, orProject Profileexists in the workspace.platformio.ini - Users need to perform online debugging on target boards (single-step execution, breakpoints, viewing registers and variables).
- Need to analyze crash contexts (HardFault registers, call stacks).
Required Inputs
- PlatformIO project directory (containing ).
platformio.ini - Optional environment name and debug mode.
Auto Detection
- Automatically locates the CLI.
pio - Parses the configuration in
debug_tool.platformio.ini - PlatformIO automatically manages debug servers (OpenOCD/pyOCD/J-Link GDB Server), no manual configuration required.
Execution Steps
- First read references/usage.md to confirm the operation.
- Detect the debugging environment:
bash
python scripts/pio_debugger.py --detect --project-dir <project directory> --env <environment name> - Execute debugging:
bash
python scripts/pio_debugger.py --project-dir <project directory> --env <environment name> --mode download-and-halt
Debug Modes
- : Downloads firmware to the target board, pauses at the entry point, and outputs register and backtrace information.
download-and-halt - : Attaches to a running target without downloading firmware, outputs the current status.
attach-only - : Pauses the target, reads registers, complete backtraces, and Cortex-M Fault registers (CFSR/HFSR/MMFAR/BFAR).
crash-context
Failure Diversion
- : Debugger not connected or device unresponsive.
connection-failure - : Board does not support debugging or
debug-not-supportedis not configured.debug_tool - : Debug session terminated abnormally.
debug-failure
Output Convention
Sample output format:
Debugging completed ✅
Project: ESP32_DEV → Environment: esp32dev
Board: esp32dev | Debug Tool: esp-prog
Mode: download-and-halt
Key Observations: 5 items (registers, backtrace frames)Handover Relationship
- Receives successfully compiled project information from .
build-platformio - After issues are found during debugging, can hand back to for code modification and recompilation.
build-platformio