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
+18
View File
@@ -26,6 +26,11 @@
* 都换成 DWT 周期计数硬上界(DWT 使能失败时退回旧 HAL 行为)。
* 另加 USART1 未初始化(huart1.Instance == NULL)短路:防止在
* HAL_Init 早期/断言-故障上报路径上解引用 NULL 读写地址 0。
* 2026-10-10 王建锋 新增 dbg_console_writer_ready() 查询:写者未注册时
* con_append 走无锁直发(前提是"此窗口只有 defaultTask 记日志"),
* adcTask(B1)等周期任务此时落日志会与 defaultTask 的存储初始化
* 日志字节级交错(台架实测 [ADC_TASK] 首帧行与 [NAND_FTL] 行交错)。
* 提供就绪查询供周期任务门控自身日志,不改直发路径本身。
*/
#include "console_log.h"
@@ -223,6 +228,19 @@ void dbg_console_writer_attach(void) {
s_con_writer_up = 1U;
}
/*
* 函数功能:查询控制台写者是否已注册(1=已注册,此后日志走环形缓冲行级原子路径)
* 返回值:s_con_writer_up(volatile 读,任意任务上下文可调)
* 限定条件:无
* 函数说明:供**周期性任务**在写者就绪前抑制自身日志。写者未注册时 con_append 走
* dbg_console_write_raw 无锁直发(设计前提是"此窗口只有 defaultTask 记日志"),
* 其余任务此时落日志会与 defaultTask 的存储初始化日志逐字节交错
* (2026-10-10 台架:adcTask 首帧日志与 [NAND_FTL] 初始化行交错)。
*/
uint8_t dbg_console_writer_ready(void) {
return s_con_writer_up;
}
/*
* 函数功能:USART1 僵尸通道自愈(清错误锁存 + 整外设重初始化)
* 函数说明:RX 悬空噪声(PA10 未接线)锁存的 ORE/NE/FE/PE 使 HAL 轮询 TX 恒快速失败