fix(console): gate adcTask logs on console-writer readiness
B1 on-board closed loop surfaced a byte-level console interleave: before the console writer (defaultTask) registers, con_append() routes to dbg_console_write_raw() -> con_tx_bounded(), which is register-level polling with no mutual exclusion. adcTask logged every 1 ms, so its first-frame line collided with defaultTask's [NAND_FTL] init line and the required marker spanned two interleaved lines -> false FAIL. - console_log: add dbg_console_writer_ready() (returns s_con_writer_up) - adc_task: gate first-frame and 10 s stats logs on writer readiness; defer the first-frame report until the writer is up - docs: close B1/P1-1 in the registry; flip stale "remaining @test" notes; correct the console doc's obsolete "drop-only, no interleave" claim (that held for HAL gState, not register-level raw send) Bench (run_boot_test.py): VERDICT PASS, readback OK. adcTask frames/seq +10000 per 10 s = 1000 Hz, idle=0, frst_err=0; stack 496/2048 (75%). @build 0/0.
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
|
||||
## 关键点
|
||||
|
||||
- **首次转换在 `app_main_init` 末尾由 `tpafe5160_start_conv_irq` 启动**(中断驱动);**无周期重触发** → 现只采到一帧(登记簿 P1-1)
|
||||
- **首次转换在 `app_main_init` 末尾由 `tpafe5160_start_conv_irq` 启动**(中断驱动);**运行期周期重触发自 2026-10-10 起由 `adcTask` 接管**(每 1 ms,B1)
|
||||
- **取数只用 `tpafe5160_snapshot(int16_t *dst, uint8_t count)`**(**仅任务上下文**,内部临界区原子拷贝;返回 1=新帧 / 0=无新帧 / -1=参数无效)。配套的 `tpafe5160_frame_seq()` 给帧序号、`tpafe5160_frstdata_err()` 给"FRSTDATA 无跳变"帧计数
|
||||
- ⚠️ **不要用缓冲区指针取数**:旧的 `get_buf()` / `data_ready()` / `clear_ready()` 已于 2026-10-10 **删除**(审计 E-45 / E-58)——`get_buf` 只给指针、任务再逐通道拷,中间被 BUSY EXTI 抢占就拷回**两帧混合**数据;`s_ready` 电平标志在 `start_conv_irq` 里被清 0,等于**用重触发去丢帧**。现由**帧序号**(只增不清)+ **临界区快照**取代
|
||||
- **`tpafe5160_init()` 做首帧有效性自检**(E-44):完整跑一帧转换+读取,若整帧读下来 FRSTDATA **没有发生任何跳变**(芯片没在驱动并行总线;板上上拉会把它钉死为高)→ 返回 `TPAFE5160_FRSTDATA_ERR`(-3) 并打 `[ERR] Init FRSTDATA no-toggle`。判据刻意不锁死"哪个 RD 边沿拉高/拉低"(手册只给"RD 下降沿 → FRSTDATA 高/低"两个跳变,本板未实测边沿次序),只要求"一帧内必须跳变" → 既抓死芯片,也不会因极性假设错误误杀好芯片
|
||||
- 采样数据的消费者 `App/task/adc_task.c` **仍是空桩**(已挂进 `MDK-ARM/*.uvprojx`,尚未在 `Src/freertos.c` 建任务)
|
||||
- 采样数据的消费者 `App/task/adc_task.c` **已实现**(B1,2026-10-10:每 1 ms 触发 CONVST + `tpafe5160_snapshot()` 原子取数;`adcTask` 在 `Src/freertos.c` 的 `USER CODE` 区创建)
|
||||
- CONVST→BUSY→RD 三段时序对**建立/保持时间敏感**,改动需对照芯片手册
|
||||
- ⚠️ 本项目 ADC 相关功能**新增任务/缓冲前须核算 RAM**(见 `docs/内存管理/`);接消费者前的强制门禁见根 `AGENTS.md`「接 ADC / RS-485 消费者前的强制门禁」
|
||||
- ⚠️ **通道语义不是通道号**:`buf[i]` 对应哪个电气量必须查 `docs/硬件平台/ADC通道映射说明.md`(`buf[2]=IA`、`buf[5]=UN`、`buf[6]=UA`);V0.1 上 8 路电气量分属两片转换器属硬件缺陷(N-18)→ **禁止**跨转换器做相位/功率/功率因数类运算
|
||||
|
||||
Reference in New Issue
Block a user