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:
2026-10-10 14:53:36 +08:00
parent 7c4b724057
commit da66c500ea
12 changed files with 103 additions and 68 deletions
+5
View File
@@ -34,6 +34,10 @@ extern "C" {
* DBG_PRINT 宏内用库 snprintf 完成)
* dbg_console_write_raw - 异常/早期路径:有界单次直发(不加锁)
* dbg_console_writer_attach- 写者任务(defaultTask)注册自己为唯一发送者
* dbg_console_writer_ready - 写者是否已注册(1=已注册)。供**周期性任务**在写者就绪前
* 抑制日志用:写者未注册时 con_append 走无锁直发路径
* (仅假设 defaultTask 在日志),其余任务此时落日志会与
* defaultTask 的存储初始化日志字节级交错(2026-10-10 台架实测)
* dbg_console_drain - 写者任务排空缓冲并发送(单次有界;TX 失败自动软复位自愈)
* dbg_console_dropped - 因缓冲满丢弃的行数(诊断)
* dbg_console_tx_fault - 因僵尸通道软复位自愈的次数(诊断)
@@ -47,6 +51,7 @@ extern "C" {
int dbg_console_write_line(const char *line, unsigned len);
void dbg_console_write_raw(const char *buf, unsigned len);
void dbg_console_writer_attach(void);
uint8_t dbg_console_writer_ready(void);
void dbg_console_drain(void);
uint32_t dbg_console_dropped(void);
uint32_t dbg_console_tx_fault(void);