refactor(net): 挂起 recv 模型拆出 net_pending.c/h + 留痕探针编译门控 + E15 归因修正
CI / L0 静态门禁 (pre-commit) (push) Failing after 2m14s
CI / L0.5 主机侧单测 (MSVC) (push) Successful in 22s

- E15 归因修正:幽灵状态 0x04+旧端口 = 芯片如实报告拆除中的旧连接
  (文档化行为,非芯片故障;bit3=1 为我方设置(ver>=0x46)、
  RFC 9293 §3.3.2 Fig5 拆除顺序、WCH 官方博客方案 = close 完成后重开监听)
- 术语统一:全库"了结"→"结束"(约 45 处);阻塞模型 §4 首次出现处定义"五路"
- 注释清理:删孤儿函数头注释、考古叙事改现在时、去不可检索内部编码"L3"
  (33 处 6 文件)、banner 去重(唯一理由移到分支现场)
- 挂起超时留痕探针:编译期开关 NET_PENDING_TRIPWIRE(默认 0 = 编译剔除,
  省约 150B Flash;排查调用方挂死时置 1,只留痕绝不强制结束)
- 拆模块:net_pending.c/h(363/94 行)承载挂起 recv 模型,
  net_socket.c 4059→3661 行;tick 收控制块表参数、settle_close 双参显式传;
  net_pending_active 声明移配对头(S17 2.2);仅注册 uvprojx +
  check_registration MCU-only 白名单(同 net_listener.c 机制,
  模拟器走 net_socket_sim.c 按外部语义模拟)
- 文档:阻塞模型新增全过程小节(单主干流程图)+ §9 排查辅助;
  NET README / 函数调用关系 / 自愈架构 / BSD 指南同步;引用关系图重生成
- 台架回归:启动闭环 PASS([ERR]/Fault 零命中、回读一致)、
  :7003 重连探针 10/10、FTP 50 连接 STOR 50/50、回归窗口串口日志无异常
- RAM:ER_IROM1 230004B(探针门控后约 -150B),台账已回填
This commit is contained in:
2026-10-14 09:53:38 +08:00
parent a12367981d
commit df13dec479
30 changed files with 3396 additions and 2993 deletions
+2 -2
View File
@@ -48,7 +48,7 @@
<text x="566.0" y="472.0" font-size="11" fill="#64748b">刷新 readable</text>
<rect x="758.5" y="434.0" width="190.5" height="46" rx="8" fill="#ffffff" stroke="#d97706" stroke-opacity="0.6"/>
<text x="768.5" y="454.0" font-size="12.5" font-weight="700" fill="#d97706">net_pending_tick()</text>
<text x="768.5" y="472.0" font-size="11" fill="#64748b">了结挂起</text>
<text x="768.5" y="472.0" font-size="11" fill="#64748b">结束挂起</text>
<rect x="961.0" y="434.0" width="190.5" height="46" rx="8" fill="#ffffff" stroke="#7c3aed" stroke-opacity="0.6"/>
<text x="971.0" y="454.0" font-size="12.5" font-weight="700" fill="#7c3aed">net_listener_retry_tick()</text>
<text x="971.0" y="472.0" font-size="11" fill="#64748b">重试对账</text>
@@ -74,7 +74,7 @@
<text x="66" y="940.0" font-size="14" font-weight="700" fill="#dc2626">⑤</text>
<text x="96" y="940.0" font-size="12.5" font-weight="700" fill="#0f172a">网络重建(芯片复位)</text>
<text x="270" y="940.0" font-size="12.5" fill="#475569">→ 取消 + 必须通知(否则调用方永久挂死)</text>
<text x="96" y="969" font-size="12" font-weight="700" fill="#dc2626">看门狗:到点后 1s 仍未了结 = 完成逻辑缺位 → 强制了结 + DBG_ERROR</text>
<text x="96" y="969" font-size="12" font-weight="700" fill="#dc2626">挂起超时留痕探针(编译期选项,默认关):挂起超阈值仍未结束 → 只 DBG_ERROR 留痕(不强制结束、不伪造返回值)</text>
<rect x="1120" y="812" width="250" height="62" rx="10" fill="#eff6ff" stroke="#2563eb" stroke-opacity="0.55" stroke-width="1.6"/>
<text x="1134" y="838" font-size="13.5" font-weight="700" fill="#2563eb">xTaskNotify</text>
<text x="1134" y="858" font-size="11.5" fill="#64748b">唤醒调用方(结果 = 字节数 / 负错误码)</text>

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

