From 7bfa312b56b59f4a937ed2005532e5daa74ec445 Mon Sep 17 00:00:00 2001 From: Wanderingss <1624155937@qq.com> Date: Sun, 20 Sep 2026 05:07:12 +0800 Subject: [PATCH] =?UTF-8?q?GD5F=E6=B2=89=E9=99=8D=E5=BB=B6=E6=97=B6?= =?UTF-8?q?=E8=B0=83=E8=87=B32ms=EF=BC=88=E5=85=BC=E9=A1=BEBBT=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E8=80=97=E6=97=B6=EF=BC=89+=E6=8E=A2=E9=92=88?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0meta=E5=8C=BA=E5=AD=97=E8=8A=82=EF=BC=88?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=8D=8A=E6=96=B0=E5=8D=8A=E6=97=A7=E9=A1=B5?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=B6=88=E9=99=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.h | 5 +++-- Drivers/BSP/GD5F2GQ5UE/nand_ftl.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.h b/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.h index 045b0db5..7823a96c 100644 --- a/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.h +++ b/Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.h @@ -65,9 +65,10 @@ extern "C" { * 确定性早于 0Bh 读完成)→ 0Bh 流式读到"前段新、后段旧"的混合页 * (journal checkpoint header 有效而 meta 残留旧数据 → 复位后 resume * 锚定新 checkpoint 却读到旧树 → 数据静默丢失)。13h 之后、0Bh 之前 - * 强制等待该时长,保证整页新鲜。取值须覆盖低 VDD 下 t_RR 最慢工况。 + * 强制等待该时长,保证整页新鲜。取值须覆盖低 VDD 下 t_RR 最慢工况, + * 同时受开机 BBT 全片扫描(2048 次页读)耗时约束:2ms 实测两可。 */ -#define GD5F_PAGE_READ_SETTLE_MS 5 +#define GD5F_PAGE_READ_SETTLE_MS 2 #define GD5F_TOTAL_BLOCKS 2048 #define GD5F_TOTAL_SIZE (GD5F_TOTAL_BLOCKS * GD5F_BLOCK_SIZE) diff --git a/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c b/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c index 8ace4b1c..b65e6670 100644 --- a/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c +++ b/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c @@ -231,16 +231,20 @@ int dhara_nand_read(const struct dhara_nand *n, dhara_page_t p, size_t offset, s if (s_probe_log && offset == 0 && length == FTL_PAGE_SIZE) { /* 组末页(组内偏移 15:页号低 4 位 = 15)= checkpoint 页: - * 记录 raw 前 4 字节 + 时间戳(捕捉 stale buffer: - * 读到上一页残留 = 13h 就绪信号早于 buffer 装载完成) */ + * 记录 header 前 4 字节 + meta 区 4 字节(偏移 944 = 槽 7, + * 树根 meta)+ 时间戳。header 新/meta 旧 = 半新半旧混合页 + * (低 VDD 就绪信号提前竞态的直接证据) */ if ((p & 15u) == 15u) { const uint8_t *m = data; - DBG_INFO("probe t %lu pg %lu blk %lu g%lu: %02X %02X %02X %02X", + DBG_INFO("probe t %lu pg %lu blk %lu g%lu: %02X %02X %02X %02X" + " meta %02X %02X %02X %02X", (unsigned long)HAL_GetTick(), (unsigned long)phy_pg, (unsigned long)(p >> 6), (unsigned long)((p >> 4) & 3u), (unsigned int)m[0], (unsigned int)m[1], - (unsigned int)m[2], (unsigned int)m[3]); + (unsigned int)m[2], (unsigned int)m[3], + (unsigned int)m[944], (unsigned int)m[945], + (unsigned int)m[946], (unsigned int)m[947]); } } return 0;