修复: OpenOCD 分号命令兼容性、tool_config 导入容错、Pico SDK 自动探测(跨平台 Win/macOS/Linux)#4
Open
hackerboygn wants to merge 6 commits into
Open
修复: OpenOCD 分号命令兼容性、tool_config 导入容错、Pico SDK 自动探测(跨平台 Win/macOS/Linux)#4hackerboygn wants to merge 6 commits into
hackerboygn wants to merge 6 commits into
Conversation
- Split semicolon-separated OpenOCD -c commands into individual -c args for compatibility with older OpenOCD versions (e.g., Pico SDK bundled) - Add --target missing diagnostic warning in gdb_debugger.py - Wrap tool_config import with try/except fallback for standalone usage
- Add find_pico_sdk_openocd_scripts() to scan ~/.pico-sdk/openocd/*/ for OpenOCD scripts directories containing chip-specific targets - Inject -s <scripts_dir> into build_flash_command() and build_openocd_command() so system OpenOCD can find rp2350.cfg - Works cross-platform (Windows: openocd.exe, Unix: bin/openocd)
…stalls When scripts are installed under a single directory (e.g. embed-tool), the original SKILLS_ROOT-based path resolution fails. Add fallback to check the workflow runner's own directory for the target script.
…t init - Add -c init to build_openocd_command for dual-core target init - Add 1.5s delay after OpenOCD port opens for target stabilization - Replace target extended-remote with target remote (better Pico SDK compat) - Replace load+reset halt sequence with monitor reset init (avoids GDB reflash) - Add monitor halt to attach-only mode for reliable register reads
…ig.py Move platform-specific OpenOCD scripts detection from individual skill scripts into the shared tool_config layer. Both openocd_flasher.py and gdb_debugger.py now import from tool_config with fallback stubs. This centralizes environment detection and makes it available to all skills without code duplication.
Rename find_pico_sdk_openocd_scripts -> find_sdk_bundled_openocd_scripts Replace chip-specific examples with generic terms (stm32h7x, dual/multi-core) Use 'SDK-bundled' terminology instead of vendor-specific names
2d2616f to
5d7cfcb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
分号命令兼容性:OpenOCD 脚本使用
-c "init; program ... verify reset exit"这种分号分隔的多命令形式,在部分 OpenOCD 版本中不能正常工作。tool_config 导入崩溃:脚本独立运行时(不在 repo 原目录结构中),
tool_config模块导入失败导致脚本崩溃。调试目标缺失诊断:
--target未指定时缺乏提示,用户不知道如何配置(如 RP2350 需要rp2350.cfg)。Pico SDK OpenOCD 未探测:Pico SDK 自带 OpenOCD 包含芯片特定目标配置(如
rp2350.cfg),脚本未自动添加其 scripts 搜索路径。修改
openocd_flasher.py (+17 / -5)
-c "init; program ..."→ 独立-c init-c "program ..."参数,兼容所有 OpenOCD 版本。find_pico_sdk_openocd_scripts()扫描~/.pico-sdk/openocd/*/scripts/,自动注入-s搜索路径。支持 Windows (openocd.exe)、macOS/Linux (bin/openocd)。gdb_debugger.py (+23 / -4)
--target时打印明确提示。平台兼容性
~/.pico-sdk/openocd/openocd.exebin/openocdbin/openocd影响范围
仅改动
flash-openocd和debug-gdb-openocd两个 skill 的脚本。所有修改向后兼容,不破坏现有功能。