6e0755f971
KO_24V (PF4, bit6) is not an externally controllable output: it feeds the other KO channels, so the driver now asserts it automatically whenever any relay-class channel (bit0/1/2/3/7/8) is attracted, and never for the three LED channels (bit4/5/9). Externally controllable outputs become 9; physical bit map, DO_COUNT=10, DO_MASK_ALL=0x03FF, k_do_pin[] binding, per-port BSRR segments and the uint16_t path are unchanged. - ioboard_do_write: clear the caller's bit6, synthesize it from IOBOARD_DO_RELAY_MASK (0x18F), then one shadow store + one apply, so bit6 changes in the same BSRR write as its GPIOF neighbours. - ioboard_do_get: bit6 now reports the actual 24V supply state, not an echo of the caller's write. Power-on release keeps PF4 low. - board test Phase 3 derives expectations from RELAY_MASK (no second truth table); the KO_24V row exercises "write ignored" and a new auto-24V check verifies set-on-relay / drop-on-release. - host contract test pins RELAY_MASK membership (excludes bit6 and LED bits, union fills 0x3FF); 131/131 passed. - docs: sync note v1.4 + BSP README unify the semantics (9 controllable + auto supply enable); stale "10 controllable" and "24V interlock not implemented" wording removed; netlist-unknown routing, PC15 backup-domain 3 mA limit and the missing auxiliary contact remain documented as open facts. Verified: Keil rebuild 0 error 0 warning (sizes identical to parent wave), host unit tests 131/131, check_bsp_err / check_doc_links / git diff --check clean. Board Phase 3 still needs a bench run.
test/board/ — 板端测试套件
⚠️ 编入固件的测试代码(由 testTask 执行)。这些
.c已注册到 Keil 工程MDK-ARM/STM32F4-Demo.uvprojx,占用 MCU 的 RAM/Flash。
文件一览
| 文件 | 测试对象 / 作用 |
|---|---|
test_config.c/h |
测试任务配置:TEST_SUITE_* 套件选择开关(互斥)+ ENABLE_DESTRUCTIVE_TESTS |
test_common.h |
公共断言内核:test_stats_t + TEST_CHECK_IMPL/TEST_REPORT_IMPL;各套件用一行宏绑定自身统计变量 |
ch395f_test_task.c/h + ch395f_test.h |
CH395F 以太网(硬件层 Phase 1 |
gd5f_test_task.c/h + gd5f_test.h |
GD5F2GQ5UE SPI NAND 存储 |
sd2506_test_task.c/h + sd2506_test.h |
SD2506 RTC |
storage_test_task.c/h + storage_test.h |
存储性能 |
net_test_task.c/h |
网络层测试 |
net_latency_test.c/h |
链路时延探针(DWT CYCCNT 时基,MCU 专属) |
⚠️ 构建约束(详见本节与 test_config.h)
- 套件互斥:
test_config.h的TEST_SUITE_CH395F/STORAGE/GD5F/RTC一次只能启用一个 (违反则#error);全部注释 = 产品构建 - ⚠️ 测试固件不得静默提交:
TEST_SUITE_*开关受 pre-commit 钩子test-suite-switch门禁——默认要求全部注释。跑完套件回归务必改回产品构建再提交(2026-10-01 实测已提交 HEAD 里TEST_SUITE_CH395F就是开启状态,纯靠人记得改;故补此门禁)。确需提交测试构建时用ALLOW_TEST_BUILD=1 git commit ...或python scripts/check_test_suite.py --allow-test-build显式放行 - 破坏性用例默认关闭:
ENABLE_DESTRUCTIVE_TESTS(默认注释)控制写/擦 NAND、格式化、 坏块注入。关闭时为只读模式(横幅mode: READ-ONLY),可随时在在用设备上跑 - ⚠️ 实测一轮破坏性 GD5F 运行即让 dhara 多记一个坏块(容量下降且需全片擦除恢复)—— 只在产线首启或明确需要时打开
- CH395F 套件:硬件层与 NET 层模式互斥
- 总线独占:CH395F 硬件层模式下 netTask 自挂起,testTask 独占 CH395F
添加新测试套件
- 在
test_config.h加开关(并入互斥#error检查) - 新建
<模块>_test_task.c/h - 注册进 Keil 工程(
<FilePath>..\test\board\xxx.c</FilePath>) - 跑回归:
/serial-boot-test(.dsh/skills/serial-boot-test/scripts/run_boot_test.py)
相关文档
- 测试指南:
docs/测试说明/板级测试/CH395F_Test_Guide.md、GD5F2GQ5UE_Test_Guide.md、SD2506_Test_Guide.md、FTP_Test_Guide.md - 套件配置:本节「构建约束」+
board-test-suiteskill(套件互斥、破坏性开关代价、跑后恢复产品构建) - 容量恢复:
docs/测试说明/专项验证/存储维护与容量恢复.md