Files
STM32F4-Base/test/board
wandering1 74efa671bb feat(ioboard): wire 6 new CubeMX pins into 10-channel DO driver
Flat-expand the board output driver from 4 to 10 channels as decided:
IOBOARD_DO_COUNT 4->10, mask uint8_t->uint16_t, IOBOARD_DO_MASK_ALL
0x03FF.  The 6 new pins keep their bit positions: KO_LED1=PF2(bit4),
KO_LED2=PF3(bit5), KO_24V=PF4(bit6), KO4=PF5(bit7), KO5=PC15(bit8),
KO_LED3=PE6(bit9); the original 4 (KO6/TRIP/ERT/CLZ) keep bit0..3.
Backups-domain PC15 is used as a signal bit only (+/-3 mA limit).

No 24V supply interlock and no LED special-casing: the driver writes
KO_24V as an ordinary bit; callers needing relay power sequencing must
assert it before energizing a channel.  do_write/get/read_level and the
shadow register are all uint16_t; do_apply flushes four port segments
(GPIOC/GPIOF/GPIOC/GPIOE) and do_read_level caches three port ODRs.

UI: UI_DATA_DO_N 4->10, dio_do_mask uint16_t, UI_DATA_VER 3->4 because
dio_do_valid shifts 211->212; feed mask and dio row table extended;
content-page golden references regenerated for 51 rows / 7 pages.
Host ioboard tests 127/127 and ui_data tests 305/305 pass; Keil rebuild
0 errors 0 warnings.  RAM ledger, memory snapshot and size attestation
refilled from the authoritative map.  Docs: ioboard spec v1.2->v1.3 and
the resolved 6-pin question closed out.
2026-11-18 14:25:32 +08:00
..

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 15 / NET 层 Phase 611)
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

添加新测试套件

  1. 在 test_config.h 加开关(并入互斥 #error 检查)
  2. 新建 <模块>_test_task.c/h
  3. 注册进 Keil 工程(<FilePath>..\test\board\xxx.c</FilePath>)
  4. 跑回归:/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-suite skill(套件互斥、破坏性开关代价、跑后恢复产品构建)
  • 容量恢复:docs/测试说明/专项验证/存储维护与容量恢复.md