修复 P2 全部 10 项:错误传播/竞态/门控/文档失真

待办池 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。
This commit is contained in:
2026-10-04 08:30:30 +08:00
parent 13eeba944b
commit e0b02d397c
16 changed files with 332 additions and 93 deletions
+10
View File
@@ -22,8 +22,18 @@ 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