Files
STM32F4-Base/MDK-ARM/download.bat
T
wandering1 c77c5824f9 build: 删除 MDK-ARM/build.bat,@build 完全收敛到 keil-build skill
- test/run_all_suites.py 是唯一真正执行它的地方:BUILD_BAT 常量改为
  KEIL_BUILD(.dsh/skills/keil-build/scripts/keil_build.py);两处构建点
  改传 --timeout(脚本内超时先于 _run 超时触发,超时得 rc=1 + BUILD_FAIL
  文案,而不是被 _run 杀掉)
- AGENTS.md / keil-build SKILL.md / new-machine-setup SKILL.md:删除
  "等价原生入口"口径,改为注明该文件已于 2026-10-10 删除
- 环境与部署 3 篇 / 项目架构总览 / README / MDK-ARM/README /
  download.bat 注释 / check_mem_numbers.py 提示串:移除 build.bat 引用
- 刻意未改:docs/问题记录/项目审查与优化建议报告.md 的 P2-14 / N-18
  (历史审计条目;doc-links 不校验裸文件名,保留不影响门禁)
- 验证:keil_build.py --timeout 300 -> BUILD_OK / rc=0;
  run_all_suites.py --dry-run 正确解析 skill 路径;doc-links 123 文档通过
2026-10-10 16:23:54 +08:00

46 lines
1.3 KiB
Batchfile

@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