build: 删除 MDK-ARM/download.bat,烧录收敛到 stlink-flash skill

- test/run_all_suites.py 是唯一执行它的地方:DOWNLOAD_BAT 改为 STLINK_FLASH
  (.dsh/skills/stlink-flash/scripts/stlink_flash.py);直烧改
  [py, STLINK_FLASH, "flash"](原先把 .bat 包给命令行解释器执行);
  --flash-cmd 改由同一常量拼出,不再硬编码 .bat 路径
- 机制变化(须知晓):原 download.bat 走 UV4 -f(CMSIS-DAP),现走
  ST-LINK_CLI -P <hex> -Rst -Run —— 与 .serialtest/config.json 的
  flash_cmd、AGENTS.md 烧录铁律、回读 -CmpFile 要求同源;6.5s/1MB
  也快于 UV4 路径
- AGENTS.md / 环境与部署 3 篇 / ST-LINK_CLI 复位说明(原文写"正式流程仍以
  download.bat 为准",已反转)/ 自动化测试流程 / 串口助手设计说明 /
  链路延迟 / m2_data / README / MDK-ARM/README:引用改指 skill
- .gitignore:download_log.txt 条目保留并注明 legacy(他机残留物不变
  untracked);build 日志注释同步
- 保留 MDK-ARM/reset.bat:其 hard/halt/run 子命令是 skill 没有的
- 刻意未改:docs/问题记录/项目审查与优化建议报告.md 的 P2-15(史实)
- 验证:run_all_suites.py --dry-run 解析出 skill 路径;doc-links 123 通过
This commit is contained in:
2026-10-10 16:28:58 +08:00
parent 4f71947934
commit 5defabcabb
13 changed files with 28 additions and 71 deletions
+8 -6
View File
@@ -9,7 +9,7 @@
对每个套件:
1. 改 test_config.h 启用该套件(其它全注释)
2. @build(0 错 0 警,否则跳过该套件)
3. 烧录(MDK-ARM/download.bat,Reset & Run)
3. 烧录(stlink-flash skill:stlink_flash.py flash,Reset & Run)
4. @test 采集 + 判读(.dsh/skills/serial-boot-test 的 verify_log.py,含套件汇总行校验 T-2)
结束后:
5. **无条件还原 test_config.h**(try/finally,含异常/KeyboardInterrupt 路径)
@@ -54,7 +54,7 @@ from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
CONFIG = REPO_ROOT / "test" / "board" / "test_config.h"
KEIL_BUILD = REPO_ROOT / ".dsh" / "skills" / "keil-build" / "scripts" / "keil_build.py"
DOWNLOAD_BAT = REPO_ROOT / "MDK-ARM" / "download.bat"
STLINK_FLASH = REPO_ROOT / ".dsh" / "skills" / "stlink-flash" / "scripts" / "stlink_flash.py"
RUN_BOOT = REPO_ROOT / ".dsh" / "skills" / "serial-boot-test" / "scripts" / "run_boot_test.py"
# 套件 -> (宏名, verify_log 需要的汇总行名称, 该套件的 Required 标记, --forbidden 覆盖)
@@ -147,7 +147,7 @@ def main(argv=None):
return 2
# --check-build 不需要串口/烧录工具,故不强求 run_boot_test.py 存在
required = (CONFIG, KEIL_BUILD) if args.check_build else (CONFIG, KEIL_BUILD, DOWNLOAD_BAT, RUN_BOOT)
required = (CONFIG, KEIL_BUILD) if args.check_build else (CONFIG, KEIL_BUILD, STLINK_FLASH, RUN_BOOT)
for p in required:
if not p.is_file():
print("[ERROR] 缺文件:{}".format(p))
@@ -159,7 +159,7 @@ def main(argv=None):
print("套件:{}".format(", ".join(picked)))
print("构建:{}".format(KEIL_BUILD))
if not args.check_build:
print("烧录:{}".format(DOWNLOAD_BAT))
print("烧录:{}".format(STLINK_FLASH))
print("判读:{}".format(RUN_BOOT))
if args.dry_run:
print("[DRY-RUN] 仅打印计划,未改动任何文件。")
@@ -201,7 +201,7 @@ def main(argv=None):
# 2) 烧录
t0 = time.monotonic()
frc, fout = _run(["cmd", "/c", str(DOWNLOAD_BAT)], timeout=args.flash_timeout)
frc, fout = _run([py, str(STLINK_FLASH), "flash"], timeout=args.flash_timeout)
print("[FLASH] rc={} elapsed={:.1f}s".format(frc, time.monotonic() - t0))
if frc != 0:
print("\n".join(fout.strip().splitlines()[-6:]))
@@ -209,7 +209,9 @@ def main(argv=None):
print("[WARN] 烧录 rc={}(继续:板子可能已复位)".format(frc))
# 3) 采集 + 判读(含套件汇总行校验 T-2)
cmd = [py, str(RUN_BOOT), "--flash-cmd", "MDK-ARM\\download.bat"]
# 烧录统一走 stlink-flash skill(与 .serialtest/config.json 的 flash_cmd 同源)
flash_cmd = '"{}" "{}" flash'.format(py, STLINK_FLASH)
cmd = [py, str(RUN_BOOT), "--flash-cmd", flash_cmd]
if required:
cmd += ["--required", required]
if summary_name: