From f05b056318caf5707779ea4f69130af942a26d23 Mon Sep 17 00:00:00 2001 From: Wanderingss <1624155937@qq.com> Date: Sun, 20 Sep 2026 05:16:27 +0800 Subject: [PATCH] =?UTF-8?q?FTL=E8=AF=8A=E6=96=AD=EF=BC=9A=E6=8E=A2?= =?UTF-8?q?=E9=92=88=E7=AA=97=E5=8F=A3=E5=89=8D=E7=A7=BB=E8=87=B3f=5Fmount?= =?UTF-8?q?=E5=89=8D+=E9=A1=B5=E5=86=85=E5=AE=B9=E6=8C=87=E7=BA=B9?= =?UTF-8?q?=EF=BC=88=E5=AE=9A=E4=BD=8D=E6=8C=82=E8=BD=BD=E6=9C=9F=E5=9D=8F?= =?UTF-8?q?=E8=AF=BB=E6=9D=A5=E6=BA=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Drivers/BSP/GD5F2GQ5UE/nand_ftl.c | 10 ++++++++-- Src/freertos.c | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c b/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c index e89a37fd..6a2fa097 100644 --- a/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c +++ b/Drivers/BSP/GD5F2GQ5UE/nand_ftl.c @@ -105,8 +105,14 @@ static int ftl_read_page(dhara_sector_t lpn) { s_cached_lpn = lpn; s_cache_dirty = 0; if (s_tree_probe_log) { - DBG_INFO("ftl read LPN=%lu (binding see nand read lines)", - (unsigned long)lpn); + /* 内容指纹:前 8 字节(BPB=33 52 / FAT32=F8 FF.. / 擦除=FF FF..) + * 半新半旧混合页在此直接现形 */ + DBG_INFO("ftl t %lu read LPN=%lu: %02X %02X %02X %02X %02X %02X %02X %02X", + (unsigned long)HAL_GetTick(), (unsigned long)lpn, + (unsigned int)s_cache_buf[0], (unsigned int)s_cache_buf[1], + (unsigned int)s_cache_buf[2], (unsigned int)s_cache_buf[3], + (unsigned int)s_cache_buf[4], (unsigned int)s_cache_buf[5], + (unsigned int)s_cache_buf[6], (unsigned int)s_cache_buf[7]); } return GD5F_OK; } diff --git a/Src/freertos.c b/Src/freertos.c index f918c2fb..c0c371a1 100644 --- a/Src/freertos.c +++ b/Src/freertos.c @@ -226,8 +226,10 @@ void StartDefaultTask(void *argument) * (/config.ini 丢失 → 配置引擎首启路径回落工厂默认并自动重建模板)—— * 仅当卷已不可用时触发,可用设备 > 一份配置文件。 */ static FATFS default_fatfs; + nand_ftl_set_tree_probe(1); /* 诊断窗口:挂载+探针的读路径全记录 */ FRESULT fr = f_mount(&default_fatfs, "", 1); if (fr == FR_NO_FILESYSTEM) { + nand_ftl_set_tree_probe(0); /* mkfs 路径不追踪(I/O 洪泛) */ DBG_INFO("[FS] no FAT volume, formatting NAND..."); static uint8_t fs_work[FF_MAX_SS]; MKFS_PARM opts = { FM_FAT32, 0, 0, 0, 0 };