+17
View File
@@ -77,6 +77,8 @@ digraph refgraph_full {
"Drivers/BSP/NET/net_config.h" [fillcolor="#dbeafe", color="#1d4ed8"];
"Drivers/BSP/NET/net_listener.c" [fillcolor="#dbeafe", color="#1d4ed8"];
"Drivers/BSP/NET/net_listener.h" [fillcolor="#dbeafe", color="#1d4ed8"];
"Drivers/BSP/NET/net_pending.c" [fillcolor="#dbeafe", color="#1d4ed8"];
"Drivers/BSP/NET/net_pending.h" [fillcolor="#dbeafe", color="#1d4ed8"];
"Drivers/BSP/NET/net_select.c" [fillcolor="#dbeafe", color="#1d4ed8"];
"Drivers/BSP/NET/net_select.h" [fillcolor="#dbeafe", color="#1d4ed8"];
"Drivers/BSP/NET/net_socket.c" [fillcolor="#dbeafe", color="#1d4ed8"];
@@ -505,6 +507,20 @@ digraph refgraph_full {
"Drivers/BSP/NET/net_listener.c" -> "test/board/test_config.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_listener.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
"Drivers/BSP/NET/net_listener.h" -> "Drivers/BSP/NET/net_types.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Drivers/BSP/CH395F/ch395f.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Drivers/BSP/NET/net_listener.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Drivers/BSP/NET/net_pending.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Drivers/BSP/NET/net_socket.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Drivers/BSP/NET/net_types.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Inc/main.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
"Drivers/BSP/NET/net_pending.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/task.h" [color="#94a3b8", penwidth=0.7];
"Drivers/BSP/NET/net_pending.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
"Drivers/BSP/NET/net_pending.h" -> "Drivers/BSP/NET/net_types.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_pending.h" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
"Drivers/BSP/NET/net_pending.h" -> "Middlewares/Third_Party/FreeRTOS/Source/include/task.h" [color="#94a3b8", penwidth=0.7];
"Drivers/BSP/NET/net_pending.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
"Drivers/BSP/NET/net_select.c" -> "Drivers/BSP/CH395F/ch395f.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_select.c" -> "Drivers/BSP/NET/net_select.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_select.c" -> "Drivers/BSP/NET/net_socket.h" [color="#2563eb", penwidth=1.0];
@@ -517,6 +533,7 @@ digraph refgraph_full {
"Drivers/BSP/NET/net_select.h" -> "Drivers/BSP/NET/net_types.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_socket.c" -> "Drivers/BSP/CH395F/ch395f.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_socket.c" -> "Drivers/BSP/NET/net_listener.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_socket.c" -> "Drivers/BSP/NET/net_pending.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_socket.c" -> "Drivers/BSP/NET/net_socket.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_socket.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
"Drivers/BSP/NET/net_socket.c" -> "Inc/main.h" [color="#2563eb", penwidth=1.0];
+109 -5
View File
@@ -341,6 +341,14 @@
"path": "Drivers/BSP/NET/net_listener.h",
"class": "fp"
},
{
"path": "Drivers/BSP/NET/net_pending.c",
"class": "fp"
},
{
"path": "Drivers/BSP/NET/net_pending.h",
"class": "fp"
},
{
"path": "Drivers/BSP/NET/net_select.c",
"class": "fp"
@@ -7619,6 +7627,90 @@
"kind": "fp-fp",
"include": "net_types.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "外部/系统头文件",
"kind": "fp-ext",
"include": "stddef.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h",
"kind": "fp-tp",
"include": "FreeRTOS.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/task.h",
"kind": "fp-tp",
"include": "task.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Drivers/BSP/NET/net_types.h",
"kind": "fp-fp",
"include": "net_types.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Drivers/BSP/NET/net_socket.h",
"kind": "fp-fp",
"include": "net_socket.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Drivers/BSP/NET/net_pending.h",
"kind": "fp-fp",
"include": "net_pending.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Drivers/BSP/NET/net_listener.h",
"kind": "fp-fp",
"include": "net_listener.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Drivers/BSP/CH395F/ch395f.h",
"kind": "fp-fp",
"include": "ch395f.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Drivers/BSP/dbg_log.h",
"kind": "fp-fp",
"include": "dbg_log.h"
},
{
"from": "Drivers/BSP/NET/net_pending.c",
"to": "Inc/main.h",
"kind": "fp-fp",
"include": "main.h"
},
{
"from": "Drivers/BSP/NET/net_pending.h",
"to": "外部/系统头文件",
"kind": "fp-ext",
"include": "stdint.h"
},
{
"from": "Drivers/BSP/NET/net_pending.h",
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h",
"kind": "fp-tp",
"include": "FreeRTOS.h"
},
{
"from": "Drivers/BSP/NET/net_pending.h",
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/task.h",
"kind": "fp-tp",
"include": "task.h"
},
{
"from": "Drivers/BSP/NET/net_pending.h",
"to": "Drivers/BSP/NET/net_types.h",
"kind": "fp-fp",
"include": "net_types.h"
},
{
"from": "Drivers/BSP/NET/net_select.c",
"to": "外部/系统头文件",
@@ -7733,6 +7825,12 @@
"kind": "fp-fp",
"include": "net_listener.h"
},
{
"from": "Drivers/BSP/NET/net_socket.c",
"to": "Drivers/BSP/NET/net_pending.h",
"kind": "fp-fp",
"include": "net_pending.h"
},
{
"from": "Drivers/BSP/NET/net_socket.c",
"to": "Drivers/BSP/CH395F/ch395f.h",
@@ -41763,6 +41861,12 @@
"stdbool.h",
"string.h"
],
"Drivers/BSP/NET/net_pending.c": [
"stddef.h"
],
"Drivers/BSP/NET/net_pending.h": [
"stdint.h"
],
"Drivers/BSP/NET/net_select.c": [
"stdio.h",
"string.h"
@@ -43501,11 +43605,11 @@
]
},
"stats": {
"files_indexed": 1491,
"includes_parsed": 5939,
"resolved": 4792,
"unresolved": 1147,
"nodes_fp": 211,
"files_indexed": 1493,
"includes_parsed": 5954,
"resolved": 4805,
"unresolved": 1149,
"nodes_fp": 213,
"nodes_tp": 1266,
"ext_names": 351
},
File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 506 KiB

After

Width:  |  Height:  |  Size: 512 KiB

+5 -5
View File
@@ -82,12 +82,12 @@ digraph refgraph_module {
"BSP/GD5F2GQ5UE" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×1"];
"BSP/GD5F2GQ5UE" -> "dhara" [color="#2563eb", penwidth=1.2, label="×2"];
"BSP/GD5F2GQ5UE" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×4"];
"BSP/NET" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×2"];
"BSP/NET" -> "BSP/CH395F" [color="#2563eb", penwidth=1.2, label="×3"];
"BSP/NET" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×11"];
"BSP/NET" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×3"];
"BSP/NET" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×3"];
"BSP/NET" -> "BSP/CH395F" [color="#2563eb", penwidth=1.2, label="×4"];
"BSP/NET" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×15"];
"BSP/NET" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×4"];
"BSP/NET" -> "test" [color="#2563eb", penwidth=1.2, label="×4"];
"BSP/NET" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×4"];
"BSP/NET" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×6"];
"BSP/NETCFG" -> "App" [color="#2563eb", penwidth=1.2, label="×2"];
"BSP/NETCFG" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×1"];
"BSP/NETCFG" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×4"];
+5 -5
View File
@@ -513,28 +513,28 @@
<title>BSP/NET&#45;&gt;BSP(公共)</title>
<path fill="none" stroke="#2563eb" stroke-width="1.2" d="M1366.53,-1486.55C1371.67,-1482.5 1376.67,-1477.93 1380.75,-1473 1392.66,-1458.6 1385.78,-1448.45 1398.75,-1435 1417.52,-1415.54 1429.05,-1420 1452.75,-1407 1500.15,-1380.99 1523.25,-1387.42 1558,-1346 1607.98,-1286.42 1639.96,-1044.77 1649.85,-959.76"/>
<polygon fill="#2563eb" stroke="#2563eb" stroke-width="1.2" points="1653.31,-960.31 1650.97,-949.97 1646.36,-959.51 1653.31,-960.31"/>
<text xml:space="preserve" text-anchor="middle" x="1514.38" y="-1402.27" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×2</text>
<text xml:space="preserve" text-anchor="middle" x="1514.38" y="-1402.27" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×3</text>
</g>
<!-- BSP/NET&#45;&gt;BSP/CH395F -->
<g id="edge56" class="edge">
<title>BSP/NET&#45;&gt;BSP/CH395F</title>
<path fill="none" stroke="#2563eb" stroke-width="1.2" d="M1368.34,-1486.5C1373.07,-1482.56 1377.45,-1478.04 1380.75,-1473 1400.78,-1442.42 1375.3,-1420.79 1398.75,-1392.75 1415.45,-1372.77 1430.53,-1383.59 1452.75,-1370 1464.34,-1362.91 1476.01,-1353.7 1485.97,-1345.06"/>
<polygon fill="#2563eb" stroke="#2563eb" stroke-width="1.2" points="1488.11,-1347.85 1493.24,-1338.57 1483.45,-1342.62 1488.11,-1347.85"/>
<text xml:space="preserve" text-anchor="middle" x="1425.75" y="-1397.5" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×3</text>
<text xml:space="preserve" text-anchor="middle" x="1425.75" y="-1397.5" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×4</text>
</g>
<!-- BSP/NET&#45;&gt;FreeRTOS -->
<g id="edge57" class="edge">
<title>BSP/NET&#45;&gt;FreeRTOS</title>
<path fill="none" stroke="#2563eb" stroke-width="1.2" d="M1349.64,-1523.41C1371.83,-1556.12 1418.69,-1626.84 1452.75,-1689.75 1471.36,-1724.13 1489.77,-1765.26 1501.33,-1792.2"/>
<polygon fill="#2563eb" stroke="#2563eb" stroke-width="1.2" points="1498,-1793.31 1505.13,-1801.14 1504.44,-1790.57 1498,-1793.31"/>
<text xml:space="preserve" text-anchor="middle" x="1425.75" y="-1694.5" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×11</text>
<text xml:space="preserve" text-anchor="middle" x="1425.75" y="-1694.5" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×15</text>
</g>
<!-- BSP/NET&#45;&gt;Src/Inc (CubeMX) -->
<g id="edge58" class="edge">
<title>BSP/NET&#45;&gt;Src/Inc (CubeMX)</title>
<path fill="none" stroke="#2563eb" stroke-width="1.2" d="M1329.66,-1523.2C1315.28,-1572.05 1276.62,-1702.66 1273.25,-1706 1264.72,-1714.47 870.58,-1827.86 858.75,-1830 813.65,-1838.17 762.2,-1841.67 722,-1843.13"/>
<polygon fill="#2563eb" stroke="#2563eb" stroke-width="1.2" points="722.14,-1839.63 712.26,-1843.45 722.37,-1846.62 722.14,-1839.63"/>
<text xml:space="preserve" text-anchor="middle" x="982" y="-1802.03" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×3</text>
<text xml:space="preserve" text-anchor="middle" x="982" y="-1802.03" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×4</text>
</g>
<!-- BSP/NET&#45;&gt;test -->
<g id="edge59" class="edge">
@@ -548,7 +548,7 @@
<title>BSP/NET&#45;&gt;外部/系统头文件</title>
<path fill="none" stroke="#94a3b8" stroke-width="0.7" d="M1369.51,-1508.86C1459.7,-1519.56 1714.78,-1549.82 1843.01,-1565.03"/>
<polygon fill="#94a3b8" stroke="#94a3b8" stroke-width="0.7" points="1842.5,-1568.5 1852.84,-1566.2 1843.32,-1561.55 1842.5,-1568.5"/>
<text xml:space="preserve" text-anchor="middle" x="1654.12" y="-1550.91" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×4</text>
<text xml:space="preserve" text-anchor="middle" x="1654.12" y="-1550.91" font-family="Microsoft YaHei" font-size="10.00" fill="#334155">×6</text>
</g>
<!-- BSP/NETCFG&#45;&gt;App -->
<g id="edge61" class="edge">

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB