e0b02d397c
待办池 docs/待处理内容.md §3.2 的 10 个 P2 全部闭环;逐项落代码 + 注释说明。 P2-1 cfg_file: 受管键行超 CFG_LINE_TEST_MAX 拒绝保存(防重复键行) P2-2 ch395f: DMA 失败传播状态 + 锁存通道故障 + 读不拷不可信数据 P2-7 net_select: LISTENING 不再恒判可读(消除 select 忙轮询地雷) P2-8 time_sync: 核实 L3 pending 改写已闭环(net_recv_to 分片 + 总预算) P2-9 sys_log: 挂载改幂等 + 卷锁,defaultTask 2s 重试建 /log P2-10 sys_log: s_read_raw 纳入卷锁 try(读者/写者 unlink 互斥) P2-11 net_task: RECONFIG 改 osEventFlagsWait 原子取走 + 清除 P2-12 app_cfg: APP_*_ENABLE 如实标注为未接线占位,删“开关”说法 P2-13 freertos: 产品构建 vTaskDelete(testTask) 回收 8KB CCM 栈 P2-15 download.bat: 先删旧日志 + 增“未产出日志”判定 P2-13 用 USER CODE 区回收而非生成区 #if 门控:生成区改动会被 CubeMX 重生成覆盖,本方案重生成不丢。P2-12 因产品定义 B0 未定、APP_NET_ENABLE 无单一接线点,按修复建议备选(删“开关”说法)处理。 验证:@build 0 错 0 警;主机单测 watchdog 39/39 + sys_clock 100/100 + cfg_file 149/149(新增 TC-CFG-044);pre-commit --all-files 17/17。
46 lines
1.3 KiB
Batchfile
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 build.bat; 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 build.bat).
|
|
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
|