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
+1 -2
View File
@@ -10,8 +10,7 @@
| `STM32F407-Demo.uvprojx` | **Keil 工程文件**(源文件清单、编译选项、目标配置) |
| `STM32F407-Demo.uvoptx` | Keil 用户选项(调试器、断点等) |
| `startup_stm32f407xx.s` | 启动文件(**`Heap_Size EQU 0x200`(512B)在此限定**) |
| `download.bat` | 烧录(UV4 路径) |
| `reset.bat` | **复位/烧录**(`ST-LINK_CLI`,见下) |
| `reset.bat` | **复位/烧录/回读**(`ST-LINK_CLI` 封装,见下) |
## 构建与烧录
-45
View File
@@ -1,45 +0,0 @@
@echo off
setlocal
set PROJ=%~dp0STM32F407-Demo.uvprojx
set LOG=%~dp0download_log.txt
set TARGET=STM32F407-Demo
:: UV4 location: env var DTU_KEIL_UV4 = full path of UV4.exe (same contract
:: as keil_build.py (@build); required, no machine-default fallback).
if defined DTU_KEIL_UV4 goto uv4_set
echo DOWNLOAD_FAIL: environment variable DTU_KEIL_UV4 is not set
echo Set it to the full path of UV4.exe, e.g.:
echo [Environment]::SetEnvironmentVariable('DTU_KEIL_UV4', 'D:\Tools\Keil\UV4\UV4.exe', 'User')
exit /b 2
:uv4_set
if exist "%DTU_KEIL_UV4%" goto uv4_ok
echo ENV_ERROR: DTU_KEIL_UV4 is set but does not exist: "%DTU_KEIL_UV4%"
echo Fix the variable value. No fallback to another UV4 install is attempted.
exit /b 2
:uv4_ok
set UV4=%DTU_KEIL_UV4%
:: Remove stale log first: UV4 -o writes the log only when a download actually
:: runs. A leftover log would otherwise be misreported as this download's
:: result (same guard as keil_build.py).
if exist "%LOG%" del "%LOG%"
"%UV4%" -f "%PROJ%" -t%TARGET% -j0 -o "%LOG%"
if not exist "%LOG%" (
echo DOWNLOAD_FAIL: no download log produced - UV4 did not run or hung
exit /b 1
)
findstr /C:"Application running" "%LOG%" >nul
if %ERRORLEVEL% equ 0 (
echo DOWNLOAD_OK: flashed and running
exit /b 0
)
echo DOWNLOAD_FAIL: no application-running marker in log
type "%LOG%"
exit /b 1