first commit

This commit is contained in:
2026-08-10 23:36:24 +08:00
commit d363e04b64
63 changed files with 40518 additions and 0 deletions

30
tools/debug-server.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# ============================================================
# 启动 ST-LINK GDB Server供 CLion 的 Embedded/Remote GDB Server 调试连接
#
# 用法:
# 1) 接好 ST-Link (SWD), 给板子供电
# 2) 运行本脚本 (CLion 里点 "Debug-Server" 运行配置, 或终端 bash tools/debug-server.sh)
# 3) 在 CLion 调试配置里用 target remote localhost:61234 连接
#
# GDB Server : ST-LINK_gdbserver (CubeCLT 自带)
# 连接模式 : under-reset (-m 0) —— 对 F103 最稳, 能抓复位/卡死态
# ============================================================
set -e
CLT="/c/ST/STM32CubeCLT_1.18.0"
GDBSERVER="$CLT/STLink-gdb-server/bin/ST-LINK_gdbserver.exe"
CP="$CLT/STM32CubeProgrammer/bin" # Connection Bridge: 提供 ST-LINK 驱动桥接, 必需
if [ ! -x "$GDBSERVER" ]; then
echo "找不到 ST-LINK_gdbserver.exe: $GDBSERVER" >&2
echo "请确认 STM32CubeCLT 已安装在 $CLT" >&2
exit 1
fi
echo "==[ ST-LINK GDB Server 启动 ]=="
echo "==[ 监听 :61234 连接模式 under-reset ]=="
echo "==[ 在 CLion 调试配置里 target remote localhost:61234 连接 ]=="
echo "==[ Ctrl+C 退出 ]=="
echo "----------------------------------------------------------------"
exec "$GDBSERVER" -cp "$CP" -p 61234 -m 0