测试闭环补固件身份戳、烧录回读校验与启动锚点计数,并修cmd引号解析与flash-cmd预检缺陷

This commit is contained in:
2026-10-10 02:54:33 +08:00
parent b37fdea21b
commit fccf99bc90
8 changed files with 261 additions and 23 deletions
+15
View File
@@ -40,6 +40,7 @@ if /i "%~1"=="halt" goto :halt
if /i "%~1"=="run" goto :run
if /i "%~1"=="list" goto :list
if /i "%~1"=="flash" goto :flash
if /i "%~1"=="cmp" goto :cmp
goto :help
:reset_run
@@ -80,6 +81,18 @@ echo FLASH: program "%FW%" then reset and run
"%STLINK%" -c SWD -P "%FW%" -Rst -Run -Q
exit /b %ERRORLEVEL%
:cmp
if "%~2"=="" set "FW=%~dp0STM32F407-Demo\STM32F407-Demo.hex"
if not "%~2"=="" set "FW=%~2"
if not exist "%FW%" (
echo CMP_FAIL: firmware not found "%FW%"
exit /b 2
)
echo CMP: readback compare "%FW%" vs device flash
echo CMP_NOTE: connecting resets the target - run this AFTER log capture, not before
"%STLINK%" -c SWD -CmpFile "%FW%" 0x08000000
exit /b %ERRORLEVEL%
:help
echo Usage: reset.bat [command]
echo.
@@ -89,6 +102,8 @@ echo halt System reset and halt core (in-session read; auto-resumes after
echo run Resume a halted core
echo list List connected ST-LINK probes
echo flash [F] Program F (default: latest build hex) then reset and run
echo cmp [F] Readback compare F vs device flash; "No difference found" = write landed
echo (connecting resets the target: run it after log capture, not before)
echo.
echo Exit codes: 0=OK 1=probe or target error 2=usage or tool missing