diag(ui/wave): 枚举扫描诊断留痕第二组(临时构建,随根因修复收敛)
第一组埋点烧后开回放页串口零留痕(既无 FR 失败也无零条目 行),剩余唯一静默分支 = try 闸取锁失败直接返回/扫描成功但有条目 不打印/段头与窗口读取失败不打印。本组补齐: - scan:每次尝试编号 #N;try 闸失败行带 vol_lock_get_stats 计数(消费方 观测,不取锁,符合看门狗设计说明 §4.3 口径);完成行改为无条件打印 cnt/np/tt/ac(排除「成功但页面仍空」歧义) - load_head / seg_win:try 闸、路径构造、开档 FR 码与读失败出口全部留痕 临时诊断构建,判性后随根因修复收敛到最小永久集。 /keil-build 0 错误 0 警告(Code +604 B,RAM 不变)。 Refs #38
This commit is contained in:
+45
-9
@@ -423,6 +423,8 @@ static const ui_soe_reader_t s_soe_reader = { ui_task_soe_count, ui_task_soe_get
|
||||
static uint8_t s_wave_idx[WAVE_ST_SEG_MAX]; /* 盘上现存段号升序表 */
|
||||
static uint8_t s_wave_cnt; /* 表内条数 */
|
||||
static uint8_t s_wave_scanned; /* 表是否有效(manual_req 后作废) */
|
||||
static uint8_t s_wave_dbg_seq; /* 诊断留痕(第一幕第二组):本 boot
|
||||
* 扫描尝试序号,供各行对齐 */
|
||||
static uint8_t s_wave_cached_idx; /* 段头缓存属于哪一段 */
|
||||
static uint8_t s_wave_cache_ok; /* 该段已验完整(头+数据 CRC) */
|
||||
static wave_seg_meta_t s_wave_meta; /* 已验段的头(172B,唯一驻留) */
|
||||
@@ -459,7 +461,15 @@ static int ui_task_wave_scan(void) {
|
||||
uint8_t i;
|
||||
uint8_t full; /* 1 = 本轮拿到完整事实,允许钉表 */
|
||||
|
||||
s_wave_dbg_seq++; /* 诊断留痕(第一幕第二组):每次尝试一个序号 */
|
||||
if (vol_lock_wait(0u) == 0u) {
|
||||
/* try 闸此前无任何留痕(看门狗设计说明 §4.3 只禁「锁层自身」打日志——
|
||||
* 这里是消费方的一次性观测,计数走不取锁的 vol_lock_get_stats) */
|
||||
vol_lock_stats_t vs;
|
||||
vol_lock_get_stats(&vs);
|
||||
DBG_ERROR("ui wave scan #%u try fail tt=%lu ac=%lu fo=%lu",
|
||||
(unsigned)s_wave_dbg_seq, (unsigned long)vs.try_timeout,
|
||||
(unsigned long)vs.acquired, (unsigned long)vs.failopen);
|
||||
return -1;
|
||||
}
|
||||
s_wave_cnt = 0u;
|
||||
@@ -487,22 +497,29 @@ static int ui_task_wave_scan(void) {
|
||||
}
|
||||
(void)f_closedir(&dir);
|
||||
if (full == 0u) {
|
||||
DBG_ERROR("ui wave scan readdir fail fr=%d got=%u", (int)rr,
|
||||
(unsigned)s_wave_cnt);
|
||||
DBG_ERROR("ui wave scan #%u readdir fail fr=%d got=%u",
|
||||
(unsigned)s_wave_dbg_seq, (int)rr, (unsigned)s_wave_cnt);
|
||||
}
|
||||
} else if (fr == FR_NO_PATH) {
|
||||
full = 1u; /* 从未录过波 = 0 段,完整事实 */
|
||||
} else {
|
||||
DBG_ERROR("ui wave scan opendir fail fr=%d", (int)fr);
|
||||
DBG_ERROR("ui wave scan #%u opendir fail fr=%d", (unsigned)s_wave_dbg_seq,
|
||||
(int)fr);
|
||||
}
|
||||
vol_lock_release();
|
||||
if (full == 0u) {
|
||||
s_wave_cnt = 0u; /* 半截计数不外泄:本轮按「无段」显示 */
|
||||
return -1;
|
||||
}
|
||||
if (s_wave_cnt == 0u) {
|
||||
/* 判读表第三条(FR_OK 但零条目):钉盘级证据,供板级远程定性 */
|
||||
DBG_INFO("ui wave scan done: dir ok, 0 seg entries");
|
||||
{
|
||||
/* 判读表补全(诊断):每一次完成扫描都留一行(含非零条目——
|
||||
* 「扫描成功但页面仍空」也要能被排除),随根因修复收敛删减 */
|
||||
vol_lock_stats_t vs;
|
||||
vol_lock_get_stats(&vs);
|
||||
DBG_INFO("ui wave scan #%u done cnt=%u np=%d tt=%lu ac=%lu",
|
||||
(unsigned)s_wave_dbg_seq, (unsigned)s_wave_cnt,
|
||||
(fr == FR_NO_PATH) ? 1 : 0, (unsigned long)vs.try_timeout,
|
||||
(unsigned long)vs.acquired);
|
||||
}
|
||||
/* 插入排序:条数上限 100,不引 qsort 的 stdlib 依赖 */
|
||||
for (i = 1u; i < s_wave_cnt; i++) {
|
||||
@@ -572,7 +589,8 @@ static int ui_task_wave_load_head(uint8_t a_idx) {
|
||||
static FIL f; /* static:FIL = 528B,理由同 soe_store_read */
|
||||
char path[WAVE_ST_PATH_MAX]; /* 容量 = WAVE_ST_PATH_MAX(17 字节口径,
|
||||
* 自己声明路径缓冲不得写死 16) */
|
||||
FRESULT fr;
|
||||
FRESULT fr = FR_OK; /* 诊断留痕可能未走到任何 f_read 就读它 */
|
||||
FRESULT ofr = FR_OK; /* 诊断留痕(第一幕第二组):开档 FR 码 */
|
||||
UINT br = 0u;
|
||||
int rc;
|
||||
|
||||
@@ -580,13 +598,18 @@ static int ui_task_wave_load_head(uint8_t a_idx) {
|
||||
return UI_WAVE_OK;
|
||||
}
|
||||
if (wave_store_seg_path(path, (uint32_t)sizeof(path), a_idx) != 0) {
|
||||
DBG_ERROR("ui wave head #%u path fail idx=%u", (unsigned)s_wave_dbg_seq,
|
||||
(unsigned)a_idx);
|
||||
return UI_WAVE_NONE;
|
||||
}
|
||||
if (vol_lock_wait(0u) == 0u) {
|
||||
DBG_ERROR("ui wave head #%u try fail idx=%u", (unsigned)s_wave_dbg_seq,
|
||||
(unsigned)a_idx);
|
||||
return UI_WAVE_NONE; /* 卷忙 = 本轮按无段处理(不阻塞 uiTask) */
|
||||
}
|
||||
rc = UI_WAVE_NONE;
|
||||
if (f_open(&f, path, FA_READ) == FR_OK) {
|
||||
ofr = f_open(&f, path, FA_READ);
|
||||
if (ofr == FR_OK) {
|
||||
uint32_t size;
|
||||
uint32_t total;
|
||||
uint32_t n;
|
||||
@@ -644,6 +667,9 @@ static int ui_task_wave_load_head(uint8_t a_idx) {
|
||||
s_wave_cache_ok = 1u;
|
||||
} else {
|
||||
s_wave_cache_ok = 0u;
|
||||
DBG_ERROR("ui wave head #%u rc=%d idx=%u ofr=%d fr=%d br=%u",
|
||||
(unsigned)s_wave_dbg_seq, rc, (unsigned)a_idx, (int)ofr,
|
||||
(int)fr, (unsigned)br);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -785,6 +811,7 @@ static int ui_task_wave_seg_win(uint8_t a_idx, uint8_t a_ch,
|
||||
int16_t *a_codes, int32_t *a_peak_milli) {
|
||||
static FIL f;
|
||||
char path[WAVE_ST_PATH_MAX];
|
||||
FRESULT fr = FR_OK; /* 诊断留痕(第一幕第二组):开档 FR 码 */
|
||||
UINT br = 0u;
|
||||
uint32_t off;
|
||||
uint32_t want;
|
||||
@@ -816,13 +843,18 @@ static int ui_task_wave_seg_win(uint8_t a_idx, uint8_t a_ch,
|
||||
return UI_WAVE_BAD; /* 窗口贴不出完整 40 点:显式不可读 */
|
||||
}
|
||||
if (wave_store_seg_path(path, (uint32_t)sizeof(path), a_idx) != 0) {
|
||||
DBG_ERROR("ui wave win #%u path fail idx=%u", (unsigned)s_wave_dbg_seq,
|
||||
(unsigned)a_idx);
|
||||
return UI_WAVE_NONE;
|
||||
}
|
||||
if (vol_lock_wait(0u) == 0u) {
|
||||
DBG_ERROR("ui wave win #%u try fail idx=%u ch=%u", (unsigned)s_wave_dbg_seq,
|
||||
(unsigned)a_idx, (unsigned)a_ch);
|
||||
return UI_WAVE_NONE;
|
||||
}
|
||||
rc = UI_WAVE_BAD;
|
||||
if (f_open(&f, path, FA_READ) == FR_OK) {
|
||||
fr = f_open(&f, path, FA_READ);
|
||||
if (fr == FR_OK) {
|
||||
if ((f_lseek(&f, off) == FR_OK) &&
|
||||
(f_read(&f, s_wave_buf, want, &br) == FR_OK) && (br == want)) {
|
||||
if ((wave_store_le_decode(s_wave_buf, want, raw, UI_WAVE_WIN_PTS,
|
||||
@@ -863,6 +895,10 @@ static int ui_task_wave_seg_win(uint8_t a_idx, uint8_t a_ch,
|
||||
}
|
||||
}
|
||||
*a_peak_milli = peak;
|
||||
} else {
|
||||
DBG_ERROR("ui wave win #%u rc=%d idx=%u ch=%u ofr=%d br=%u",
|
||||
(unsigned)s_wave_dbg_seq, rc, (unsigned)a_idx, (unsigned)a_ch,
|
||||
(int)fr, (unsigned)br);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ dhara 失败类 +84;RO 另 +208,全是该失败类名表)→ `ER_IROM1`
|
||||
<!-- MEM_SNAPSHOT:BEGIN generated by scripts/check_mem_numbers.py -->
|
||||
| 区域 | 用量 | 容量 | 占比 |
|
||||
|---|---|---|---|
|
||||
| ER_IROM1 | 276,884 B (270.39 KB) | 1,048,576 B (1024 KB) | 26.4% |
|
||||
| ER_IROM1 | 277,768 B (271.26 KB) | 1,048,576 B (1024 KB) | 26.5% |
|
||||
| RW_IRAM1 | 94,336 B (92.12 KB) | 131,072 B (128 KB) | 72.0% |
|
||||
| RW_CCM | 57,376 B (56.03 KB) | 65,280 B (64 KB) | 87.9% |
|
||||
| **Flash (ROM 合计)** | **278,936 B (272.4 KB)** | 1,048,576 B (1024 KB) | **26.6%** |
|
||||
| **Flash (ROM 合计)** | **279,820 B (273.3 KB)** | 1,048,576 B (1024 KB) | **26.7%** |
|
||||
<!-- MEM_SNAPSHOT:END -->
|
||||
|
||||
各区的容量与常量来源:
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<!-- MEM_BUDGET:BEGIN generated by scripts/ram_baseline.py -->
|
||||
| 区域 | 用量 | 容量 | 占比 | 门禁(≤92%) |
|
||||
|---|---|---|---|---|
|
||||
| ER_IROM1 (Flash) | 276,884 B | 1,048,576 B | 26.4% | 参考 |
|
||||
| ER_IROM1 (Flash) | 277,768 B | 1,048,576 B | 26.5% | 参考 |
|
||||
| RW_CCM | 57,376 B | 65,280 B | 87.9% | PASS |
|
||||
| UNINIT_CCM | 48 B | 256 B | 18.8% | 参考 |
|
||||
| RW_IRAM1 | 94,336 B | 131,072 B | 72.0% | PASS |
|
||||
@@ -24,7 +24,7 @@
|
||||
|---|---|---|---|
|
||||
| 网络 | 13,702 B | 12 KB | ⚠ 超 1.4 KB |
|
||||
| 存储 | 7,072 B | 12 KB | OK |
|
||||
| UI | 36,441 B | 16 KB | ⚠ 超 19.6 KB |
|
||||
| UI | 36,442 B | 16 KB | ⚠ 超 19.6 KB |
|
||||
| RTOS 堆 | 57,376 B | 56 KB | 堆=配额 |
|
||||
| 应用 | 26,333 B | 8 KB | ⚠ 超 17.7 KB |
|
||||
| 其它 | 10,780 B | — | 参考 |
|
||||
|
||||
@@ -14,4 +14,4 @@ date code ro rw zi er_irom1 er_pct iram1 iram1_pct ccm ccm_pct top_rwzi
|
||||
2026-10-29 238936 29140 1932 141396 268076 25.6 85904 65.5 57376 87.9 heap_4.o=57376;lv_mem_core_builtin.o=16384;lftpd.o=7884;ui_net_sink.o=6770;ui_port.o=6420;nand_ftl.o=6216;sb_link.o=4364;ch395f.o=4162;console_log.o=4132;sys_log_mcu.o=4055
|
||||
2026-10-29 243552 28784 1972 145388 272336 26.0 89936 68.6 57376 87.9 heap_4.o=57376;lv_mem_core_builtin.o=16384;lftpd.o=7884;ui_net_sink.o=6770;ui_port.o=6420;nand_ftl.o=6216;wave_ring.o=5296;ch395f.o=4162;console_log.o=4132;sys_log_mcu.o=4055
|
||||
2026-10-30 246720 29836 2052 149708 276556 26.4 94336 72.0 57376 87.9 heap_4.o=57376;lv_mem_core_builtin.o=16384;lftpd.o=7884;ui_net_sink.o=6770;ui_port.o=6432;nand_ftl.o=6216;wave_ring.o=5296;sb_link.o=4376;ch395f.o=4162;console_log.o=4132
|
||||
2026-11-02 247048 29836 2052 149708 276884 26.4 94336 72.0 57376 87.9 heap_4.o=57376;lv_mem_core_builtin.o=16384;lftpd.o=7884;ui_net_sink.o=6770;ui_port.o=6432;nand_ftl.o=6216;wave_ring.o=5296;sb_link.o=4376;ch395f.o=4162;console_log.o=4132
|
||||
2026-11-02 247652 30116 2052 149708 277768 26.5 94336 72.0 57376 87.9 heap_4.o=57376;lv_mem_core_builtin.o=16384;lftpd.o=7884;ui_net_sink.o=6770;ui_port.o=6432;nand_ftl.o=6216;wave_ring.o=5296;sb_link.o=4376;ch395f.o=4162;console_log.o=4132
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"built_at": "2026-11-02T16:13:12+08:00",
|
||||
"fingerprint": "66b6a154966ac9ce651c778bf07c79ae02f469e1cebf1f7e3f8d21a4eaf24500",
|
||||
"built_at": "2026-11-02T17:39:58+08:00",
|
||||
"fingerprint": "0dc67e164f92d0074da5390bdd440eef99027e2dd181311a52bd92e6453a44cc",
|
||||
"fingerprint_files": 1466,
|
||||
"fingerprint_source": "git-index",
|
||||
"gated_regions": [
|
||||
"RW_IRAM1",
|
||||
"RW_CCM"
|
||||
],
|
||||
"git_head": "cf8b9ccc74372378cb39e232266d3708b344db1f",
|
||||
"git_head": "1b074bc41a9c3b4c8f0f382cb58862ce9d15b0fe",
|
||||
"map": "MDK-ARM/STM32F407-Demo/STM32F407-Demo.map",
|
||||
"map_mtime": 1793604778,
|
||||
"map_mtime": 1793612338,
|
||||
"pct": {
|
||||
"ER_IROM1": 26.41,
|
||||
"ER_IROM1": 26.49,
|
||||
"RW_CCM": 87.89,
|
||||
"RW_IRAM1": 71.97,
|
||||
"UNINIT_CCM": 18.75
|
||||
@@ -19,7 +19,7 @@
|
||||
"regions": {
|
||||
"ER_IROM1": {
|
||||
"max": 1048576,
|
||||
"size": 276884
|
||||
"size": 277768
|
||||
},
|
||||
"RW_CCM": {
|
||||
"max": 65280,
|
||||
@@ -37,8 +37,8 @@
|
||||
"schema": 2,
|
||||
"scope_note": "\u540c\u7801\u51ed\u8bc1\uff1a\u6307\u7eb9\u8986\u76d6\u56fa\u4ef6\u4f53\u79ef\u76f8\u5173\u6e90\u7801\uff0c\u53e3\u5f84\u89c1\u672c\u811a\u672c docstring",
|
||||
"sizes": {
|
||||
"code": 247048,
|
||||
"ro_data": 29836,
|
||||
"code": 247652,
|
||||
"ro_data": 30116,
|
||||
"rw_data": 2052,
|
||||
"zi_data": 149708
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user